merge hedgeroid branch with tip hedgeroid
authorXeli
Sun, 28 Oct 2012 13:28:23 +0100
branchhedgeroid
changeset 7855 ddcdedd3330b
parent 6350 41b0a9955c47 (current diff)
parent 7854 0b447175594f (diff)
child 7857 2bc61f8841a1
merge hedgeroid branch with tip
QTfrontend/model/hats.cpp
QTfrontend/model/hats.h
QTfrontend/model/themesmodel.cpp
QTfrontend/model/themesmodel.h
QTfrontend/res/chat_default.png
QTfrontend/res/chat_default_off.png
QTfrontend/res/chat_default_on.png
QTfrontend/res/chat_friend.png
QTfrontend/res/chat_friend_off.png
QTfrontend/res/chat_friend_on.png
QTfrontend/res/chat_ignore.png
QTfrontend/res/chat_ignore_off.png
QTfrontend/res/chat_ignore_on.png
QTfrontend/util/HWDataManager.cpp
QTfrontend/util/HWDataManager.h
hedgewars/HHHandlers.inc
hedgewars/PascalExports.pas
hedgewars/uKeys.pas
misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.mode1v3
misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.pbxuser
misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj
misc/libfreetype/Xcode-iPhoneOS/Freetype_Prefix.pch
misc/libtremor/tremor/Version_script.in
misc/libtremor/tremor/backends.h
misc/libtremor/tremor/block.c
misc/libtremor/tremor/block.h
misc/libtremor/tremor/registry.c
misc/libtremor/tremor/registry.h
misc/libtremor/tremor/sharedbook.c
misc/libtremor/tremor/synthesis.c
misc/libtremor/tremor/window.c
misc/libtremor/tremor/window.h
project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TouchInterface/TouchInterface.java
project_files/Android-build/Templates/complete_build.sh
project_files/Android-build/Templates/default.properties
project_files/Android-build/Templates/local.properties
project_files/Android-build/Templates/pushToDevice.sh
project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h
project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m
project_files/HedgewarsMobile/Classes/HelpPageInGameViewController-iPad.xib
project_files/HedgewarsMobile/Classes/HelpPageInGameViewController-iPhone.xib
project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPad.xib
project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPhone.xib
project_files/HedgewarsMobile/Classes/HelpPageViewController.h
project_files/HedgewarsMobile/Classes/HelpPageViewController.m
project_files/HedgewarsMobile/Classes/InGameMenuViewController.h
project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
project_files/HedgewarsMobile/Classes/OverlayViewController.h
project_files/HedgewarsMobile/Classes/OverlayViewController.m
project_files/HedgewarsMobile/Classes/OverlayViewController.xib
project_files/HedgewarsMobile/Resources/Overlay/ammoButton.png
project_files/HedgewarsMobile/Resources/Overlay/ammoButton@2x.png
project_files/HedgewarsMobile/Resources/Overlay/arrowDown.png
project_files/HedgewarsMobile/Resources/Overlay/arrowDown@2x.png
project_files/HedgewarsMobile/Resources/Overlay/arrowLeft.png
project_files/HedgewarsMobile/Resources/Overlay/arrowLeft@2x.png
project_files/HedgewarsMobile/Resources/Overlay/arrowRight.png
project_files/HedgewarsMobile/Resources/Overlay/arrowRight@2x.png
project_files/HedgewarsMobile/Resources/Overlay/arrowUp.png
project_files/HedgewarsMobile/Resources/Overlay/arrowUp@2x.png
project_files/HedgewarsMobile/Resources/Overlay/cornerButton.png
project_files/HedgewarsMobile/Resources/Overlay/cornerButton@2x.png
project_files/HedgewarsMobile/Resources/Overlay/helpabove.png
project_files/HedgewarsMobile/Resources/Overlay/helpbottom.png
project_files/HedgewarsMobile/Resources/Overlay/helpingame.png
project_files/HedgewarsMobile/Resources/Overlay/helpleft.png
project_files/HedgewarsMobile/Resources/Overlay/helpplain.png
project_files/HedgewarsMobile/Resources/Overlay/helpright.png
project_files/HedgewarsMobile/Resources/Overlay/joyButtonAttack.png
project_files/HedgewarsMobile/Resources/Overlay/joyButtonAttack@2x.png
project_files/HedgewarsMobile/Resources/Overlay/joyButtonBackJump.png
project_files/HedgewarsMobile/Resources/Overlay/joyButtonBackJump@2x.png
project_files/HedgewarsMobile/Resources/Overlay/joyButtonForwardJump.png
project_files/HedgewarsMobile/Resources/Overlay/joyButtonForwardJump@2x.png
project_files/HedgewarsMobile/Resources/backSound.wav
project_files/HedgewarsMobile/Resources/clickSound.wav
project_files/HedgewarsMobile/Resources/selSound.wav
project_files/HedgewarsMobile/SDL-50560ca58f80.patch
share/hedgewars/Data/Graphics/Hats/Reserved/a1ed4756b565d13aaecb1f2b1a556570alwayss.png
share/hedgewars/Data/Maps/Sticks/map.cfg
share/hedgewars/Data/Maps/Sticks/preview@2x.png
share/hedgewars/Data/Music/Nature.ogg
share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist
share/hedgewars/Data/Scripts/plist/Capture the Flag.plist
share/hedgewars/Data/Scripts/plist/Gaudy Racer.plist
share/hedgewars/Data/Scripts/plist/No Jumping.plist
share/hedgewars/Data/Scripts/plist/Normal.plist
share/hedgewars/Data/Scripts/plist/Random Weapon.plist
share/hedgewars/Data/Scripts/plist/Space Invasion.plist
share/hedgewars/Data/Scripts/plist/The Specialists.plist
share/hedgewars/Data/Scripts/plist/Tumbler.plist
--- a/.hgeol	Thu Nov 24 13:44:30 2011 +0100
+++ b/.hgeol	Sun Oct 28 13:28:23 2012 +0100
@@ -6,3 +6,4 @@
 **.txt = native
 **.pas = native
 **.inc = native
+**.hs = native
--- a/.hgignore	Thu Nov 24 13:44:30 2011 +0100
+++ b/.hgignore	Sun Oct 28 13:28:23 2012 +0100
@@ -3,11 +3,14 @@
 glob:moc_*.cxx
 glob:qrc_*.cxx
 glob:*.o
+glob:*.qm
 glob:Makefile
 glob:bin
 glob:*.hi
+glob:*.ppu
 glob:*.*~
 glob:*.core
+glob:hedgewars.pro.user
 glob:config.inc
 glob:cmake_install.cmake
 glob:QTfrontend/hwconsts.cpp
@@ -26,7 +29,7 @@
 glob:misc/libtremor/Xcode/build/
 glob:misc/liblua/Xcode/build/
 glob:misc/libfreetype/Xcode/build/
-glob:misc/libfreetype/Xcode-iPhoneOS/build/
+glob:misc/libfreetype/Xcode-iOS/build/
 glob:moc_*.cxx_parameters
 relre:^release\/
 glob:*.log
@@ -42,9 +45,14 @@
 glob:project_files/Android-build/SDL-android-project/bin
 glob:project_files/Android-build/SDL-android-project/gen
 glob:project_files/Android-build/SDL-android-project/local.properties
+glob:project_files/Android-build/SDL-android-project/project.properties
 glob:project_files/Android-build/SDL-android-project/default.properties
+glob:project_files/Android-build/SDL-android-project/proguard.cfg
 glob:project_files/Android-build/SDL-android-project/.*
-glob:project_files/Android-build/complete_build.sh
-glob:project_files/Android-build/pushToDevice.sh
+glob:project_files/Android-build/out
 glob:project_files/Android-build/Makefile.android
-glob:project_files/Android-build/out
+glob:hedgewars-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug
+glob:hedgewars-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release
+glob:*.depends
+glob:tools/build_windows_koda.bat
+
--- a/.hgtags	Thu Nov 24 13:44:30 2011 +0100
+++ b/.hgtags	Sun Oct 28 13:28:23 2012 +0100
@@ -46,3 +46,7 @@
 cba92708277b6d0aeabfff2b878845b7d848bdcd Hedgewars-iOS-1.3.1
 74bc72746bec68806344f4ba7be0d1bc6e05d380 0.9.16-release
 652a199d4f38f5becbec0839f5a1f63294dd89bf Hedgewars-iOS-1.3.2
+4670f003f91b3246665ca0de95fa056d2d2f3f54 0-9.17-release
+0000000000000000000000000000000000000000 0-9.17-release
+4670f003f91b3246665ca0de95fa056d2d2f3f54 0.9.17-release
+ce2b24995ab2efc088accecd7f7b116bb946fff7 hedgeroid-alpha
--- a/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -4,9 +4,9 @@
 #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,194 +15,243 @@
 set(version_suffix "-dev") #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 40)
+set(CPACK_PACKAGE_VERSION_PATCH 18${version_suffix})
+set(HEDGEWARS_PROTO_VER 42)
 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(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
 
 
 #bundle .app setup
-if(APPLE)
-	set(CMAKE_FIND_FRAMEWORK "FIRST")
+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()
 
-	#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 ".")
+if(APPLE)
+    set(CMAKE_FIND_FRAMEWORK "FIRST")
 
-	#what system are we building for
-	set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET})
+    #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})
+    #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()
+    #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()
+    #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()
 
-	#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()
+    #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()
 
-	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()
+    #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()
 
-	#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()
+    #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()
 
-	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}")
+    #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)
-
-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()
+#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)
 
 
-#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()
 
-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)
+set(pascal_flags ${fpflags_parsed} "-vm4079,4080,4081" "-B" "-FE../bin" "-Cs2000000" "-vewnq" "-dDEBUGFILE" ${pascal_flags})
+set(haskell_flags "-O2" ${ghflags_parsed} ${haskell_flags})
+
+#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})
 
 
-if(WITH_SERVER)
-	find_program(ghc_executable ghc)
+#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)
-	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)
+    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()
+
 
-add_subdirectory(misc/liblua)
+#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()
+
+
+#main engine
 add_subdirectory(hedgewars)
 
-#run cmake -DBUILD_ANDROID_PORT=1 to enable this
-if(BUILD_ANDROID_PORT)
-	add_subdirectory(project_files/Android-build)
+#Android related build scripts
+if(ANDROID)
+    #run cmake -DANDROID=1 to enable this
+    add_subdirectory(project_files/Android-build)
 endif()
 
-if(NOT BUILD_ENGINE_LIBRARY)
-	add_subdirectory(bin)
-	add_subdirectory(misc/quazip)
-	add_subdirectory(QTfrontend)
-	add_subdirectory(share)
-	add_subdirectory(tools)
+#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()
 
 
@@ -217,74 +266,74 @@
 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@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@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)
--- a/CREDITS	Thu Nov 24 13:44:30 2011 +0100
+++ b/CREDITS	Sun Oct 28 13:28:23 2012 +0100
@@ -18,6 +18,12 @@
 - 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
--- a/ChangeLog.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/ChangeLog.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,11 +1,40 @@
 + 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
  + More attractive mission screen with previews
  + Chat timestamping, links, input history, tab completion
+ + AI smarter, now uses switch. Also tweaks to mine/crate/barrel rules
  + Customisable chat by dragging a .css file, see file generated by the /saveStyleSheet command
  + Errors/warnings in chat instead of popup boxes
  + Mousewheel to change hog/weapon counts in game creation
@@ -19,6 +48,7 @@
  + Grenades/bazooka/melon pieces/ballgun now kicked by explosions
  + Minor theme optimisation, Optional SkyR
  + Camera follows melon, clusterbomb, gas cloud
+ * More fixes to fullscreen/window resize on non-Linux systems
  * Vertical movement should be restricted for small displays, camera will try less hard to keep hog in centre
  * Keep mouse from jumping around when ammo menu is active
  * Hogs can now move after trapping another hog in a portal loop
@@ -30,7 +60,7 @@
  * Girders no longer make windows in tunnels
  * Prevent some more escaping through border, firepunch, pickhammer
  * Many frontend bugfixes, code cleanup. Crash in game abort, flake clipping, invalid state on room close
- * Many other engine bugfixes.  SDL event crasher, timebox crasher, birdy hang, desync on quits, crash in birdy eggshell, clouds on Deep Space theme, etc
+ * Many other engine bugfixes.  SDL event crasher, timebox crasher, birdy hang, desync on quits, crash in birdy eggshell, hammer + vamp + invuln, clouds on Deep Space theme, etc
 
 0.9.15 -> 0.9.16:
  + In-game chat now supports backspace-repeat and Escape to close the text input area
--- a/INSTALL	Thu Nov 24 13:44:30 2011 +0100
+++ b/INSTALL	Sun Oct 28 13:28:23 2012 +0100
@@ -18,9 +18,9 @@
 $ 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:
--- a/QTfrontend/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -11,7 +11,9 @@
 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 @@
 # 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}/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 @@
 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_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 @@
     hwform.cpp
     main.cpp
     team.cpp
+    campaign.cpp
     ui_hwform.cpp
     ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp
     )
@@ -119,6 +130,8 @@
     HWApplication.h
     hwform.h
     team.h
+    util/DataManager.h
+    util/libav_iteraction.h
     )
 
 set(hwfr_hdrs
@@ -130,6 +143,7 @@
     KB.h
     hwconsts.h
     sdlkeys.h
+    campaign.h
     )
 
 set(hwfr_rez hedgewars.qrc)
@@ -139,7 +153,7 @@
 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 @@
     ${QT_LIBRARIES}
     ${SDL_LIBRARY}
     ${SDLMIXER_LIBRARY}
+    ${FFMPEG_LIBRARIES}
     ${HW_LINK_LIBS}
     )
 
@@ -185,7 +200,11 @@
 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})
--- a/QTfrontend/CocoaInitializer.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/CocoaInitializer.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/CocoaInitializer.mm	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/CocoaInitializer.mm	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/HWApplication.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/HWApplication.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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());
--- a/QTfrontend/HWApplication.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/HWApplication.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/InstallController.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/InstallController.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/InstallController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/InstallController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/KB.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/KB.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/M3InstallController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/M3InstallController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -42,7 +42,9 @@
 //#endif
 
 
-@interface M3InstallController : NSObject {
+@interface M3InstallController :
+NSObject
+{
     NSAlert *alert;
 }
 
--- a/QTfrontend/M3InstallController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/M3InstallController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -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];
--- a/QTfrontend/M3Panel.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/M3Panel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/M3Panel.mm	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/M3Panel.mm	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/NSWorkspace_RBAdditions.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/NSWorkspace_RBAdditions.h	Sun Oct 28 13:28:23 2012 +0100
@@ -32,6 +32,7 @@
 //- 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
--- a/QTfrontend/NSWorkspace_RBAdditions.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/NSWorkspace_RBAdditions.m	Sun Oct 28 13:28:23 2012 +0100
@@ -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 @@
 				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 @@
 				[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 @@
 
 // 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 @@
 	}
 	return [NSString stringWithFormat:@"afp://%@/%@",dns?:(ip?:@""),volname];
 }
+*/
 
 @implementation NSWorkspace (NSWorkspace_RBAdditions)
 
--- a/QTfrontend/SparkleAutoUpdater.mm	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/SparkleAutoUpdater.mm	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/achievements.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/achievements.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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", ""},
--- a/QTfrontend/achievements.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/achievements.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/binds.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/binds.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
@@ -52,8 +52,8 @@
     {"+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},
+    {"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},
@@ -62,7 +62,9 @@
     {"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:")}
+    {"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:")}
 };
--- a/QTfrontend/binds.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/binds.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/campaign.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,90 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
+}
+
+
+    
+
+
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/campaign.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/drawmapscene.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/drawmapscene.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 @@
             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 @@
     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 @@
     {
         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::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::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 @@
     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 @@
     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 @@
     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 @@
 
 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 @@
         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);
+            if(params.points.size())
+            {
+                addPath(pointsToPath(params.points), m_pen);
+
+                paths.prepend(params);
+
+                params.points.clear();
+            }
 
-            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 @@
         }
     }
 
-    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 @@
         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;
+}
--- a/QTfrontend/drawmapscene.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/drawmapscene.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
+        Q_OBJECT
+    public:
+        explicit DrawMapScene(QObject *parent = 0);
+
+        QByteArray encode();
+        void decode(QByteArray data);
+        int pointsCount();
 
-    QByteArray encode();
-    void decode(QByteArray data);
+    signals:
+        void pathChanged();
 
-signals:
-    void pathChanged();
+    public slots:
+        void undo();
+        void clearMap();
+        void simplifyLast();
+        void setErasing(bool erasing);
+        void showCursor();
+        void hideCursor();
 
-public slots:
-    void undo();
-    void clearMap();
-    void simplifyLast();
+    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;
 
-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);
+        virtual void wheelEvent(QGraphicsSceneWheelEvent *);
 
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
+        QPainterPath pointsToPath(const QList<QPoint> points);
 
-    QPainterPath pointsToPath(const QList<QPoint> points);
+        quint8 serializePenWidth(int width);
+        int deserializePenWidth(quint8 width);
 };
 
 #endif // DRAWMAPSCENE_H
--- a/QTfrontend/game.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/game.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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 @@
 {
     QByteArray buf;
     QString gt;
-    switch (gameType) {
+    switch (gameType)
+    {
         case gtDemo:
             gt = "TD";
             break;
@@ -96,9 +101,9 @@
             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::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 @@
 {
     QByteArray traincfg;
     HWProto::addStringToBuffer(traincfg, "TL");
-
+    HWProto::addStringToBuffer(traincfg, "eseed " + QUuid::createUuid().toString());
     HWProto::addStringToBuffer(traincfg, "escript " + training);
 
     RawSendIPC(traincfg);
@@ -160,8 +168,9 @@
 {
     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::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 @@
             }
             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 @@
             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 @@
     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 @@
 {
     gameState = state;
     emit GameStateChanged(state);
+    if (gameType == gtCampaign)
+    {
+      emit CampStateChanged(1);
+    }
 }
 
 void HWGame::abort()
@@ -388,3 +431,29 @@
     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);
+}
+
--- a/QTfrontend/game.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/game.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 GameCFGWidget;
 class TeamSelWidget;
 
-enum GameState {
+enum GameState
+{
     gsNotStarted = 0,
     gsStarted  = 1,
     gsInterrupted = 2,
@@ -39,68 +40,79 @@
     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
--- a/QTfrontend/gameuiconfig.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/gameuiconfig.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     //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 @@
 
     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 @@
 
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
     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 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 @@
 
 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 @@
             }
         }
     }
-    
+
     // Don't filter anything
     return false;
 }
@@ -361,3 +482,43 @@
 {
     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();
+}
--- a/QTfrontend/gameuiconfig.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/gameuiconfig.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/hedgewars.qrc	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/hedgewars.qrc	Sun Oct 28 13:28:23 2012 +0100
@@ -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>
--- a/QTfrontend/hwconsts.cpp.in	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/hwconsts.cpp.in	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 * 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 @@
 
 bool haveServer = ${HAVE_NETSERVER};
 bool isDevBuild = ${HW_DEV};
+
+int season = SEASON_NONE;
+int years_since_foundation = 0;
--- a/QTfrontend/hwconsts.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/hwconsts.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 bool haveServer;
 extern bool isDevBuild;
+
+//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;
+
 #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_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_CRAZY_QT       "999999999999999999299999999999999929999999990999999209"
-#define AMMOLINE_CRAZY_PROB     "111111011111111111111111111111111111111111110111111101"
-#define AMMOLINE_CRAZY_DELAY    "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CRAZY_CRATE    "131111031211111112311411111111111111121111010111111101"
+#define AMMOLINE_PROMODE_QT     "90900090000000000000090000000000000000000000000000000001"
+#define AMMOLINE_PROMODE_PROB   "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_DELAY  "00000000000002055000000400070040000000002000000000000009"
+#define AMMOLINE_PROMODE_CRATE  "11111111111111111111111111111111111111111001011111110101"
 
-#define AMMOLINE_PROMODE_QT     "909000900000000000000900000000000000000000000000000000"
-#define AMMOLINE_PROMODE_PROB   "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_PROMODE_DELAY  "000000000000020550000004000700400000000020000000000000"
-#define AMMOLINE_PROMODE_CRATE  "111111111111111111111111111111111111111110010111111101"
+#define AMMOLINE_SHOPPA_QT      "00000099000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_PROB    "44444100442444022101121212224220000000020004000100110000"
+#define AMMOLINE_SHOPPA_DELAY   "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_CRATE   "11111111111111111111111111111111111111111011011111110001"
 
-#define AMMOLINE_SHOPPA_QT      "000000990000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_PROB    "444441004424440221011212122242200000000200040001001100"
-#define AMMOLINE_SHOPPA_DELAY   "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_CRATE   "111111111111111111111111111111111111111110110111111100"
+#define AMMOLINE_CLEAN_QT       "10100090000100000110000000000000000000000000000010000000"
+#define AMMOLINE_CLEAN_PROB     "04050405416006555465544647765766666661555101011154110101"
+#define AMMOLINE_CLEAN_DELAY    "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_CLEAN_CRATE    "13111103121111111231141111111111111112111111011111110101"
 
-#define AMMOLINE_CLEAN_QT       "101000900001000001100000000000000000000000000000100000"
-#define AMMOLINE_CLEAN_PROB     "040504054160065554655446477657666666615551010111541101"
-#define AMMOLINE_CLEAN_DELAY    "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CLEAN_CRATE    "131111031211111112311411111111111111121111110111111101"
+#define AMMOLINE_MINES_QT       "00000099000900000003000000000000000000000000000000000000"
+#define AMMOLINE_MINES_PROB     "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_MINES_DELAY    "00000000000002055000000400070040000000002000000006000000"
+#define AMMOLINE_MINES_CRATE    "11111111111111111111111111111111111111111111011111110101"
 
-#define AMMOLINE_MINES_QT       "000000990009000000030000000000000000000000000000000000"
-#define AMMOLINE_MINES_PROB     "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_MINES_DELAY    "000000000000020550000004000700400000000020000000060000"
-#define AMMOLINE_MINES_CRATE    "111111111111111111111111111111111111111111110111111101"
+#define AMMOLINE_PORTALS_QT     "90000090020000000021000000000000001100000900000000000000"
+#define AMMOLINE_PORTALS_PROB   "04050405416006555465544647765766666661555101011154110100"
+#define AMMOLINE_PORTALS_DELAY  "00000000000002055000000400070040000000002000000006000000"
+#define AMMOLINE_PORTALS_CRATE  "13111103121111111231141111111111111112111111011111110101"
 
-#define AMMOLINE_PORTALS_QT     "900000900200000000210000000000000011000009000000000000"
-#define AMMOLINE_PORTALS_PROB   "040504054160065554655446477657666666615551010111541101"
-#define AMMOLINE_PORTALS_DELAY  "000000000000020550000004000700400000000020000000060000"
-#define AMMOLINE_PORTALS_CRATE  "131111031211111112311411111111111111121111110111111101"
-
+//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 @@
                               0xffcfcfc4, /. pastel gray    ./ \
                               0xffbff000, /. lime           ./ \
                               0xffffef00, /. yellow         ./ \
-                              // add new colors here 
+                              // add new colors here
                               0 }*/
 /*
 #define HW_TEAMCOLOR_ARRAY  { 0xffd12b42, /. red    ./ \
--- a/QTfrontend/hwform.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/hwform.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,12 +85,17 @@
 #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"
@@ -90,22 +105,26 @@
 #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 +132,7 @@
 #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 +144,7 @@
 
     config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini");
 
+    ui.pageVideos->init(config);
 
 #ifdef __APPLE__
     panel = new M3Panel;
@@ -141,11 +161,14 @@
     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 +189,12 @@
 
     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 +204,22 @@
     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 +233,7 @@
     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 +242,7 @@
     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 +254,7 @@
     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 +285,13 @@
 
     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 +301,35 @@
 
     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 +346,26 @@
         {
             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 +381,27 @@
 
 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 +429,16 @@
 
     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 +447,17 @@
 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 +526,11 @@
     GoToPage(ID_PAGE_SCHEME);
 }
 
+void HWForm::GoToVideos()
+{
+    GoToPage(ID_PAGE_VIDEOS);
+}
+
 void HWForm::OnPageShown(quint8 id, quint8 lastid)
 {
 #ifdef USE_XFIRE
@@ -466,7 +540,8 @@
     {
         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 +551,205 @@
         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) {
+        }
+        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 (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_SETUP)
+    {
+        config->reloadValues();
+    }
 
-    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_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
+
+        QParallelAnimationGroup *group = new QParallelAnimationGroup;
+        group->addAnimation(animationOldSlide);
+        group->addAnimation(animationNewSlide);
+#ifdef false
+        group->addAnimation(animationOldOpacity);
+        group->addAnimation(animationNewOpacity);
+#endif
+
+        connect(animationOldSlide, SIGNAL(finished()), ui.Pages->widget(lastid), SLOT(hide()));
+        group->start();
+
+    	/* 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 +758,74 @@
 
     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
+
+        QParallelAnimationGroup *group = new QParallelAnimationGroup;
+        group->addAnimation(animationOldSlide);
+        group->addAnimation(animationNewSlide);
+#ifdef false
+        group->addAnimation(animationOldOpacity);
+        group->addAnimation(animationNewOpacity);
+#endif
+
+        connect(animationNewSlide, SIGNAL(finished()), ui.Pages->widget(curid), SLOT(hide()));
+        group->start();
+    }
+#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 +843,19 @@
 {
 //   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 +863,19 @@
     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 +899,35 @@
 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 +950,7 @@
     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 +978,34 @@
 
 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 +1014,11 @@
 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 +1053,7 @@
             ui.pageNetGame->displayError(errmsg);
             break;
         default:
-        ui.pageRoomsList->displayError(errmsg);
+            ui.pageRoomsList->displayError(errmsg);
     }
 }
 
@@ -797,7 +1067,8 @@
 
 void HWForm::_NetConnect(const QString & hostName, quint16 port, QString nick)
 {
-    if(hwnet) {
+    if(hwnet)
+    {
         hwnet->Disconnect();
         delete hwnet;
         hwnet=0;
@@ -807,111 +1078,112 @@
 
     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(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection);
+    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 +1203,13 @@
     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 +1234,7 @@
         netPort = hpd->sbPort->value();
         NetConnectServer(*netHost, netPort);
     }
+    delete hpd;
 }
 
 void HWForm::NetStartServer()
@@ -968,10 +1242,10 @@
     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 +1254,8 @@
     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 +1265,8 @@
 
 void HWForm::NetDisconnect()
 {
-    if(pnetserver) {
+    if(pnetserver)
+    {
         if (pRegisterServer)
         {
             pRegisterServer->unregister();
@@ -1009,13 +1284,20 @@
 
 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 +1325,8 @@
 {
     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 +1336,10 @@
 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 +1353,8 @@
             setFocusPolicy(Qt::NoFocus);
             break;
         }
-        case gsFinished: {
+        case gsFinished:
+        {
             //setVisible(true);
             setFocusPolicy(Qt::StrongFocus);
             if (id == ID_PAGE_INGAME) GoBack();
@@ -1080,14 +1365,16 @@
             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 +1388,65 @@
 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(':','-');
+        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";
+        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));
+        else
+        {
+            demofile.write(demo);
+            demofile.close();
+        }
     }
 
-
-    QFile demofile(filename);
-    if (!demofile.open(QIODevice::WriteOnly))
-    {
-        ShowErrorMessage(tr("Cannot save record to file %1").arg(filename));
-        return ;
-    }
-    demofile.write(demo);
-    demofile.close();
+    ui.pageVideos->startEncoding(record);
 }
 
 void HWForm::startTraining(const QString & scriptName)
@@ -1164,15 +1460,21 @@
 {
     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);
 
@@ -1191,6 +1493,7 @@
     xfire_free();
 #endif
     config->SaveOptions();
+    config->SaveVideosOptions();
     event->accept();
 }
 
@@ -1227,19 +1530,21 @@
         // 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 +1588,76 @@
 {
     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();
+    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);
 
-    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"));
+    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 +1696,17 @@
     // 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 +1718,7 @@
         do
         {
             fileName = QInputDialog::getText(this, tr("Demo name"), tr("Demo name:"));
-            
+
             if(!fileName.isEmpty())
             {
                 QString filePath = cfgdir->absolutePath() + "/Demos/" + fileName + "." + *cProtoVer + ".hwd";
@@ -1389,7 +1732,112 @@
                     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@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@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.come 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;
+}
+
+
+
--- a/QTfrontend/hwform.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/hwform.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 class HWForm : public QMainWindow
 {
-    Q_OBJECT
+        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();
+    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(bool isDemo, const QByteArray & record);
-    void CreateNetGame();
-    void UpdateWeapons();
-    void onFrontendFullscreen(bool value);
-    void Music(bool checked);
-    void UpdateCampaignPage(int index);
+    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 NetGameChangeStatus(bool isMaster);
+        void NetGameMaster();
+        void NetGameSlave();
+
+        void AsyncNetServerStart();
+        void NetLeftRoom(const QString & reason);
+        void selectFirstNetScheme();
 
-    void AsyncNetServerStart();
-    void NetLeftRoom(const QString & reason);
-    void selectFirstNetScheme();
-    
-    void saveDemoWithCustomName();
+        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);
 
-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
+        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
--- a/QTfrontend/main.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/main.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     Q_INIT_RESOURCE(hedgewars);
 
+    qRegisterMetaType<HWTeam>("HWTeam");
+
     bindir->cd("bin"); // workaround over NSIS installer
 
     if(cConfigDir->length() == 0)
@@ -132,20 +191,7 @@
     if (checkForDir(cfgdir->absolutePath()))
     {
         // alternative loading/lookup paths
-        // TODO: Uncomment paths as they're implemented
         checkForDir(cfgdir->absolutePath() + "/Data");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Forts");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Graphics");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Graphics/Flags");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Graphics/Graves");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Graphics/Hats");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Maps");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Missions");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Missions/Campaign");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Missions/Training");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Sounds");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Sounds/voices");
-        //checkForDir(cfgdir->absolutePath() + "/Data/Themes");
 
         // config/save paths
         checkForDir(cfgdir->absolutePath() + "/Demos");
@@ -153,78 +199,26 @@
         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"));
+    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;
     }
 
-    HWDataManager & dataMgr = HWDataManager::instance();
-
-    {
-        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@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);
-        }
-    }
-
-    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;
     {
@@ -257,24 +251,37 @@
 #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();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/GameStyleModel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,98 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/GameStyleModel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/HatModel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,148 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/HatModel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/MapModel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,238 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/MapModel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,120 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/ThemeModel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,97 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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@2x.png").arg(theme)));
+        dataset.insert(Qt::UserRole, preview);
+
+        m_data.append(dataset);
+    }
+
+
+    endResetModel();
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/ThemeModel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/model/ammoSchemeModel.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/model/ammoSchemeModel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 
     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 @@
 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::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 @@
 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 @@
 {
     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 @@
 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()];
--- a/QTfrontend/model/ammoSchemeModel.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/model/ammoSchemeModel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/model/hats.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@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;
-}
--- a/QTfrontend/model/hats.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/model/netserverslist.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/model/netserverslist.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 }
 
 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 @@
     {
         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);
 }
 
--- a/QTfrontend/model/netserverslist.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/model/netserverslist.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/playerslistmodel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -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();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/playerslistmodel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/roomslistmodel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,264 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/model/roomslistmodel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/model/themesmodel.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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;
-    }
-
-}
-
-
-
-
--- a/QTfrontend/model/themesmodel.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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
--- a/QTfrontend/net/hwmap.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/hwmap.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Ulyanov Igor <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
             }
             break;
         }
-        default: ;
+        default:
+            ;
     }
 
     SendIPC("!");
--- a/QTfrontend/net/hwmap.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/hwmap.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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
--- a/QTfrontend/net/netregister.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netregister.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
--- a/QTfrontend/net/netregister.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netregister.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/net/netserver.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netserver.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 quint16 HWNetServer::getRunningPort() const
 {
-  return ds_port;
+    return ds_port;
 }
--- a/QTfrontend/net/netserver.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netserver.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/net/netudpserver.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netudpserver.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
 }
--- a/QTfrontend/net/netudpserver.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netudpserver.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/net/netudpwidget.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netudpwidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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::onClientRead()
 {
-    while (pUdpSocket->hasPendingDatagrams()) {
+    while (pUdpSocket->hasPendingDatagrams())
+    {
         QByteArray datagram;
         datagram.resize(pUdpSocket->pendingDatagramSize());
         QHostAddress clientAddr;
@@ -50,7 +51,8 @@
         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 @@
                              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()];
 }
--- a/QTfrontend/net/netudpwidget.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/netudpwidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/net/newnetclient.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/newnetclient.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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)
+    isChief(false),
+    m_game_connected(false),
+    loginStep(0),
+    netClientState(Disconnected)
 {
-// socket stuff
+    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::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::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::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 @@
 {
     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 @@
             break;
         default:
             emit disconnected(NetSocket.errorString());
-        }
+    }
 }
 
 void HWNewNet::SendPasswordHash(const QString & hash)
@@ -203,7 +229,7 @@
 
 void HWNewNet::ParseCmd(const QStringList & lst)
 {
-  qDebug() << "Server: " << lst;
+    qDebug() << "Server: " << lst;
 
     if(!lst.size())
     {
@@ -214,13 +240,15 @@
     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 @@
         return;
     }
 
-    if (lst[0] == "WARNING") {
+    if (lst[0] == "WARNING")
+    {
         if (lst.size() == 2)
             emit Warning(lst[1]);
         else
@@ -236,11 +265,16 @@
         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 @@
         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 @@
         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 @@
         return;
     }
 
-    if (lst[0] == "CHAT") {
+    if (lst[0] == "CHAT")
+    {
         if(lst.size() < 3)
         {
             qWarning("Net: Empty CHAT message");
@@ -289,7 +332,8 @@
         return;
     }
 
-    if (lst[0] == "INFO") {
+    if (lst[0] == "INFO")
+    {
         if(lst.size() < 5)
         {
             qWarning("Net: Malformed INFO message");
@@ -304,7 +348,8 @@
         return;
     }
 
-    if (lst[0] == "SERVER_VARS") {
+    if (lst[0] == "SERVER_VARS")
+    {
         QStringList tmp = lst;
         tmp.removeFirst();
         while (tmp.size() >= 2)
@@ -329,6 +374,7 @@
 
         QString flags = lst[1];
         bool setFlag = flags[0] == '+';
+        const QStringList nicks = lst.mid(2);
 
         while(flags.size() > 1)
         {
@@ -337,80 +383,75 @@
 
             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] == "KICKED")
+    {
+        netClientState = InLobby;
+        askRoomsList();
+        emit LeftRoom(tr("You got kicked"));
+        m_playersModel->resetRoomFlags();
 
-    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") {
-        netClientState = InLobby;
-        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();
-            }
-
-            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 @@
 
             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 @@
             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]));
+
+        m_playersModel->removePlayer(lst[1]);
+
         return;
     }
 
-    if (lst[0] == "RUN_GAME") {
-        netClientState = InGame;
-        emit AskForRunGame();
-        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,72 +551,8 @@
         return;
     }
 
-    if (lst[0] == "TEAM_ACCEPTED") {
-        if (lst.size() != 2)
-        {
-            qWarning("Net: Bad TEAM_ACCEPTED message");
-            return;
-        }
-        emit TeamAccepted(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] == "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] == "TEAM_COLOR") {
-        if (lst.size() != 3)
-        {
-            qWarning("Net: Bad TEAM_COLOR message");
-            return;
-        }
-        HWTeam tmptm(lst[1]);
-        tmptm.setColor(QColor(lst[2]));
-        emit teamColorChanged(tmptm);
-        return;
-    }
-
-    if (lst[0] == "EM") {
-        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;
-    }
-
-    if (lst[0] == "BYE") {
+    if (lst[0] == "BYE")
+    {
         if (lst.size() < 2)
         {
             qWarning("Net: Bad BYE message");
@@ -582,58 +568,229 @@
         return;
     }
 
+    if (lst[0] == "ADMIN_ACCESS")
+    {
+        // obsolete, see +a client flag
+        return;
+    }
 
-    if (lst[0] == "ADMIN_ACCESS") {
-        emit adminAccess(true);
+    if(netClientState == InLobby && lst[0] == "JOINED")
+    {
+        if(lst.size() < 2 || lst[1] != mynick)
+        {
+            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();
+            }
+
+            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] == "ROOM_CONTROL_ACCESS") {
-        if (lst.size() < 2)
+    if(netClientState == InRoom || netClientState == InGame)
+    {
+        if (lst[0] == "EM")
+        {
+            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;
+        }
+
+        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")
         {
-            qWarning("Net: Bad ROOM_CONTROL_ACCESS message");
+            if(lst.size() != 2)
+            {
+                qWarning("Net: Bad REMOVETEAM message");
+                return;
+            }
+            emit RemoveNetTeam(HWTeam(lst[1]));
+            return;
+        }
+
+        if(lst[0] == "ROOMABANDONED")
+        {
+            netClientState = InLobby;
+            m_playersModel->resetRoomFlags();
+            emit LeftRoom(tr("Room destroyed"));
+            return;
+        }
+
+        if (lst[0] == "RUN_GAME")
+        {
+            netClientState = InGame;
+            emit AskForRunGame();
+            return;
+        }
+
+        if (lst[0] == "TEAM_ACCEPTED")
+        {
+            if (lst.size() != 2)
+            {
+                qWarning("Net: Bad TEAM_ACCEPTED message");
+                return;
+            }
+            emit TeamAccepted(lst[1]);
             return;
         }
-        isChief = (lst[1] != "0");
-        emit roomMaster(isChief);
-        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] == "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] == "TEAM_COLOR")
+        {
+            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;
+        }
     }
 
-    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::chatLineToLobby(const QString& str)
 {
-    if(str != "") {
+    if(str != "")
+    {
         RawSendNet(QString("CHAT") + delimeter + str);
         emit chatStringLobby(mynick, HWProto::formatChatMsgForFrontend(str));
     }
@@ -689,8 +847,11 @@
 
 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::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::partRoom()
 {
     netClientState = InLobby;
+    m_playersModel->resetRoomFlags();
     RawSendNet(QString("PART"));
 }
 
@@ -784,3 +947,18 @@
         }
     }
 }
+
+RoomsListModel * HWNewNet::roomsListModel()
+{
+    return m_roomsListModel;
+}
+
+QAbstractItemModel *HWNewNet::lobbyPlayersModel()
+{
+    return m_lobbyPlayersModel;
+}
+
+QAbstractItemModel *HWNewNet::roomPlayersModel()
+{
+    return m_roomPlayersModel;
+}
--- a/QTfrontend/net/newnetclient.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/newnetclient.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
+        Q_OBJECT
 
- public:
-  enum ClientState { Disconnected, Connecting, Connected, InLobby, InRoom, InGame };
+    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;
+        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();
 
-  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);
-  }
+    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 SendCfgStrLoc(T a) {
-    QByteArray strmsg;
-    strmsg.append(QString(a).toUtf8());
-    quint8 sz = strmsg.size();
-    QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg;
-    emit FromNet(enginemsg);
-  }
+        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);
+        }
 
-  QStringList cmdbuf;
+        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);
+        }
 
-  void RawSendNet(const QString & buf);
-  void RawSendNet(const QByteArray & buf);
-  void ParseCmd(const QStringList & lst);
-  void handleNotice(int n);
+        QStringList cmdbuf;
 
-  int loginStep;
-  ClientState netClientState;
+        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);
+    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 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 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 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);
+        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);
+    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 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();
+        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); 
+    private slots:
+        void ClientRead();
+        void OnConnect();
+        void OnDisconnect();
+        void displayError(QAbstractSocket::SocketError socketError);
 };
 
 #endif // _NEW_NETCLIENT_INCLUDED
--- a/QTfrontend/net/proto.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/proto.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/net/proto.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/proto.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/net/recorder.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,130 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 "libav_iteraction.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 + "." + LibavIteraction::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 << (config->isShowFPSEnabled() ? "1" : "0");
+    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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/net/recorder.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/net/tcpBase.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/tcpBase.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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;
+    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();
+    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);
+    // 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();
-  deleteLater();
+ /*   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);
+
+    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;
-  }
+    if(srvsList.isEmpty())
+    {
+        srvsList.push_back(this);
+    }
+    else
+    {
+        connect(srvsList.back(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
+        srvsList.push_back(this);
+        return;
+    }
 
-  RealStart();
+    RealStart();
 }
 
 void TCPBase::onClientRead()
@@ -150,7 +175,8 @@
     if (!IPCSocket)
     {
         toSendBuf += buf;
-    } else
+    }
+    else
     {
         if (toSendBuf.size() > 0)
         {
@@ -158,9 +184,10 @@
             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);
         }
     }
 }
--- a/QTfrontend/net/tcpBase.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/net/tcpBase.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
Binary file QTfrontend/res/BackgroundBirthday.png has changed
Binary file QTfrontend/res/BackgroundChristmas.png has changed
Binary file QTfrontend/res/BackgroundEaster.png has changed
Binary file QTfrontend/res/Confetti.png has changed
Binary file QTfrontend/res/Egg.png has changed
Binary file QTfrontend/res/Flake.png has changed
Binary file QTfrontend/res/Videos.png has changed
Binary file QTfrontend/res/chat/friend.png has changed
Binary file QTfrontend/res/chat/hedgehog.png has changed
Binary file QTfrontend/res/chat/hedgehog_gray.png has changed
Binary file QTfrontend/res/chat/ignore.png has changed
Binary file QTfrontend/res/chat/ingame.png has changed
Binary file QTfrontend/res/chat/lamp.png has changed
Binary file QTfrontend/res/chat/lamp_off.png has changed
Binary file QTfrontend/res/chat/roomadmin.png has changed
Binary file QTfrontend/res/chat/roomadmin_gray.png has changed
Binary file QTfrontend/res/chat/serveradmin.png has changed
Binary file QTfrontend/res/chat/serveradmin_gray.png has changed
Binary file QTfrontend/res/chat_default.png has changed
Binary file QTfrontend/res/chat_default_off.png has changed
Binary file QTfrontend/res/chat_default_on.png has changed
Binary file QTfrontend/res/chat_friend.png has changed
Binary file QTfrontend/res/chat_friend_off.png has changed
Binary file QTfrontend/res/chat_friend_on.png has changed
Binary file QTfrontend/res/chat_ignore.png has changed
Binary file QTfrontend/res/chat_ignore_off.png has changed
Binary file QTfrontend/res/chat_ignore_on.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/res/css/birthday.css	Sun Oct 28 13:28:23 2012 +0100
@@ -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: #141250;
+}
+
+* {
+color: #ffcc00;
+selection-background-color: #ffcc00;
+selection-color: #00351d;
+}
+
+a { color:#c8c8ff; }
+
+QLineEdit, QListWidget, 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, 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,
+QSpinBox:hover, QToolBox:hover, QComboBox:hover {
+border-color: yellow;
+}
+
+QLineEdit, QListWidget,QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
+border-radius: 10px;
+}
+
+QLineEdit, QLabel, QHeaderView, QListWidget, 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;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/res/css/christmas.css	Sun Oct 28 13:28:23 2012 +0100
@@ -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, 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, 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,
+QSpinBox:hover, QToolBox:hover, QComboBox:hover {
+border-color: yellow;
+}
+
+QLineEdit, QListWidget,QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
+border-radius: 10px;
+}
+
+QLineEdit, QLabel, QHeaderView, QListWidget, 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;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/res/css/easter.css	Sun Oct 28 13:28:23 2012 +0100
@@ -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, 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, 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,
+QSpinBox:hover, QToolBox:hover, QComboBox:hover {
+border-color: yellow;
+}
+
+QLineEdit, QListWidget,QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
+border-radius: 10px;
+}
+
+QLineEdit, QLabel, QHeaderView, QListWidget, 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;
+}
+
--- a/QTfrontend/res/css/qt.css	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/res/css/qt.css	Sun Oct 28 13:28:23 2012 +0100
@@ -32,8 +32,8 @@
 
 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 @@
 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-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 @@
 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;
--- a/QTfrontend/sdlkeys.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/sdlkeys.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     {"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 @@
 
 // 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)"),
--- a/QTfrontend/team.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/team.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
     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 @@
         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 @@
         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 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 @@
 
     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 @@
 
 
 // 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++;
+}
--- a/QTfrontend/team.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/team.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -44,7 +44,7 @@
 // class representing a team
 class HWTeam : public QObject
 {
-    Q_OBJECT
+        Q_OBJECT
 
     public:
 
@@ -62,23 +62,23 @@
         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 @@
         bool operator < (const HWTeam& t1) const;
         HWTeam & operator = (const HWTeam & other);
 
+public slots:
+        void setColor(int color);
 
     private:
 
@@ -111,13 +113,13 @@
         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;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/dialog/ask_quit.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 yot 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 yot 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);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/dialog/ask_quit.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/dialog/input_ip.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/dialog/input_ip.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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()
--- a/QTfrontend/ui/dialog/input_ip.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/dialog/input_ip.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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();
 };
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/dialog/input_password.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/dialog/input_password.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,38 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/dialog/upload_video.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,312 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 &lt; &gt;)
+    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();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/dialog/upload_video.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/mouseoverfilter.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/mouseoverfilter.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/QTfrontend/ui/page/AbstractPage.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/AbstractPage.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,54 @@
 
     // 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)
+    {
+        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;
+}
+QPushButton* AbstractPage::formattedSoundlessButton(const QString & name, bool hasIcon)
+{
+    QPushButton* btn = new QPushButton(this);
 
     if (hasIcon)
     {
@@ -79,16 +115,23 @@
     return btn;
 }
 
-QPushButton * AbstractPage::addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon)
+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 @@
 {
     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;
+}
--- a/QTfrontend/ui/page/AbstractPage.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/AbstractPage.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 @@
          *
          * 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 @@
          *
          * @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 @@
          *
          * @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 @@
          *
          * @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 @@
 
         QFont * font14; ///< used font
 
-    private:
+        QLabel * descLabel; ///< text description
+        QString * defautDesc;
 
-        QPushButton * btnBack; ///< back button
+        QPushButtonWithSound * btnBack; ///< back button
 };
 
 #endif
--- a/QTfrontend/ui/page/pageadmin.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageadmin.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     // 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 @@
     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 @@
 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()));
 }
--- a/QTfrontend/ui/page/pageadmin.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageadmin.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
+        Q_OBJECT
 
-public:
-    PageAdmin(QWidget* parent = 0);
+    public:
+        PageAdmin(QWidget* parent = 0);
 
-public slots:
-    void serverMessageNew(const QString & str);
-    void serverMessageOld(const QString & str);
-    void protocol(int proto);
+    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();
+    signals:
+        void setServerMessageNew(const QString & str);
+        void setServerMessageOld(const QString & str);
+        void setProtocol(int proto);
+        void askServerVars();
+        void clearAccountsCache();
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
 
-private:
-    QLineEdit * leServerMessageNew;
-    QLineEdit * leServerMessageOld;
-    QPushButton * pbSetSM;
-    QPushButton * pbAsk;
-    QSpinBox * sbProtocol;
-    QTextBrowser * tb;
-    QPushButton * pbClearAccountsCache;
+    private:
+        QLineEdit * leServerMessageNew;
+        QLineEdit * leServerMessageOld;
+        QPushButton * pbSetSM;
+        QPushButton * pbAsk;
+        QSpinBox * sbProtocol;
+        QTextBrowser * tb;
+        QPushButton * pbClearAccountsCache;
 
-private slots:
-    void smChanged();
+    private slots:
+        void smChanged();
 };
 
 #endif
--- a/QTfrontend/ui/page/pagecampaign.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagecampaign.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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!"));
--- a/QTfrontend/ui/page/pagecampaign.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagecampaign.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pageconnecting.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageconnecting.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pageconnecting.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageconnecting.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pagedata.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagedata.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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)
@@ -59,7 +61,9 @@
     initPage();
 
     web->setOpenLinks(false);
-    fetchList();
+//    fetchList();
+
+    m_contentDownloaded = false;
 }
 
 void PageDataDownload::request(const QUrl &url)
@@ -86,7 +90,8 @@
         QProgressBar *progressBar = new QProgressBar(this);
         progressBarsLayout->addWidget(progressBar);
         progressBars.insert(reply, progressBar);
-    } else
+    }
+    else
     {
         qWarning() << "Page Request" << url.toString();
 
@@ -166,8 +171,8 @@
     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 @@
         {
             QFileInfo fi(filePath);
             QDir().mkpath(fi.filePath());
-        } else
+        }
+        else
         {
             qDebug() << "Extracting" << filePath;
             QFile out(filePath);
@@ -204,20 +210,25 @@
 
             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 @@
 
     return true;
 }
+
+
+void PageDataDownload::onPageLeave()
+{
+    if (m_contentDownloaded)
+    {
+        m_contentDownloaded = false;
+        //DataManager::instance().reload();
+    }
+}
--- a/QTfrontend/ui/page/pagedata.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagedata.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
+
+        bool extractDataPack(QByteArray * buf);
 
-private slots:
-    void request(const QUrl &url);
+    private slots:
+        void request(const QUrl &url);
 
-    void pageDownloaded();
-    void fileDownloaded();
-    void downloadProgress(qint64, qint64);
+        void pageDownloaded();
+        void fileDownloaded();
+        void downloadProgress(qint64, qint64);
+
+        void onPageLeave();
 };
 
 #endif
--- a/QTfrontend/ui/page/pagedrawmap.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagedrawmap.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 {
     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::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);
--- a/QTfrontend/ui/page/pagedrawmap.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagedrawmap.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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;
+        QCheckBox * cbEraser;
 
-private:
-    QPushButton * pbUndo;
-    QPushButton * pbClear;
-    QPushButton * pbLoad;
-    QPushButton * pbSave;
-
-private slots:
-    void load();
-    void save();
+    private slots:
+        void load();
+        void save();
 };
 
 #endif
--- a/QTfrontend/ui/page/pageeditteam.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageeditteam.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
     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 @@
     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 @@
     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 @@
         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::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 @@
     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 @@
 
     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 @@
     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::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::deleteTeam(const QString & name)
 {
-    QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Teams"), QMessageBox::tr("Really delete this team?"), QMessageBox::Ok | QMessageBox::Cancel, this);
+    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 (reallyDelete.exec() == QMessageBox::Ok)
+    if (reallyDeleteMsg.exec() == QMessageBox::Ok)
         HWTeam(name).deleteFile();
 }
 
@@ -427,9 +431,15 @@
     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 @@
     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 @@
 void PageEditTeam::saveTeam()
 {
     data().saveToFile();
-    emit teamEdited();
 }
--- a/QTfrontend/ui/page/pageeditteam.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageeditteam.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 PageEditTeam : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageEditTeam(QWidget* parent);
+    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);
+        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);
+    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;
+    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();
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-    void loadTeam(const HWTeam & team);
+        void loadTeam(const HWTeam & team);
 
-    // page 1
-    QPushButton * btnRandomHogName[HEDGEHOGS_PER_TEAM];
-    QPushButton * btnRandomTeam;
-    QPushButton * btnTestSound;
+        // page 1
+        QPushButton * btnRandomHogName[HEDGEHOGS_PER_TEAM];
+        QPushButton * btnRandomTeam;
+        QPushButton * btnTestSound;
 
-    // footer
-    QPushButton * btnSave;
-
-private slots:
-    void saveTeam();
-    void setRandomNames();
+    private slots:
+        void saveTeam();
+        void setRandomNames();
 
-    void setRandomName(int hh_index);
-    
-    /// Plays a random voice sound of the currently edited team.
-    void testSound();
+        void setRandomName(int hh_index);
 
-    void fixHHname(int idx);
+        /// Plays a random voice sound of the currently edited team.
+        void testSound();
+
+        void fixHHname(int idx);
 };
 
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/page/pagefeedback.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,82 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/page/pagefeedback.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pagegamestats.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagegamestats.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
     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 @@
     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::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 @@
                 //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 @@
             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 @@
             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>";
--- a/QTfrontend/ui/page/pagegamestats.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagegamestats.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
+
+    signals:
+        void saveDemoRequested();
 
-private:
-    void AddStatText(const QString & msg);
+    private:
+        void AddStatText(const QString & msg);
 
-    QMap<quint32, QVector<quint32> > healthPoints;
-    unsigned int playerPosition;
-    quint32 lastColor;
+        QMap<quint32, QVector<quint32> > healthPoints;
+        unsigned int playerPosition;
+        quint32 lastColor;
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif // STATSPAGE_H
--- a/QTfrontend/ui/page/pageinfo.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageinfo.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 {
     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;
 }
--- a/QTfrontend/ui/page/pageinfo.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageinfo.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/ui/page/pageingame.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageingame.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pageingame.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageingame.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
--- a/QTfrontend/ui/page/pagemain.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagemain.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
     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 @@
 
     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()];
 }
--- a/QTfrontend/ui/page/pagemain.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagemain.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
+        Q_OBJECT
 
-public:
-    PageMain(QWidget * parent = 0);
+    public:
+        PageMain(QWidget * parent = 0);
 
-    QPushButton * BtnSinglePlayer;
-    QPushButton * BtnNet;
-    QPushButton * BtnSetup;
-    QPushButton * BtnInfo;
-    QPushButton * BtnDataDownload;
-    QLabel * mainNote;
+        QPushButton * BtnSinglePlayer;
+        QPushButton * BtnNet;
+        QPushButton * BtnSetup;
+        QPushButton * BtnFeedback;
+        QPushButton * BtnInfo;
+        QPushButton * BtnDataDownload;
+        QPushButton * BtnVideos;
+        QLabel * mainNote;
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-    QString randomTip() const;
+        QString randomTip() const;
 };
 
 #endif
--- a/QTfrontend/ui/page/pagemultiplayer.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagemultiplayer.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pagemultiplayer.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagemultiplayer.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/ui/page/pagenet.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenet.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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();
--- a/QTfrontend/ui/page/pagenet.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenet.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pagenetgame.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     // 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 @@
     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 @@
     BtnGo->setMinimumWidth(50);
     BtnGo->setMinimumHeight(50);
 
-
     bottomLayout->addWidget(leRoomName);
     BtnUpdate = addButton(QAction::tr("Update"), bottomLayout, 1);
 
@@ -152,10 +152,12 @@
     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();
     }
 }
 
--- a/QTfrontend/ui/page/pagenetgame.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenetgame.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/ui/page/pagenetserver.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenetserver.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pagenetserver.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenetserver.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pagenettype.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenettype.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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);
--- a/QTfrontend/ui/page/pagenettype.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagenettype.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/page/pageoptions.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageoptions.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
+    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"));
 
-    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);
+    { // 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");
+        QPixmap pmNew(":/res/new.png");
+        QPixmap pmEdit(":/res/edit.png");
+        QPixmap pmDelete(":/res/delete.png");
 
         {
             teamsBox = new IconedGroupBox(this);
@@ -102,12 +103,12 @@
             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 @@
             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 @@
             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 @@
                 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);
+
+            editNetNick = new QLineEdit(groupMisc);
+            editNetNick->setMaxLength(20);
+            editNetNick->setText(QLineEdit::tr("anonymous"));
+            MiscLayout->addWidget(editNetNick, 1, 1);
 
-            CBNameWithDate = new QCheckBox(groupMisc);
-            CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
-            MiscLayout->addWidget(CBNameWithDate, 4, 0, 1, 2);
+            // checkbox and field for password
+            CBSavePassword = new QCheckBox(groupMisc);
+            CBSavePassword->setText(QCheckBox::tr("Save password"));
+            MiscLayout->addWidget(CBSavePassword, 2, 0);
 
-            BtnAssociateFiles = new QPushButton(groupMisc);
-            BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions"));
-            BtnAssociateFiles->setEnabled(!custom_data && !custom_config);
-            MiscLayout->addWidget(BtnAssociateFiles, 5, 0, 1, 2);
+            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 @@
             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 @@
 
             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 @@
             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 @@
             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 @@
             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);
+
+            gbCLayout->addLayout(GBAfpslayout);
+
+
+            WeaponTooltip = new QCheckBox(this);
+            WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
+            gbCLayout->addWidget(WeaponTooltip);
+
 
-            hr = new QFrame(AGGroupBox);
-            hr->setFrameStyle(QFrame::HLine);
-            hr->setLineWidth(3);
-            hr->setFixedHeight(10);
-            GBAlayout->addWidget(hr);
+            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);
 
-            QLabel *restartNote = new QLabel(this);
-            restartNote->setText(QString("* ") + QLabel::tr("Restart game to apply"));
-            restartNote->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
-            GBAlayout->addWidget(restartNote);
+            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);
 
-            gbTBLayout->addWidget(AGGroupBox, 0, 1, 3, 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);
+
+
+            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::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 @@
 {
     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 @@
     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 @@
     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);
+}
--- a/QTfrontend/ui/page/pageoptions.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageoptions.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
+        Q_OBJECT
 
-    QCheckBox *WeaponTooltip;
-    QPushButton *WeaponNew;
-    QPushButton *WeaponEdit;
-    QPushButton *WeaponDelete;
-    QComboBox *WeaponsName;
-    QPushButton *SchemeNew;
-    QPushButton *SchemeEdit;
-    QPushButton *SchemeDelete;
-    QComboBox *SchemesName;
+    public:
+        enum ProxyTypes {
+            NoProxy      = 0,
+            SystemProxy  = 1,
+            Socks5Proxy  = 2,
+            HTTPProxy    = 3
+        };
 
-    QComboBox *CBLanguage;
+        PageOptions(QWidget* parent = 0);
 
-    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;
+        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;
+        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);
+        void setTeamOptionsEnabled(bool enabled);
 
-signals:
-    void newTeamRequested();
-    void editTeamRequested(const QString & teamName);
-    void deleteTeamRequested(const QString & teamName);
+    signals:
+        void newTeamRequested();
+        void editTeamRequested(const QString & teamName);
+        void deleteTeamRequested(const QString & teamName);
 
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-    bool previousFullscreenValue;
-    int previousResolutionIndex;
-    int previousQuality;
-    QLabel *LblNoEditTeam;
-    QPushButton *BtnNewTeam;
-    QPushButton *BtnEditTeam;
-    QPushButton *BtnDeleteTeam;
+        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();
+    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
--- a/QTfrontend/ui/page/pageplayrecord.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageplayrecord.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 {
     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 @@
         dir.cd("Demos");
         extension = "hwd";
         BtnPlayDemo->setText(QPushButton::tr("Play demo"));
-    } else
+    }
+    else
     {
         dir.cd("Saves");
         extension = "hws";
@@ -102,15 +107,25 @@
     }
 }
 
+
+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 @@
     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 @@
     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 @@
 
     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()
--- a/QTfrontend/ui/page/pageplayrecord.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageplayrecord.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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;
+
+    public slots:
+        void refresh();
 
-private:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
 
-    RecordType recType;
+        RecordType recType;
 
-private slots:
-    void renameRecord();
-    void removeRecord();
+    private slots:
+        void renameRecord();
+        void removeRecord();
 };
 
 
--- a/QTfrontend/ui/page/pageroomslist.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageroomslist.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
 
     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 @@
 
     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 @@
 
     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 @@
 
     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 @@
 
     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 @@
         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 @@
     BtnAdmin->setVisible(flag);
 }
 
+/*
 void PageRoomsList::setRoomsList(const QStringList & list)
 {
     QBrush red(QColor(255, 0, 0));
@@ -199,24 +213,17 @@
     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 @@
     {
         // 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 @@
         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 @@
 
         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 @@
         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 @@
             }
             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 @@
     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::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 @@
 {
     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()));
+}
--- a/QTfrontend/ui/page/pageroomslist.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageroomslist.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
+
+        void setModel(RoomsListModel * model);
+
+    public slots:
+        void setAdmin(bool);
+        void setUser(const QString & nickname);
+        void updateNickCounter(int cnt);
 
-public slots:
-    void setAdmin(bool);
-    void setRoomsList(const QStringList & list);
-    void setUser(const QString & nickname);
-    void updateNickCounter(int cnt);
+    signals:
+        void askForCreateRoom(const QString &);
+        void askForJoinRoom(const QString &);
+        void askForRoomList();
+        void askJoinConfirmation(const QString &);
 
-signals:
-    void askForCreateRoom(const QString &);
-    void askForJoinRoom(const QString &);
-    void askForRoomList();
-    void askJoinConfirmation(const QString &);
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    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();
 
-private slots:
-    void onCreateClick();
-    void onJoinClick();
-    void onRefreshClick();
-    void onClearClick();
-    void onJoinConfirmation(const QString &);
+    private:
+        QSettings * m_gameSettings;
+        QSortFilterProxyModel * roomsModel;
+        QSortFilterProxyModel * stateFilteredModel;
+        QSortFilterProxyModel * schemeFilteredModel;
+        QSortFilterProxyModel * weaponsFilteredModel;
 
-private:
-    QSettings * m_gameSettings;
+        AmmoSchemeModel * ammoSchemeModel;
 
-    bool gameInLobby;
-    QString gameInLobbyName;
-    QStringList listFromServer;
-    AmmoSchemeModel * ammoSchemeModel;
-
+        bool restoreHeaderState();
 };
 
 #endif
--- a/QTfrontend/ui/page/pagescheme.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagescheme.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     // 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 @@
     // Left
 
     TBW_mode_Forts = new ToggleButtonWidget(gbGameModes, ":/res/btnForts@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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 @@
     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 @@
     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::deleteRow()
 {
-    QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Schemes"), QMessageBox::tr("Really delete this game scheme?"), QMessageBox::Ok | QMessageBox::Cancel);
+    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 (reallyDelete.exec() == QMessageBox::Ok) {
-        QAbstractItemModel * model = mapper->model();
-        model->removeRow(selectScheme->currentIndex());
+        if (reallyDeleteMsg.exec() == QMessageBox::Ok)
+        {
+            QAbstractItemModel * model = mapper->model();
+            model->removeRow(selectScheme->currentIndex());
+        }
     }
 }
 
--- a/QTfrontend/ui/page/pagescheme.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagescheme.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/ui/page/pageselectweapon.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageselectweapon.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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&)));
--- a/QTfrontend/ui/page/pageselectweapon.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pageselectweapon.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 PageSelectWeapon : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageSelectWeapon(QWidget* parent = 0);
+    public:
+        PageSelectWeapon(QWidget* parent = 0);
 
-    QPushButton *btnSave;
-    QPushButton *BtnDefault;
-    QPushButton *BtnDelete;
-    QPushButton *BtnNew;
-    QPushButton *BtnCopy;
-    SelWeaponWidget* pWeapons;
-    QComboBox* selectWeaponSet;
+        QPushButton *BtnDefault;
+        QPushButton *BtnDelete;
+        QPushButton *BtnNew;
+        QPushButton *BtnCopy;
+        SelWeaponWidget* pWeapons;
+        QComboBox* selectWeaponSet;
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif
--- a/QTfrontend/ui/page/pagesingleplayer.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagesingleplayer.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     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 @@
     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);
--- a/QTfrontend/ui/page/pagesingleplayer.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagesingleplayer.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 PageSinglePlayer : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageSinglePlayer(QWidget* parent = 0);
+    public:
+        PageSinglePlayer(QWidget* parent = 0);
 
-    QPushButton *BtnSimpleGamePage;
-    QPushButton *BtnTrainPage;
-    QPushButton *BtnCampaignPage;
-    QPushButton *BtnMultiplayer;
-    QPushButton *BtnLoad;
-    QPushButton *BtnDemos;
-    GameCFGWidget *gameCFG;
+        QPushButton *BtnSimpleGamePage;
+        QPushButton *BtnTrainPage;
+        QPushButton *BtnCampaignPage;
+        QPushButton *BtnMultiplayer;
+        QPushButton *BtnLoad;
+        QPushButton *BtnDemos;
+        GameCFGWidget *gameCFG;
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif
--- a/QTfrontend/ui/page/pagetraining.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagetraining.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     // 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 @@
 
     // 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 @@
     QBoxLayout * bottomLayout = new QVBoxLayout();
 
     btnStart = formattedButton(QPushButton::tr("Go!"));
+    btnStart->setWhatsThis(tr("Start fighting"));
     btnStart->setFixedWidth(140);
 
     bottomLayout->addWidget(btnStart);
@@ -114,7 +115,7 @@
 {
     initPage();
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     // get locale
     QSettings settings(cfgdir->absolutePath() + "/hedgewars.ini",
@@ -125,12 +126,12 @@
         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 @@
     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::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 @@
             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);
--- a/QTfrontend/ui/page/pagetraining.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/page/pagetraining.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
 
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/page/pagevideos.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,1160 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 "libav_iteraction.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);
+        LibavIteraction::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"));
+        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);
+
+        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);
+        pBottomDescLayout->addWidget(btnPlay);
+        btnDelete = new QPushButton(QPushButton::tr("Delete"), pDescGroup);
+        btnDelete->setEnabled(false);
+        pBottomDescLayout->addWidget(btnDelete);
+        btnToYouTube = new QPushButton(QPushButton::tr("Upload to YouTube"), pDescGroup);
+        btnToYouTube->setEnabled(false);
+        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
+    LibavIteraction::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()
+{
+    if (tryCodecs("mp4", "libx264", "libmp3lame"))
+        return;
+    if (tryCodecs("mp4", "libx264", "libfaac"))
+        return;
+    if (tryCodecs("mp4", "libx264", "libvo_aacenc"))
+        return;
+    if (tryCodecs("mp4", "libx264", "aac"))
+        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(25);
+    bitrateBox->setValue(400);
+    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 = LibavIteraction::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);
+
+// 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();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/page/pagevideos.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,126 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/qaspectratiolayout.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/qaspectratiolayout.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -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 @@
  * 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;
 }
--- a/QTfrontend/ui/qaspectratiolayout.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/qaspectratiolayout.h	Sun Oct 28 13:28:23 2012 +0100
@@ -16,7 +16,7 @@
 {
         Q_OBJECT
 
-public:
+    public:
         QAspectRatioLayout(QWidget* parent, int spacing =-1);
         QAspectRatioLayout(int spacing = -1);
         ~QAspectRatioLayout();
@@ -24,7 +24,7 @@
         /* 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 @@
         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 @@
         /* 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. */
--- a/QTfrontend/ui/widget/FreqSpinBox.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/FreqSpinBox.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/FreqSpinBox.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/FreqSpinBox.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
+        Q_OBJECT
 
-public:
-    /**
-     * @brief Class constructor.
-     * @param parent parent widget.
-     */
-    FreqSpinBox(QWidget * parent);
+    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;
+    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;
 };
 
 
--- a/QTfrontend/ui/widget/HistoryLineEdit.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/HistoryLineEdit.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 {
     // 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--;
--- a/QTfrontend/ui/widget/HistoryLineEdit.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/HistoryLineEdit.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 /**
  * @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
+        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);
+    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 Class destructor.
+        */
+        ~HistoryLineEdit();
 
-    /**
-     * @brief Appends current text to history (if not only whitespaces);
-     */
-    void rememberCurrentText();
+        /**
+         * @brief Appends current text to history (if not only whitespaces);
+         */
+        void rememberCurrentText();
 
-    /**
-     * @brief Forget all history.
-     */
-    void reset();
+        /**
+         * @brief Forget all history.
+         */
+        void reset();
 
 
-public slots:
-    /**
-     * @brief Clears the contents.
-     */
-    void clear();
+    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);
+    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
+    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
+        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);
+        /**
+         * @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);
 };
 
 
--- a/QTfrontend/ui/widget/SmartLineEdit.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/SmartLineEdit.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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");
 
--- a/QTfrontend/ui/widget/SmartLineEdit.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/SmartLineEdit.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
+        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);
+    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 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 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 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 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 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();
+        /**
+         * @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);
+    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);
+        /**
+         * @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
+    private:
+        QRegExp m_whitespace; ///< regexp that matches a whitespace
 
-    QStringList * m_cmds;  ///< list of recognized commands
-    QStringList * m_nicks; ///< list of recognized nicknames
+        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;
+        /// 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
+        // 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
+        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();
+        /**
+         * @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();
+    private slots:
+        /**
+         * @brief Resets the information about the last match and text replacement.
+         */
+        void resetAutoCompletionStatus();
 };
 
 
--- a/QTfrontend/ui/widget/SquareLabel.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/SquareLabel.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     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);
     }
--- a/QTfrontend/ui/widget/SquareLabel.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/SquareLabel.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
 
 };
 
--- a/QTfrontend/ui/widget/about.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/about.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
 
     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 &lt;<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>&gt;<br>"
-            "Many frontend improvements: Igor Ulyanov &lt;<a href=\"mailto:disinbox@gmail.com\">disinbox@gmail.com</a>&gt;<br>"
-            "Many engine and frontend improvements: Derek Pomery &lt;<a href=\"mailto:nemo@m8y.org\">nemo@m8y.org</a>&gt;<br>"
-            "Drill rocket, Ballgun, RC Plane weapons: Martin Boze &lt;<a href=\"mailto:afffect@gmail.com\">afffect@gmail.com</a>&gt;<br>"
-            "Mine number and time game settings: David A. Cuadrado &lt;<a href=\"mailto:krawek@gmail.com\">krawek@gmail.com</a>&gt;<br>"
-            "Frontend improvements: Martin Minarik &lt;<a href=\"mailto:ttsmj@pokec.sk\">ttsmj@pokec.sk</a>&gt;<br>"
-            "Frontend improvements: Kristian Lehmann &lt;<a href=\"mailto:email@thexception.net\">email@thexception.net</a>&gt;<br>"
-            "Mac OS X/iPhone port, OpenGL-ES conversion: Vittorio Giovara &lt;<a href=\"mailto:vittorio.giovara@gmail.com\">vittorio.giovara@gmail.com</a>&gt;<br>"
-            "Many engine and frontend improvements (and bugs): Richard Karolyi &lt;<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>&gt;<br>"
-            "Gamepad and Lua integration: Mario Liebisch &lt;<a href=\"mailto:mario.liebisch@gmail.com\">mario.liebisch@gmail.com</a>&gt;<br>"
-            "Many engine improvements and graphics: Carlos Vives &lt;<a href=\"mailto:mail@carlosvives.es\">mail@carlosvives.es</a>&gt;<br>"
-            "Maze maps: Henning K&uuml;hn &lt;<a href=\"mailto:prg@cooco.de\">prg@cooco.de</a>&gt;<br>"
-            "Engine and frontend improvements: Henrik Rostedt &lt;<a href=\"mailto:henrik.rostedt@gmail.com\">henrik.rostedt@gmail.com</a>&gt;<br>"
-            "Lua game modes and missions: John Lambert &lt;<a href=\"mailto:redgrinner@gmail.com\">redgrinner@gmail.com</a>&gt;<br>"
-            "Frontend improvements: Mayur Pawashe &lt;<a href=\"mailto:zorgiepoo@gmail.com\">zorgiepoo@gmail.com</a>&gt;<br>"
-            "Android port: Richard Deurwaarder &lt;<a href=\"mailto:xeli@xelification.com\">xeli@xelification.com</a>&gt;<br>"
-            "</p><h2>" +
+        "</style>" +
+        QString("<h2>") +
+        QLabel::tr("Developers:") +
+        "</h2><p>"
+        "Engine, frontend, net server: Andrey Korotaev &lt;<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>&gt;<br>"
+        "Many frontend improvements: Igor Ulyanov &lt;<a href=\"mailto:disinbox@gmail.com\">disinbox@gmail.com</a>&gt;<br>"
+        "Many engine and frontend improvements: Derek Pomery &lt;<a href=\"mailto:nemo@m8y.org\">nemo@m8y.org</a>&gt;<br>"
+        "Drill rocket, Ballgun, RC Plane weapons: Martin Boze &lt;<a href=\"mailto:afffect@gmail.com\">afffect@gmail.com</a>&gt;<br>"
+        "Mine number and time game settings: David A. Cuadrado &lt;<a href=\"mailto:krawek@gmail.com\">krawek@gmail.com</a>&gt;<br>"
+        "Frontend improvements: Martin Minarik &lt;<a href=\"mailto:ttsmj@pokec.sk\">ttsmj@pokec.sk</a>&gt;<br>"
+        "Frontend improvements: Kristian Lehmann &lt;<a href=\"mailto:email@thexception.net\">email@thexception.net</a>&gt;<br>"
+        "Mac OS X/iPhone port, OpenGL-ES conversion: Vittorio Giovara &lt;<a href=\"mailto:vittorio.giovara@gmail.com\">vittorio.giovara@gmail.com</a>&gt;<br>"
+        "Many engine and frontend improvements (and bugs): Richard Karolyi &lt;<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>&gt;<br>"
+        "Gamepad and Lua integration: Mario Liebisch &lt;<a href=\"mailto:mario.liebisch@gmail.com\">mario.liebisch@gmail.com</a>&gt;<br>"
+        "Many engine improvements and graphics: Carlos Vives &lt;<a href=\"mailto:mail@carlosvives.es\">mail@carlosvives.es</a>&gt;<br>"
+        "Maze maps: Henning K&uuml;hn &lt;<a href=\"mailto:prg@cooco.de\">prg@cooco.de</a>&gt;<br>"
+        "Engine and frontend improvements: Henrik Rostedt &lt;<a href=\"mailto:henrik.rostedt@gmail.com\">henrik.rostedt@gmail.com</a>&gt;<br>"
+        "Lua game modes and missions: John Lambert &lt;<a href=\"mailto:redgrinner@gmail.com\">redgrinner@gmail.com</a>&gt;<br>"
+        "Frontend improvements: Mayur Pawashe &lt;<a href=\"mailto:zorgiepoo@gmail.com\">zorgiepoo@gmail.com</a>&gt;<br>"
+        "Android port: Richard Deurwaarder &lt;<a href=\"mailto:xeli@xelification.com\">xeli@xelification.com</a>&gt;<br>"
+        "Android netplay, portability abstraction: Simeon Maxein &lt;<a href=\"mailto:smaxein@googlemail.com\">smaxein@googlemail.com</a>&gt;<br>"
+        "WebGL port, some pas2c and GLES2 work: Meng Xiangyun &lt;<a href=\"mailto:xymengxy@gmail.com\">xymengxy@gmail.com</a>&gt;<br>"
+        "Video recording: Stepan Podoskin &lt;<a href=\"mailto:stepik-777@mail.ru\">stepik-777@mail.ru</a>&gt;<br>"
+        "Campaign support, first campaign: Szabolcs Orbàn &lt;<a href=\"mailto:szabibibi@gmail.com\">szabibibi@gmail.com</a>&gt;<br>"
+        "</p><h2>" +
 
-            QLabel::tr("Art:") + "</h2>"
-            + QString::fromUtf8(
+        QLabel::tr("Art:") + "</h2>"
+        + QString::fromUtf8(
             "<p>John Dum &lt;<a href=\"mailto:fizzy@gmail.com\">fizzy@gmail.com</a>&gt;"
             "<br>"
             "Joshua Frese &lt;<a href=\"mailto:joshfrese@gmail.com\">joshfrese@gmail.com</a>&gt;"
@@ -105,30 +109,30 @@
             "<br>"
             "Hats: Trey Perry &lt;<a href=\"mailto:tx.perry.j@gmail.com\">tx.perry.j@gmail.com</a>&gt;"
             "</p><h2>") +
-            QLabel::tr("Sounds:") + "</h2>"
-            "Hedgehogs voice: Stephen Alexander &lt;<a href=\"mailto:ArmagonNo1@gmail.com\">ArmagonNo1@gmail.com</a>&gt;"
-            "<br>"
-            "John Dum &lt;<a href=\"mailto:fizzy@gmail.com\">fizzy@gmail.com</a>&gt;"
-            "<br>"
-            "Jonatan Nilsson &lt;<a href=\"mailto:jonatanfan@gmail.com\">jonatanfan@gmail.com</a>&gt;"
-            "<br>"
-            "Daniel Martin &lt;<a href=\"mailto:elhombresinremedio@gmail.com\">elhombresinremedio@gmail.com</a>&gt;"
-            "</p><h2>" +
+        QLabel::tr("Sounds:") + "</h2>"
+        "Hedgehogs voice: Stephen Alexander &lt;<a href=\"mailto:ArmagonNo1@gmail.com\">ArmagonNo1@gmail.com</a>&gt;"
+        "<br>"
+        "John Dum &lt;<a href=\"mailto:fizzy@gmail.com\">fizzy@gmail.com</a>&gt;"
+        "<br>"
+        "Jonatan Nilsson &lt;<a href=\"mailto:jonatanfan@gmail.com\">jonatanfan@gmail.com</a>&gt;"
+        "<br>"
+        "Daniel Martin &lt;<a href=\"mailto:elhombresinremedio@gmail.com\">elhombresinremedio@gmail.com</a>&gt;"
+        "</p><h2>" +
 
-            QLabel::tr("Translations:") + "</h2><p>"
-            + QString::fromUtf8(
+        QLabel::tr("Translations:") + "</h2><p>"
+        + QString::fromUtf8(
             "Brazilian Portuguese: Romulo Fernandes Machado &lt;<a href=\"mailto:abra185@gmail.com\">abra185@gmail.com</a>&gt;<br>"
             "Bulgarian: Svetoslav Stefanov<br>"
             "Czech: Petr Řezáček &lt;<a href=\"mailto:rezacek@gmail.com\">rezacek@gmail.com</a>&gt;<br>"
             "Chinese: Jie Luo &lt;<a href=\"mailto:lililjlj@gmail.com\">lililjlj@gmail.com</a>&gt;<br>"
             "English: Andrey Korotaev &lt;<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>&gt;<br>"
             "Finnish: Nina Kuisma &lt;<a href=\"mailto:ninnnu@gmail.com\">ninnnu@gmail.com</a>&gt;<br>"
-            "French: Antoine Turmel &lt;<a href=\"mailto:geekshadow@gmail.com\">geekshadow@gmail.com</a>&gt;<br>"
+            "French: Antoine Turmel &lt;<a href=\"mailto:geekshadow@gmail.com\">geekshadow@gmail.com</a>&gt;, Clement Woitrain &lt;<a href=\"mailto:sphrixclement@gmail.com\">sphrixclement@gmail.com</a>&gt;<br>"
             "German: Peter Hüwe &lt;<a href=\"mailto:PeterHuewe@gmx.de\">PeterHuewe@gmx.de</a>&gt;, Mario Liebisch &lt;<a href=\"mailto:mario.liebisch@gmail.com\">mario.liebisch@gmail.com</a>&gt;, Richard Karolyi &lt;<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>&gt;<br>"
             "Greek: &lt;<a href=\"mailto:talos_kriti@yahoo.gr\">talos_kriti@yahoo.gr</a>&gt;<br>"
             "Italian: Luca Bonora &lt;<a href=\"mailto:bonora.luca@gmail.com\">bonora.luca@gmail.com</a>&gt;, Marco Bresciani<br>"
             "Japanese: ADAM Etienne &lt;<a href=\"mailto:etienne.adam@gmail.com\">etienne.adam@gmail.com</a>&gt;<br>"
-            "Korean: Anthony Bellew &lt;<a href=\"mailto:webmaster@anthonybellew.com\">webmaster@anthonybellew.com</a>&gt;<br>"
+            "Korean: Anthony Bellew &lt;<a href=\"mailto:anthonyreflected@gmail.com\">anthonyreflected@gmail.com</a>&gt;<br>"
             "Lithuanian: Lukas Urbonas &lt;<a href=\"mailto:lukasu08@gmail.com\">lukasu08@gmail.com</a>&gt;<br>"
             "Polish: Maciej Mroziński &lt;<a href=\"mailto:mynick2@o2.pl\">mynick2@o2.pl</a>&gt;, Wojciech Latkowski &lt;<a href=\"mailto:magik17l@gmail.com\">magik17l@gmail.com</a>&gt;, Piotr Mitana, Maciej Górny<br>"
             "Portuguese: Fábio Canário &lt;<a href=\"mailto:inufabie@gmail.com\">inufabie@gmail.com</a>&gt;<br>"
@@ -139,13 +143,13 @@
             "Ukrainian: Eugene V. Lyubimkin &lt;<a href=\"mailto:jackyf.devel@gmail.com\">jackyf.devel@gmail.com</a>&gt;, Igor Paliychuk &lt;<a href=\"mailto:mansonigor@gmail.com\">mansonigor@gmail.com</a>&gt;, Eugene Sakara &lt;<a href=\"mailto:eresid@gmail.com\">eresid@gmail.com</a>&gt;"
             "</p><h2>") +
 
-            QLabel::tr("Special thanks:") + "</h2><p>"
-            "Aleksey Andreev &lt;<a href=\"mailto:blaknayabr@gmail.com\">blaknayabr@gmail.com</a>&gt;<br>"
-            "Aleksander Rudalev &lt;<a href=\"mailto:alexv@pomorsu.ru\">alexv@pomorsu.ru</a>&gt;<br>"
-            "Natasha Korotaeva &lt;<a href=\"mailto:layout@pisem.net\">layout@pisem.net</a>&gt;<br>"
-            "Adam Higerd (aka ahigerd at FreeNode)"
-            "</p>"
-            );
+        QLabel::tr("Special thanks:") + "</h2><p>"
+        "Aleksey Andreev &lt;<a href=\"mailto:blaknayabr@gmail.com\">blaknayabr@gmail.com</a>&gt;<br>"
+        "Aleksander Rudalev &lt;<a href=\"mailto:alexv@pomorsu.ru\">alexv@pomorsu.ru</a>&gt;<br>"
+        "Natasha Korotaeva &lt;<a href=\"mailto:layout@pisem.net\">layout@pisem.net</a>&gt;<br>"
+        "Adam Higerd (aka ahigerd at FreeNode)"
+        "</p>"
+    );
     mainLayout->addWidget(lbl2, 1, 1);
 
     setAcceptDrops(true);
--- a/QTfrontend/ui/widget/about.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/about.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/bgwidget.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/bgwidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email@thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
 
         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 @@
 void BGWidget::paintEvent(QPaintEvent *event)
 {
     Q_UNUSED(event);
+    if (!enabled)
+        return;
 
     QPainter p;
 
@@ -139,6 +163,9 @@
 
 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::stopAnimation()
 {
     timerAnimation->stop();
+    repaint();
 }
 
 void BGWidget::init()
--- a/QTfrontend/ui/widget/bgwidget.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/bgwidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email@thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/chatwidget.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 <QMessageBox>
+#include <QListView>
+#include <QModelIndexList>
+#include <QSortFilterProxyModel>
+#include <QMenu>
 
-
-#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 @@
     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 @@
     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 @@
 
 
 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";
 
-        m_hilightSound = HWDataManager::instance().findFileForRead(
-                        "Sounds/beep.ogg");
+        foreach (QString vp, vpList)
+        {
+            m_helloSounds.append(DataManager::instance().findFileForRead(
+                               QString("Sounds/voices/%1/Hello.ogg").arg(vp)));
+        }
 
-        //m_hilightSound = m_helloSound;//"Sounds/beep.ogg";
+        m_hilightSound = DataManager::instance().findFileForRead(
+                             "Sounds/beep.ogg");
+
     }
 
     mainLayout.setSpacing(1);
@@ -278,19 +224,22 @@
     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 @@
     chatNicks->insertAction(0, acInfo);
     chatNicks->insertAction(0, acIgnore);
 
-    showReady = false;
     setShowFollow(true);
 
     setAcceptDrops(true);
+
+    m_nicksMenu = new QMenu(this);
+
     clear();
 }
 
@@ -341,149 +292,41 @@
     {
         // 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 {
+    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)
+void HWChatWidget::setIgnoreListKick(bool enabled)
 {
-    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)));
-    }
-}
-
-void HWChatWidget::updateNickItems()
-{
-    for(int i = 0; i < chatNicks->count(); i++)
-        updateNickItem(chatNicks->item(i));
-
-    chatNicks->sortItems();
-}
-
-void HWChatWidget::loadLists(const QString & nick)
-{
-    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 @@
 {
     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 @@
 
 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 @@
     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 @@
     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 @@
 {
     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 @@
 
     chatText->clear();
     chatStrings.clear();
-    chatNicks->clear();
+    //chatNicks->clear();
 
     // clear and re compile regexp for highlighting
     m_highlights.clear();
@@ -683,7 +546,7 @@
             foreach (QString word, list)
             {
                 m_highlights.append(QRegExp(
-                                hlRegExp.arg(QRegExp::escape(word.toLower()))));
+                                        hlRegExp.arg(QRegExp::escape(word.toLower()))));
             }
         }
 
@@ -708,184 +571,135 @@
 
 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::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 @@
     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));
+}
--- a/QTfrontend/ui/widget/chatwidget.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/chatwidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 class HWChatWidget : public QWidget
 {
-  Q_OBJECT
+        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);
+    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);
+    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;
+    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 = "");
+        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);
+        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);
 
- 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);
+    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:
+        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(QListWidgetItem * item);
-  void chatNickSelected(int index);
-  void linkClicked(const QUrl & link);
+    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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/widget/colorwidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -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());
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/widget/colorwidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/QTfrontend/ui/widget/databrowser.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/databrowser.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,3 +1,26 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
         {
             return resources.take(name.toString());
         }
-        else
-            if(!requestedResources.contains(name.toString()))
-            {
-                qDebug() << "Requesting resource" << name.toString();
-                requestedResources.insert(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);
+            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()));
-            }
+            QNetworkReply *reply = manager->get(newRequest);
+            connect(reply, SIGNAL(finished()), this, SLOT(resourceDownloaded()));
+        }
     }
 
     return QVariant();
--- a/QTfrontend/ui/widget/databrowser.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/databrowser.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,5 +1,28 @@
-#ifndef DATABROWSER_H
-#define DATABROWSER_H
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/ui/widget/drawmapwidget.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/drawmapwidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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)
 {
+    m_scene = scene;
+
     ui->graphicsView->setScene(scene);
-    m_scene = scene;
+    connect(scene, SIGNAL(pathChanged()), this, SLOT(pathChanged()));
 }
 
 void DrawMapWidget::resizeEvent(QResizeEvent * event)
@@ -79,6 +83,11 @@
     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 @@
         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 @@
         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);
+}
--- a/QTfrontend/ui/widget/drawmapwidget.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/drawmapwidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
-
-        void setupUi(QWidget *drawMapWidget)
-        {
-            QAspectRatioLayout * arLayout = new QAspectRatioLayout(drawMapWidget);
-            arLayout->setMargin(0);
+        public:
+            DrawMapView *graphicsView;
+            QLabel * lblPoints;
 
-            graphicsView = new QGraphicsView(drawMapWidget);
-            arLayout->addWidget(graphicsView);
-
-            retranslateUi(drawMapWidget);
+            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);
 
-            QMetaObject::connectSlotsByName(drawMapWidget);
-        } // setupUi
+                graphicsView = new DrawMapView(drawMapWidget);
+                arLayout->addWidget(graphicsView);
+
+                retranslateUi(drawMapWidget);
 
-        void retranslateUi(QWidget *drawMapWidget)
-        {
-            Q_UNUSED(drawMapWidget);
-        } // retranslateUi
+                QMetaObject::connectSlotsByName(drawMapWidget);
+            } // setupUi
+
+            void retranslateUi(QWidget *drawMapWidget)
+            {
+                Q_UNUSED(drawMapWidget);
+            } // retranslateUi
 
     };
 
@@ -58,29 +86,33 @@
 
 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
--- a/QTfrontend/ui/widget/fpsedit.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/fpsedit.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/fpsedit.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/fpsedit.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/frameTeam.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/frameTeam.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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::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);
+}
--- a/QTfrontend/ui/widget/frameTeam.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/frameTeam.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
     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 @@
     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 @@
 {
     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 @@
     }
     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 @@
             }
             break;
         }
-        default: ;
+        default:
+            ;
     }
 
     QByteArray result;
 
     foreach(QByteArray ba, bcfg)
-        HWProto::addByteArrayToBuffer(result, ba);
+    HWProto::addByteArrayToBuffer(result, ba);
 
     return result;
 }
@@ -298,13 +270,23 @@
 {
     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 @@
     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 @@
 
     if (slValue.size() == 2)
     {
-        if (param == "AMMO") {
+        if (param == "AMMO")
+        {
             setNetAmmo(slValue[0], slValue[1]);
             return;
         }
@@ -389,12 +381,12 @@
                 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::ammoChanged(int index)
 {
-    if (index >= 0) {
+    if (index >= 0)
+    {
         emit paramChanged(
             "AMMO",
             QStringList() << WeaponsName->itemText(index) << WeaponsName->itemData(index).toString()
@@ -487,28 +480,34 @@
     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 @@
         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 @@
 {
     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);
+    }
+}
--- a/QTfrontend/ui/widget/gamecfgwidget.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/gamecfgwidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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);
+        void updateModelViews();
 
-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:
+        QGridLayout mainLayout;
+        QCheckBox * bindEntries;
+        QString curNetAmmoName;
+        QString curNetAmmo;
+        QRegExp seedRegexp;
+        QString m_curScript;
 
-private:
-    QGridLayout mainLayout;
-    QCheckBox * bindEntries;
-    QString curNetAmmoName;
-    QString curNetAmmo;
-    QRegExp seedRegexp;
-
-    void setNetAmmo(const QString& name, const QString& ammo);
+        void setNetAmmo(const QString& name, const QString& ammo);
 
 };
 
--- a/QTfrontend/ui/widget/hedgehogerWidget.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Ulyanov Igor <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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));
+
+}
--- a/QTfrontend/ui/widget/hedgehogerWidget.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/hedgehogerWidget.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Ulyanov Igor <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
--- a/QTfrontend/ui/widget/igbox.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/igbox.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 // 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();
--- a/QTfrontend/ui/widget/igbox.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/igbox.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/itemNum.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/itemNum.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Igor Ulyanov <iulyanov@gmail.com>
+ * Copyright (c) 2006-2012 Igor Ulyanov <iulyanov@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 @@
 
 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 @@
         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();
 }
--- a/QTfrontend/ui/widget/itemNum.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/itemNum.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Igor Ulyanov <iulyanov@gmail.com>
+ * Copyright (c) 2006-2012 Igor Ulyanov <iulyanov@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
+        Q_OBJECT
 
-  public:
-    void setInfinityState(bool value);
-    void setEnabled(bool value);
-    unsigned char getItemsNum() const;
-    void setItemsNum(const unsigned char num);
+    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:
+        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;
+        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;
 
-    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);
 
-    // 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;
+        // to be implemented in child
+        virtual void incItems()=0;
+        virtual void decItems()=0;
 };
 
 #endif // _ITEM_NUM_INCLUDED
--- a/QTfrontend/ui/widget/mapContainer.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Igor Ulyanov <iulyanov@gmail.com>
+ * Copyright (c) 2006-2012 Igor Ulyanov <iulyanov@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 @@
 
     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));
-        }
+    m_mapModel = DataManager::instance().mapModel();
+    chooseMap->setEditable(false);
+    chooseMap->setModel(m_mapModel);
 
-        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
-
-    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 @@
 
     //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 @@
 
     // 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 @@
 
     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::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;
+    if (chooseMap->currentIndex() != index)
+        chooseMap->setCurrentIndex(index);
+
+    if (index < 0)
+    {
+        m_mapInfo.type = MapModel::Invalid;
         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;
-        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 @@
     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::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::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 @@
 
 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 @@
 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::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::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::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::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::updatePreview()
 {
-    int curIndex = chooseMap->currentIndex();
+    if (pMap)
+    {
+        disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
+        disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
+        pMap = 0;
+    }
 
-    switch(curIndex)
+    QPixmap failIcon;
+
+    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")
+            );
 
-        hhLimit = chooseMap->itemData(curIndex).toList()[2].toInt();
-        addInfoToPreview(mapImage);
+            if(!success)
+            {
+                imageButt->setIcon(QIcon());
+                return;
+            }
+
+            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;
+}
--- a/QTfrontend/ui/widget/mapContainer.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/mapContainer.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 HWMapContainer : public QWidget
 {
-  Q_OBJECT
+        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:
+        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);
+    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);
+    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();
+    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 );
+    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;
+    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();
+        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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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"));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,38 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/selectWeapon.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/selectWeapon.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 }
 
 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 @@
 
     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 @@
 {
     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::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::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 @@
         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 @@
     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::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 @@
 
     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 @@
 
 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);
--- a/QTfrontend/ui/widget/selectWeapon.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/selectWeapon.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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
+        Q_OBJECT
 
- public:
-  SelWeaponWidget(int numItems, QWidget* parent=0);
-  QString getWeaponsString(const QString& name) const;
-  QStringList getWeaponNames() const;
+    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();
+    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();
+    signals:
+        void weaponsChanged();
+        void weaponsDeleted();
 
- private:
-  //the name of the current weapon set
-  QString curWeaponsName;
+    private:
+        //the name of the current weapon set
+        QString curWeaponsName;
 
-  QLineEdit* m_name;
+        QLineEdit* m_name;
 
-  //storage for all the weapons sets
-  QSettings* wconf;
+        //storage for all the weapons sets
+        QSettings* wconf;
 
-  const int m_numItems;
-  int operator [] (unsigned int weaponIndex) const;
+        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;
+        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
--- a/QTfrontend/ui/widget/teamselect.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/teamselect.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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::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::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);
+    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();
+    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);
-  }
+    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;
-  }
+    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());
-  }
+    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());
-  }
+    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);
+    emit setEnabledGameStart(curPlayingTeams.size()>1);
 }
 
 void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int fixedHeight)
@@ -213,18 +237,18 @@
         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 @@
 
 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();
+    //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)
+    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);
 }
--- a/QTfrontend/ui/widget/teamselect.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/teamselect.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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
--- a/QTfrontend/ui/widget/teamselhelper.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/teamselhelper.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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;"
-            "}");
+                        "icon-size: 48px;"
+                        "text-align: left;"
+                        "background-color: #0d0544;"
+                        "color: orange;"
+                        "font: bold;"
+                        "border-width: 2px;"
+                        "margin: 6px 0px 6px 0px;"
+                        "}");
 
-    if(m_isPlaying) {
+    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 @@
 
 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 @@
   return params;
 }*/
 
-void TeamShowWidget::changeTeamColor(QColor color)
+
+void TeamShowWidget::changeTeamColor(int 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();
-        }
-    }
+    colorWidget->setColor(color);
+}
 
-    colorButt->setStyleSheet(QString("QPushButton{"
-            "background-color: %1;"
-            "border-width: 1px;"
-            "border-radius: 2px;"
-            "}").arg(pOurFrameTeams->currentColor->name()));
+void TeamShowWidget::onColorChanged(int color)
+{
+    m_team.setColor(color);
 
-    m_team.setColor(color);
     emit teamColorChanged(m_team);
 }
 
 HWTeam TeamShowWidget::getTeam() const
 {
-  return m_team;
+    return m_team;
 }
--- a/QTfrontend/ui/widget/teamselhelper.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/teamselhelper.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
+        Q_OBJECT
 
- public slots:
- void changeTeamColor(QColor color=QColor());
- void hhNumChanged();
+    public slots:
+        void changeTeamColor(int color = 0);
+        void hhNumChanged();
 
- private slots:
- void activateTeam();
+    private slots:
+        void activateTeam();
+        void onColorChanged(int color);
 
- public:
- TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent);
- void setPlaying(bool isPlaying);
- void setHHNum(unsigned int num);
- void setInteractivity(bool interactive);
- HWTeam getTeam() const;
+    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;
- QPushButton* colorButt;
- QPushButton* butt;
-// QPushButton* bText;
+    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&);
+    signals:
+        void teamStatusChanged(HWTeam team);
+        void hhNmChanged(const HWTeam&);
+        void teamColorChanged(const HWTeam&);
 };
 
 #endif // _TEAMSEL_HELPER_INCLUDED
--- a/QTfrontend/ui/widget/togglebutton.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/togglebutton.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email@thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/togglebutton.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/togglebutton.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email@thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/vertScrollArea.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/vertScrollArea.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
--- a/QTfrontend/ui/widget/vertScrollArea.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/vertScrollArea.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui/widget/weaponItem.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/weaponItem.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 void WeaponItem::incItems()
 {
-  ++numItems;
+    ++numItems;
 }
 
 void WeaponItem::decItems()
 {
-  --numItems;
+    --numItems;
 }
 
--- a/QTfrontend/ui/widget/weaponItem.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui/widget/weaponItem.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/ui_hwform.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui_hwform.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
     pageDataDownload = new PageDataDownload();
     Pages->addWidget(pageDataDownload);
+
+    pageFeedback = new PageFeedback();
+    Pages->addWidget(pageFeedback);
+
+    pageVideos = new PageVideos();
+    Pages->addWidget(pageVideos);
 }
--- a/QTfrontend/ui_hwform.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/ui_hwform.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 PageMultiplayer;
 class PagePlayDemo;
 class PageOptions;
+class PageFeedback;
 class PageNet;
 class PageNetServer;
 class PageNetChat;
@@ -42,6 +43,7 @@
 class PageAdmin;
 class PageNetType;
 class PageDrawMap;
+class PageVideos;
 class QStackedLayout;
 class QFont;
 class QWidget;
@@ -50,39 +52,41 @@
 
 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/DataManager.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,215 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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]));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/DataManager.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,166 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/util/HWDataManager.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@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 "";
-}
-
--- a/QTfrontend/util/HWDataManager.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@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
--- a/QTfrontend/util/SDLInteraction.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/util/SDLInteraction.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     if (m_audioInitialized)
     {
         if (m_music != NULL)
+        {
+            Mix_HaltMusic();
             Mix_FreeMusic(m_music);
+        }
         Mix_CloseAudio();
     }
     SDL_Quit();
@@ -84,7 +87,8 @@
     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 @@
     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::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);
         }
     }
--- a/QTfrontend/util/SDLInteraction.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/util/SDLInteraction.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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();
+    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();
+        /// 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.
+        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
+        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();
+    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();
+        /// Class Destructor.
+        ~SDLInteraction();
 
-    /**
-     * @brief Returns available (screen) resolutions.
-     *
-     * @return list of resolutions in the format WIDTHxHEIGHT.
-     */
-    QStringList getResolutions() const;
+        /**
+         * @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;
+        /// 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 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);
+        /**
+         * @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();
+        /// Starts the background music if not already playing.
+        void startMusic();
 
-    /// Fades out and stops the background music (if playing).
-    void stopMusic();
+        /// Fades out and stops the background music (if playing).
+        void stopMusic();
 };
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/libav_iteraction.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,356 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 "libav_iteraction.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
+}
+
+LibavIteraction::LibavIteraction() : 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 LibavIteraction::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 LibavIteraction::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 LibavIteraction::getExtension(const QString & format)
+{
+    return formats[format].extension;
+}
+
+// get information abaout file (duration, resolution etc) in multiline string
+QString LibavIteraction::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
+LibavIteraction::LibavIteraction() : QObject()
+{
+
+}
+
+void LibavIteraction::fillFormats(QComboBox * pFormats)
+{
+    Q_UNUSED(pFormats);
+}
+
+void LibavIteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Q_UNUSED(format);
+    Q_UNUSED(pVCodecs);
+    Q_UNUSED(pACodecs);
+}
+
+QString LibavIteraction::getExtension(const QString & format)
+{
+    Q_UNUSED(format);
+
+    return QString();
+}
+
+QString LibavIteraction::getFileInfo(const QString & filepath)
+{
+    Q_UNUSED(filepath);
+
+    return QString();
+}
+#endif
+
+LibavIteraction & LibavIteraction::instance()
+{
+    static LibavIteraction instance;
+    return instance;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/libav_iteraction.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 LibavIteraction : public QObject
+{
+    Q_OBJECT;
+
+    LibavIteraction();
+
+public:
+
+    static LibavIteraction & 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
--- a/QTfrontend/util/namegen.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/util/namegen.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Martin Minarik <ttsmj@pokec.sk>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
         // 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 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 @@
     delete file;
 
     if (list.size() == 0)
-         list.append(filename);
+        list.append(filename);
 
     return list;
 }
@@ -154,8 +154,8 @@
     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 @@
     delete file;
 
     if (list.size() == 0)
-         list.append(QString("generic"));
+        list.append(QString("generic"));
 
     return list;
 }
@@ -184,7 +184,7 @@
 
     // 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 @@
     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 @@
     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)
--- a/QTfrontend/util/namegen.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/util/namegen.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Martin Minarik <ttsmj@pokec.sk>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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;
--- a/QTfrontend/xfire.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/xfire.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
         return;
     XfireSetCustomGameDataA(XFIRE_KEY_COUNT, (const char**)keys, (const char**)values);
 }
+#endif // USE_XFIRE
--- a/QTfrontend/xfire.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/QTfrontend/xfire.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README_WINDOWS	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,1 @@
+For instructions, please visit: http://code.google.com/p/hedgewars/wiki/BuildingOnWindows
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake_modules/FindFFMPEG.cmake	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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)
+
--- a/cmake_modules/FindLua.cmake	Thu Nov 24 13:44:30 2011 +0100
+++ b/cmake_modules/FindLua.cmake	Sun Oct 28 13:28:23 2012 +0100
@@ -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(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)
+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)
+
 SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
-#UNSET(LUA_DEFAULT)
+
--- a/cmake_modules/FindSDL_Extras.cmake	Thu Nov 24 13:44:30 2011 +0100
+++ b/cmake_modules/FindSDL_Extras.cmake	Sun Oct 28 13:28:23 2012 +0100
@@ -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 @@
     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 @@
     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()
 
Binary file doc/hwdemo.png has changed
--- a/gameServer/Actions.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/Actions.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP, OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
 module Actions where
 
 import Control.Concurrent
@@ -20,7 +21,9 @@
 import System.Process
 import Network.Socket
 -----------------------------
+#if defined(OFFICIAL_SERVER)
 import OfficialServer.GameReplayStore
+#endif
 import CoreTypes
 import Utils
 import ClientIO
@@ -36,7 +39,9 @@
     | MoveToRoom RoomIndex
     | MoveToLobby B.ByteString
     | RemoveTeam B.ByteString
+    | SendTeamRemovalMessage B.ByteString
     | RemoveRoom
+    | FinishGame
     | UnreadyRoomClients
     | JoinLobby
     | ProtocolError B.ByteString
@@ -48,10 +53,12 @@
     | 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
@@ -144,9 +151,14 @@
     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 +170,7 @@
 
     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 +186,12 @@
     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
@@ -207,46 +225,64 @@
     (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 +295,10 @@
 
     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,52 +308,82 @@
     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
-    rnc <- gets roomsClients
+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 FinishGame = do
+    rnc <- gets roomsClients
+    ri <- clientRoomA
+    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
+        : answerRemovedTeams
+
+
+processAction (SendTeamRemovalMessage teamName) = do
+    chans <- othersChans
+    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
-    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
-                    })
-                ]
-    where
-        rmTeamMsg = toEngineMsg $ 'F' `B.cons` teamName
+    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
@@ -377,11 +442,22 @@
 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 +488,15 @@
 
 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 +561,11 @@
     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 +577,7 @@
     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)
--- a/gameServer/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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}")
 
--- a/gameServer/ClientIO.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/ClientIO.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -43,15 +43,18 @@
 
 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 :: ShutdownThreadException) -> return . B.pack . show $ e)
         `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.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 @@
         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
 
--- a/gameServer/Consts.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/Consts.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -4,4 +4,4 @@
 import qualified Data.ByteString.Char8 as B
 
 serverVersion :: B.ByteString
-serverVersion = "0"
+serverVersion = "1"
--- a/gameServer/CoreTypes.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/CoreTypes.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -34,6 +34,7 @@
         pingsQueue :: !Word,
         isMaster :: Bool,
         isReady :: !Bool,
+        isInGame :: Bool,
         isAdministrator :: Bool,
         clientClan :: Maybe B.ByteString,
         teamsInGame :: Word
@@ -62,24 +63,29 @@
         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 @@
         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 @@
         0
         False
         False
+        []
         (
             Map.fromList $ Prelude.zipWith (,)
                 ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
@@ -134,7 +142,7 @@
         latestReleaseVersion :: Word16,
         earliestCompatibleVersion :: Word16,
         listenPort :: PortNumber,
-        nextRoomID :: Int,
+        --nextRoomID :: Int,
         dbHost :: B.ByteString,
         dbName :: B.ByteString,
         dbLogin :: B.ByteString,
@@ -154,11 +162,11 @@
     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.17 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>"
+        41
+        43 -- 0.9.18
         46631
-        0
+        --0
         ""
         ""
         ""
@@ -192,6 +200,7 @@
 data Notice =
     NickAlreadyInUse
     | AdminLeft
+    | WrongPassword
     deriving Enum
 
 data ShutdownException =
--- a/gameServer/EngineInteraction.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/EngineInteraction.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -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 @@
         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,
--- a/gameServer/HWProtoCore.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/HWProtoCore.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -51,7 +51,7 @@
     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 @@
             nick cl,
             B.concat ["[", hostStr, "]"],
             protoNumber2ver $ clientProto cl,
-            B.concat ["[", roomInfo, "]", roomStatus]
+            B.concat ["[", rInfo, "]", roomStatus]
             ]
 
 
--- a/gameServer/HWProtoInRoomState.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/HWProtoInRoomState.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -2,7 +2,7 @@
 module HWProtoInRoomState where
 
 import qualified Data.Map as Map
-import Data.Sequence((|>), empty)
+import Data.Sequence((|>))
 import Data.List
 import Data.Maybe
 import qualified Data.ByteString.Char8 as B
@@ -79,10 +79,10 @@
         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
@@ -157,21 +157,25 @@
 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 +183,12 @@
             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"]
+                , AnswerClients chans $ "CLIENT_FLAGS" : "+g" : nicks
+                , ModifyRoomClients (\c -> c{isInGame = True})
                 ]
             else
             return [Warning "Less than two clans!"]
@@ -210,21 +216,20 @@
     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 +257,9 @@
 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 +267,10 @@
         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 +290,16 @@
     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)"]
--- a/gameServer/HWProtoLobbyState.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/HWProtoLobbyState.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -6,6 +6,7 @@
 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 @@
             AnswerClients [clChan] ["TEAM_COLOR", teamname team, teamcolor team],
             AnswerClients [clChan] ["HH_NUM", teamname team, showB $ hhnum team]]
 
+
 handleCmd_lobby :: CmdHandler
 
 
@@ -31,19 +33,8 @@
     (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 @@
             [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 (\cl -> cl{isMaster = True, isReady = True})
+                , ModifyRoom (\r -> r{readyPlayers = 1})
             ]
 
 
@@ -79,19 +72,25 @@
     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 ["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 @@
     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 @@
     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 ["RESTART_SERVER"] = do
     cl <- thisClient
-    return [RestartServer]
+    return [RestartServer | isAdministrator cl]
 
 
 handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"]
--- a/gameServer/HandlerUtils.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/HandlerUtils.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -48,6 +48,12 @@
     (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
 
--- a/gameServer/NetRoutines.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/NetRoutines.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -3,7 +3,6 @@
 
 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 @@
                     False
                     False
                     False
+                    False
                     Nothing
                     0
                     )
--- a/gameServer/OfficialServer/DBInteraction.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/OfficialServer/DBInteraction.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -60,7 +60,7 @@
         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
--- a/gameServer/RoomsAndClients.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/RoomsAndClients.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -1,3 +1,5 @@
+{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving #-}
+
 module RoomsAndClients(
     RoomIndex(),
     ClientIndex(),
@@ -34,24 +36,25 @@
 
 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 @@
 
 
 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
--- a/gameServer/ServerCore.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/ServerCore.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,5 @@
 module ServerCore where
 
-import Network
 import Control.Concurrent
 import Control.Monad
 import System.Log.Logger
@@ -43,7 +42,7 @@
 
         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 @@
             (fromJust $ serverSocket si)
             (coreChan si)
 
-    return ()
-
     _ <- forkIO $ timerLoop 0 $ coreChan si
 
     startDBConnection si
--- a/gameServer/ServerState.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/ServerState.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -6,11 +6,13 @@
     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 @@
     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
--- a/gameServer/Store.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/Store.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -1,3 +1,4 @@
+{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving #-}
 module Store(
     ElemIndex(),
     MStore(),
@@ -17,17 +18,18 @@
     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 @@
 
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 
 -- 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
--- a/gameServer/Utils.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/Utils.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -4,19 +4,17 @@
 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
 
@@ -88,6 +86,8 @@
             , (38, "0.9.16-dev")
             , (39, "0.9.16")
             , (40, "0.9.17-dev")
+            , (41, "0.9.17")
+            , (42, "0.9.18-dev")
             ]
 
 askFromConsole :: B.ByteString -> IO B.ByteString
@@ -119,3 +119,16 @@
 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))
+        ]
--- a/gameServer/hedgewars-server.cabal	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/hedgewars-server.cabal	Sun Oct 28 13:28:23 2012 +0100
@@ -18,7 +18,7 @@
     base >= 4.3,
     unix,
     containers,
-    array,
+    vector,
     bytestring,
     bytestring-show,
     network >= 2.3,
--- a/gameServer/stresstest.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/stresstest.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -14,10 +14,10 @@
 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
--- a/gameServer/stresstest3.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/gameServer/stresstest3.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -47,7 +47,7 @@
     waitPacket "CONNECTED"
     sendPacket ["NICK", "test" ++ show n]
     waitPacket "NICK"
-    sendPacket ["PROTO", "31"]
+    sendPacket ["PROTO", "41"]
     waitPacket "PROTO"
     b <- waitPacket "LOBBY:JOINED"
     --io $ print b
--- a/hedgewars/ArgParsers.inc	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/ArgParsers.inc	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 @@
 
 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 @@
                                       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 @@
     setShowFPS(showFPS);
 
     altDamage:= altDamageParam = '1';
-    val(timeItervalParam, timeIterval);
+    val(timeItervalParam, timeIterval, c);
     reducedQuality:= reducedQualityParam = '1';
     setAltDamageTimerValueAndQuality(altDamage,timeIterval,reducedQuality);
 end;
@@ -159,7 +162,7 @@
     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 @@
                             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
--- a/hedgewars/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -3,7 +3,6 @@
 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_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 @@
     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 @@
     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 @@
 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 @@
     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(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 @@
     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 @@
 
 
 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")
+
+#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()
+endif()
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/GL.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,3 @@
+#pragma once
+
+#include <GL/gl.h>
--- a/hedgewars/GSHandlers.inc	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/GSHandlers.inc	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
         sX:= dX / steps;
         sY:= dY / steps;
         end
+        
     else
         begin
         sX:= dX;
@@ -84,216 +85,83 @@
         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)
+    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
-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 @@
     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 @@
 
 
 // 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 @@
         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 @@
         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 @@
     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 @@
         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 @@
         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 @@
                 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 @@
 
                 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 @@
                     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);
-
-if Gear^.Kind = gtHellishBomb then
-begin
-
-    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;
+
+    CalcRotationDirAngle(Gear);
+
+    if Gear^.Kind = gtHellishBomb then
+        begin
+
+        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;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepMolotov(Gear: PGear);
 var 
-	s: Longword;
+    s: Longword;
     i, gX, gY: LongInt;
     dX, dY: hwFloat;
     smoke, glass: PVisualGear;
@@ -540,13 +431,18 @@
     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
                     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 @@
             end;
         DeleteGear(Gear);
         exit
-    end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -595,13 +492,14 @@
     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 @@
 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 @@
     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 @@
         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 @@
     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 @@
 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 @@
     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 @@
         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 @@
             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
+                        rx:= lx;
+                        ry:= ly;
+                        if cReducedQuality and rqBlurryLand <> 0 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
+                            rx:= rx div 2;ry:= ry div 2;
+                            end;
+                        if Land[yy + py, xx + px] and $FF00 = 0 then
                             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
-                            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]);
-                            end;
+                                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 @@
         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 @@
 ////////////////////////////////////////////////////////////////////////////////
 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 @@
                 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 @@
 
     // 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
+        begin
         if (GameTicks and $F) = 0 then
-        begin
+            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 @@
             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 @@
                     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 @@
     if (Gear^.Timer > 0) then
         dec(Gear^.Timer)
     else
-    begin
+        begin
         if nuw then
-        begin
-            StopSound(Gear^.SoundChannel);
+           begin
+            StopSoundChan(Gear^.SoundChannel);
             CheckGearDrowning(Gear);
-        end
+            end
         else
             doStepFallingGear(Gear);
-    end;
+        end;
 end;
 
 procedure doStepBee(Gear: PGear);
@@ -941,16 +866,16 @@
     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 @@
         // 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 @@
     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 @@
     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);
-
-    i := 200;
+            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;
     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 @@
 
         // Bullet trail
         VGear := AddVisualGear(hwRound(ox), hwRound(oy), vgtLineTrail);
+        
         if VGear <> nil then
             begin
             VGear^.X:= hwFloat2Float(ox);
@@ -1053,12 +985,12 @@
 
             // 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 @@
         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 @@
         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
+        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
+            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);
+            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;
-        end;
-       
-        spawnBulletTrail(Gear);
-        Gear^.doStep := @doStepShotIdle
-    end;
 end;
 
 procedure doStepDEagleShot(Gear: PGear);
@@ -1166,21 +1099,22 @@
     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 @@
         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 @@
     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
-        begin
-        StopSound(Gear^.SoundChannel);
+    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
+        StopSoundChan(Gear^.SoundChannel);
         DeleteGear(Gear);
         AfterAttack;
         doStepHedgehogMoving(HHGear);  // for gfInfAttack
@@ -1267,7 +1206,7 @@
         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
@@ -1300,29 +1239,34 @@
         end
     else
         begin
-        if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y + Gear^.dY + cGravity), lfIndestructible) then
+        if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y + Gear^.dY + cGravity), $FF00) then
             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;
-    if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)-cHHRadius, lfIndestructible) then
+    if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)-cHHRadius, $FF00) then
         begin
         HHGear^.X := Gear^.X;
         HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius)
         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 @@
 
     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 @@
 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 @@
     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 @@
 
         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 @@
         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 @@
         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 @@
 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 @@
         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 @@
                 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
-        begin
+    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
+        begin
         if ((Gear^.State and gstAttacking) = 0) then
-        begin
+            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 @@
 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 @@
     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 @@
     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 @@
         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 @@
     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 @@
         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 @@
         // <-- 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;
-
-    if (Gear^.dY.QWordValue <> 0) or (TestCollisionYwithGear(Gear, 1) = 0) then
-    begin
+                    end
+                end;
+            exit
+        end;
+
+    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;
-
-    if (Gear^.dY.QWordValue = 0) then AddGearCI(Gear)
-    else if (Gear^.dY.QWordValue <> 0) then DeleteCI(Gear)
+        end;
+
+    if (Gear^.dY.QWordValue = 0) then
+        AddGearCI(Gear)
+    else if (Gear^.dY.QWordValue <> 0) then
+        DeleteCI(Gear)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2218,13 +1820,13 @@
     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 @@
     AllInactive := false;
     dec(Gear^.Timer);
     if Gear^.Timer = 0 then
-    begin
+        begin
         DeleteGear(Gear);
         AfterAttack
-    end
+        end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2291,7 +1893,7 @@
     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 @@
 
         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 @@
             inc(Gear^.Damage)
             end
         else
-        begin
+            begin
             gX := hwRound(Gear^.X);
             gY := hwRound(Gear^.Y);
             // Standard fire
@@ -2368,12 +1973,16 @@
                     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
                     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
+            begin
             if ((GameTicks and $3) = 0) and (Random(1) = 0) then
-            begin
-                for i:= 1 to Random(2)+1 do
-                begin
+                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 @@
 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 @@
     Gear^.doStep := @doStepFirePunchWork;
     DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y + _1, _0_5, _0, cHHRadius * 4, 5);
 
-    AddVoice(TSound(ord(sndFirePunch1) + GetRandom(6)), HHGear^.Hedgehog^.Team^.voicepack)
+    PlaySoundV(TSound(ord(sndFirePunch1) + GetRandom(6)), HHGear^.Hedgehog^.Team^.voicepack)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2489,29 +2091,36 @@
     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
+    or ((HHGear^.State and gstHHDriven) = 0)
+    or CheckGearDrowning(HHGear)
+    or ((Gear^.Message and gmAttack) <> 0) then
+        begin
         with HHGear^ do
-        begin
+            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 @@
 
     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 @@
     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 @@
     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 @@
     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 @@
     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;
-
-    HHGear^.State := HHGear^.State and not (gstAttacking or gstAttacked);
-    HHGear^.Message := HHGear^.Message and not gmAttack;
+        end;
+
+    HHGear^.State := HHGear^.State and (not (gstAttacking or gstAttacked));
+    HHGear^.Message := HHGear^.Message and (not gmAttack);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2668,30 +2271,34 @@
 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 @@
 
     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 @@
         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 @@
 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^.Z := cHHZ;
         HHGear^.Active := false;
-        HHGear^.Z := cHHZ;
-        RemoveGearFromList(HHGear);
-        InsertGearToList(HHGear);
+        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 @@
     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 @@
 
     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 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepKamikazeWork(Gear: PGear);
-
-const upd: Longword =   0;
 var 
     i: LongWord;
     HHGear: PGear;
@@ -2846,7 +2452,8 @@
 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 @@
         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 @@
         //      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
+        begin
         if Gear^.Health < 1500 then
-        begin
+            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 @@
                     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 @@
     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 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 const cakeh =   27;
-    cakeDmg =   75;
 var 
     CakePoints: array[0..Pred(cakeh)] of record
         x, y: hwFloat;
@@ -2979,7 +2588,8 @@
     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 @@
 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 (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
-        begin
-            Gear^.X := Gear^.X + int2hwFloat(xxn);
-            NextAngle
+    if Gear^.Tag < 7 then
+        exit;
+
+    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;
+        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 @@
     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
+        begin
         for i:= 0 to Pred(cakeh) do
-        begin
+            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 @@
     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 @@
 
     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 @@
 ////////////////////////////////////////////////////////////////////////////////
 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
-        begin
-        for i:= 0 to High(hogs) do
-            begin
-            if hogs[i] <> CurrentHedgehog^.Gear then
+    if hogs.size > 0 then
+        begin
+        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 @@
         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
                 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 @@
 var 
     i: LongWord;
 begin
-    if (Gear^.Tag = 0) or (cWaterLine = 0) then
-        begin
-            DeleteGear(Gear);
-            exit
+    if (Gear^.Tag = 0)
+    or (cWaterLine = 0) then
+        begin
+        DeleteGear(Gear);
+        exit
         end;
 
     AllInactive := false;
@@ -3256,12 +2846,12 @@
         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 @@
         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 @@
         DeleteGear(Gear);
         exit
         end
-    else if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) then
-        begin
-        StopSound(Gear^.SoundChannel);
+        
+    else if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) then
+        begin
+        StopSoundChan(Gear^.SoundChannel);
         Gear^.Tag := 1;
         Gear^.doStep := @doStepDrill
         end;
@@ -3341,21 +2934,25 @@
         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 @@
                 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 @@
     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);
-
-        AddGear(gx, gy, gtBall, 0,
-                SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx,
-        AngleCos(HHGear^.Angle) * ( - _0_8) + ry,
-        0);
+        begin
+        rx := rndSign(getRandomf * _0_1);
+        ry := rndSign(getRandomf * _0_1);
+
+        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;
-
-    if (Gear^.Timer = 0) or (HHGear^.Damage <> 0) then
-    begin
+        end;
+
+    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 @@
     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 @@
     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
+        begin
         if ((Gear^.Message and gmLeft) <> 0) then
-        begin
+            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 @@
 
         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 @@
         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;
-
-    if ((HHGear^.Message and gmLJump) <> 0)
-       and ((Gear^.State and gsttmpFlag) = 0) then
-    begin
+        end;
+
+    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 @@
     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 @@
     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 @@
     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 @@
                     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 @@
         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);
-        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
-        Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
-                     '%', cWhiteColor, fntSmall)
+        FreeTexture(Gear^.Tex);
+        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 @@
         // 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 @@
     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);
+        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
+            begin
             Gear^.State := Gear^.State or gsttmpFlag;
             dY := dY - _0_2
+            end
         end
-    end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -3716,9 +3325,9 @@
     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 @@
     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 @@
 
     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 @@
         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 @@
         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 @@
     // 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
+        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
-            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
+            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 @@
         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 @@
     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 @@
     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 @@
     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 @@
 
     // 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 @@
             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 @@
 
         // 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 @@
         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 @@
             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 @@
         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 @@
         // 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 @@
                         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;
 
-        if not isbullet and (iterator^.Kind <> gtFlake) then
+        // 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 (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 @@
     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 @@
                 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 @@
     // avoid compiler hints
 
     if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] > 255) then
-    begin
+        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 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 @@
         Gear^.dY := -s * tx;
 
         Gear^.DirAngle := DxDy2Angle(-Gear^.dY,Gear^.dX);
-        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 not Gear^.dX.isNegative then
+            Gear^.DirAngle := 180-Gear^.DirAngle;
+
+        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 @@
         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 @@
     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 @@
 
             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 @@
 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 @@
                 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 @@
 
     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 @@
             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 @@
         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 @@
     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 @@
 
         // 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
+            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
                 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 @@
 
                     // 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;
-
-                if getRandom(100) = 0 then
+                        begin
+                        tmp:= GetRandom(2 * Gear^.Radius);
+                        AddGear(x - Gear^.Radius + tmp, y - GetRandom(Gear^.Radius + 1), gtFlame, gsttmpFlag, _0, _0, 0)
+                        end
+                    end;
+
+                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 @@
 end;
 
 procedure doStepSineGunShot(Gear: PGear);
-var 
+var
     HHGear: PGear;
 begin
     PlaySound(sndSineGun); 
@@ -4628,7 +4308,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepFlamethrowerWork(Gear: PGear);
 var 
-    HHGear: PGear;
+    HHGear, flame: PGear;
     rx, ry, speed: hwFloat;
     i, gX, gY: LongInt;
 begin
@@ -4642,13 +4322,17 @@
         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 @@
         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
@@ -4685,7 +4373,7 @@
         if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then
             begin
             Gear^.Damage:= i;
-            if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
+            FreeTexture(Gear^.Tex);
             Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
                          '%', cWhiteColor, fntSmall)
             end
@@ -4697,7 +4385,7 @@
     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 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepLandGunWork(Gear: PGear);
 var 
-    HHGear: PGear;
+    HHGear, land: PGear;
     rx, ry, speed: hwFloat;
     i, gX, gY: LongInt;
 begin
@@ -4719,13 +4407,17 @@
         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
         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
-        begin
-        HHGear^.Message:= HHGear^.Message and not gmAttack;
+    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);
         DeleteGear(Gear);
         AfterAttack
         end
@@ -4757,7 +4450,7 @@
         if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then
             begin
             Gear^.Damage:= i;
-            if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
+            FreeTexture(Gear^.Tex);
             Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
                          '%', cWhiteColor, fntSmall)
             end
@@ -4769,7 +4462,7 @@
     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 @@
 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 @@
         if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then
             begin
             //tmp^.State:= tmp^.State or gstFlatened;
-            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 @@
             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 @@
     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
         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 @@
 
     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 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepResurrectorWork(Gear: PGear);
 var
-    graves: TPGearArray;
+    graves: PGearArrayS;
     resgear: PGear;
     hh: PHedgehog;
     i: LongInt;
@@ -4935,21 +4630,24 @@
 
     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
-        begin
-        StopSound(Gear^.SoundChannel);
+    if graves.size = 0 then
+        begin
+        StopSoundChan(Gear^.SoundChannel);
         Gear^.Timer := 250;
         Gear^.doStep := @doStepIdle;
         exit;
@@ -4957,12 +4655,13 @@
 
     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 @@
     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 @@
 
 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
-        begin
-        for i:= 0 to High(graves) do
+    if graves.size > 0 then
+        begin
+        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 @@
         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 @@
         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 @@
 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;
-        end;
-
-    if CurAmmoGear = Gear 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);
+        Gear^.State:= Gear^.State and (not gstMoving);
         end;
 
     dec(Gear^.Health, Gear^.Damage);
-    Gear^.Damage := 0;
+    Gear^.Damage:= 0;
         
-    if (Gear^.Tag = TotalRounds) or (Gear^.Health <= 0) then
-        begin
-        if Gear^.Hedgehog <> nil then
+    if Gear^.Pos = 1 then
+        begin
+        AddGearCI(Gear);
+        AfterAttack;
+        if Gear = CurAmmoGear then
+            CurAmmoGear:= nil;
+        if HH^.Gear <> nil then
+            HideHog(HH);
+        Gear^.Pos:= 2
+        end;
+        
+    if Gear^.Pos = 2 then
+        begin
+        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 @@
 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 @@
     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 @@
         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 @@
     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
         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 @@
     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,422 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
+(*
+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;
+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^.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;
+        CalcRotationDirAngle(Gear)
+        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;
+*)
--- a/hedgewars/HHHandlers.inc	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1155 +0,0 @@
-(*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@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;
-   while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1;
-   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);
-        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*hwRound(cMaxWindSpeed/(cGravity/2))) = 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;
--- a/hedgewars/LuaPas.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/LuaPas.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,4 +1,5 @@
 {$HINTS OFF}
+{$INCLUDE "options.inc"}
 
 unit LuaPas;
 
@@ -10,20 +11,20 @@
  *)
 
 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 @@
 ** ===================================================================
 *)
 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 @@
 ** 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 @@
 ** 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 @@
 ** 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 @@
 #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
-  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;
+    (*
+    ** 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;
 
-  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;
+    (* 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 @@
 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 @@
 ** 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 @@
     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 @@
 *)
 
 const
-  (* Key to file-handle type *)
-  LUA_FILEHANDLE  = 'FILE*';
+    (* 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';
+    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 @@
 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;
+    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;
+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_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 @@
 *)
 
 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_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 @@
 
 (* 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 @@
 (*****************************************************************************)
 (*                            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 @@
 
 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 @@
 
 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 @@
 
 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;
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/Math.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,2 @@
+#pragma once
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/PNGh.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,90 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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.
--- a/hedgewars/PascalExports.pas	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-(*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@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;
-function HW_getNumberOfWeapons:LongInt; cdecl; export;
-function HW_getMaxNumberOfTeams:LongInt; cdecl; export;
-function HW_getMaxNumberOfHogs:LongInt; cdecl; export;
-procedure HW_terminate(closeFrontend: Boolean); 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;
-{$ENDIF}
-
-end.
-
--- a/hedgewars/SDLh.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/SDLh.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,48 +22,51 @@
 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}
-    {$IFNDEF ANDROID}
-      {$linklib pthread}
+    {$IFNDEF DARWIN}
+        {$linklib c}
     {$ENDIF}
-  {$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}
 
 
@@ -76,19 +79,19 @@
     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}
 
 /////////////////////////////////////////////////////////////////
@@ -111,6 +114,10 @@
 
     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;
 
@@ -148,6 +155,7 @@
     SDL_DOLLARRECORD      = $801;
     SDL_MULTIGESTURE      = $802;
     SDL_CLIPBOARDUPDATE   = $900;
+    SDL_DROPFILE          = $1000;
     SDL_USEREVENT         = $8000;
     SDL_LASTEVENT         = $FFFF;
     // no compatibility events $7000
@@ -262,6 +270,19 @@
     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;
@@ -290,7 +311,6 @@
     IMG_INIT_PNG = $00000002;
     IMG_INIT_TIF = $00000004;
 
-    {* SDL_EventMask type definition *}
 
 /////////////////////////////////////////////////////////////////
 ///////////////////////  TYPE DEFINITIONS ///////////////////////
@@ -306,6 +326,8 @@
     PSDL_Renderer = Pointer;
     PSDL_Texture  = Pointer;
     PSDL_GLContext= Pointer;
+    TSDL_FingerId = Int64;
+    TSDL_TouchId  = Int64;
 {$ENDIF}
 
     PSDL_Rect = ^TSDL_Rect;
@@ -365,7 +387,7 @@
 {$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
@@ -388,12 +410,10 @@
 
     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;
 
 
@@ -436,13 +456,14 @@
 {$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;
@@ -452,6 +473,7 @@
     // available in sdl12 but not exposed
     TSDL_TextEditingEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
         text: array[0..31] of Byte;
         start, lenght: LongInt;
@@ -460,15 +482,17 @@
     // 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;
@@ -477,21 +501,24 @@
 
     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;
@@ -499,8 +526,15 @@
         error: Single;
         end;
 
+    TSDL_DropEvent = record
+        type_: LongWord;
+        timestamp: LongWord;
+        filename: PChar;
+        end;
+
     TSDL_SysWMEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         msg: Pointer;
         end;
 {$ELSE}
@@ -526,8 +560,9 @@
     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}
@@ -537,6 +572,7 @@
     TSDL_MouseMotionEvent = record
 {$IFDEF SDL13}
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
         state, padding1, padding2, padding3: Byte;
         x, y, z, xrel, yrel : LongInt;
@@ -549,8 +585,9 @@
     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;
@@ -561,6 +598,7 @@
     TSDL_MouseWheelEvent = record
         type_: LongWord;
 {$IFDEF SDL13}
+        timestamp: LongWord;
         windowID: LongWord;
 {$ELSE}
         which: Byte;
@@ -569,7 +607,12 @@
         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}
@@ -581,7 +624,12 @@
         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}
@@ -593,7 +641,12 @@
         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;
@@ -603,7 +656,12 @@
         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;
@@ -613,12 +671,18 @@
         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;
@@ -656,6 +720,7 @@
             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
@@ -680,10 +745,10 @@
 
     TSDL_EventFilter = function( event : PSDL_Event ): Integer; cdecl;
 
+    TByteArray = array[0..65535] of Byte;
     PByteArray = ^TByteArray;
-    TByteArray = array[0..65535] of Byte;
+    TLongWordArray = array[0..16383] of LongWord;
     PLongWordArray = ^TLongWordArray;
-    TLongWordArray = array[0..16383] of LongWord;
 
     PSDL_Thread = Pointer;
     PSDL_mutex = Pointer;
@@ -748,40 +813,42 @@
     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;
 
 
 /////////////////////////////////////////////////////////////////
@@ -859,15 +926,18 @@
 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_CreateThread(fn: Pointer; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
-function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: LongWord): LongInt; 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;
@@ -887,7 +957,10 @@
 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;
@@ -911,14 +984,15 @@
 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;
@@ -939,6 +1013,7 @@
 
 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,10 +1036,13 @@
 function  Mix_PauseMusic(music: PMixMusic): LongInt; cdecl; external SDL_MixerLibName;
 function  Mix_ResumeMusic(music: PMixMusic): LongInt; cdecl; external SDL_MixerLibName;
 function  Mix_HaltChannel(channel: LongInt): LongInt; cdecl; external SDL_MixerLibName;
+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}
@@ -996,14 +1074,13 @@
 function  SDLNet_Read32(buf: Pointer): LongWord;
 
 implementation
-uses strings, uVariables;
+{$IFDEF SDL13}
+uses strings, uVariables, uStore;
 
-{$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);
+// 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;
@@ -1013,37 +1090,41 @@
     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}
 
@@ -1060,7 +1141,7 @@
 {$IFNDEF SDL_MIXER_NEWER}
 function  Mix_Init(flags: LongInt): LongInt;
 begin
-    exit(flags);
+    Mix_Init:= flags;
 end;
 
 procedure Mix_Quit;
@@ -1071,7 +1152,7 @@
 {$IFNDEF SDL_IMAGE_NEWER}
 function  IMG_Init(flags: LongInt): LongInt;
 begin
-    exit(flags);
+    IMG_Init:= flags;
 end;
 
 procedure IMG_Quit;
--- a/hedgewars/VGSHandlers.inc	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/VGSHandlers.inc	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
         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 @@
             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 @@
 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 @@
 ////////////////////////////////////////////////////////////////////////////////
 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^.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^.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 @@
 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 @@
 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 @@
             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 @@
     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 @@
 
 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 @@
 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 @@
 
 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 @@
 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 @@
     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  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 @@
     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 @@
         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 @@
 ////////////////////////////////////////////////////////////////////////////////
 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 @@
             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 @@
 ////////////////////////////////////////////////////////////////////////////////
 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;
 ////////////////////////////////////////////////////////////////////////////////
--- a/hedgewars/adler32.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/adler32.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -63,9 +63,10 @@
 (*
 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 @@
 $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 @@
             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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/avwrapper.c	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,515 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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);
+}
--- a/hedgewars/config.inc.in	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/config.inc.in	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/hedgewars/hwLibrary.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/hwLibrary.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,72 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-Library hwLibrary;
 {$INCLUDE "options.inc"}
 
-// 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 is not there yet)
-uses PascalExports, hwengine{$IFDEF ANDROID}, jni{$ENDIF};
-exports Game, HW_versionInfo;
+(*
+ * 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;
+
+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;
+
+// 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;
@@ -51,10 +106,21 @@
     HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons',
     HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs',
     HW_getMaxNumberOfTeams name Java_Prefix + 'HWgetMaxNumberOfTeams',
-    HW_terminate name Java_Prefix + 'HWterminate';
+    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.
-
--- a/hedgewars/hwengine.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/hwengine.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,20 +1,20 @@
 (*
-* Hedgewars, a free turn based strategy game
-* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@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@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,10 +29,14 @@
 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
-     {$IFDEF SDL13}, uTouch{$ENDIF}{$IFDEF ANDROID}, GLUnit{$ENDIF};
+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 initEverything(complete:boolean);
@@ -42,170 +46,190 @@
 
 implementation
 {$ELSE}
-procedure OnDestroy; 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;
 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;
-
-///////////////////
+////////////////////////////////////////////////////////////////////////////////
 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;
-                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);
+                        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.
@@ -213,18 +237,24 @@
                     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;
@@ -232,44 +262,79 @@
             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;
+    initEverything(true);
     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);
+    // cFullScreen functionality is platform dependent, ifdef it if you need to modify it
+    cFullScreen:= false;
+    
+    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';
     PathPrefix:= gameArgs[9];
     UserPathPrefix:= '../Documents';
@@ -281,20 +346,22 @@
     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);
@@ -307,9 +374,18 @@
     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();
@@ -335,77 +411,74 @@
     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);
+
+    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;
 
+////////////////////////////////////////////////////////////////////////////////
+// As a rule of thumb, every module that is listed in either initEverything or 
+// freeEverything should come in pair, even if they are stubs. Only use this 
+// section for inialising variables and remeber that game args overwrite these,
+// so handle this section with care. Pay attention to the init/free order too! 
 procedure initEverything (complete:boolean);
 begin
     Randomize();
 
-    if complete then cLogfileBase:= 'game'
-    else cLogfileBase:= 'preview';
+    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
 
-    // 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;
-
-    uLand.initModule;
-    uLandPainted.initModule;
-
-    uIO.initModule;
+    uLand.initModule;               // computes land
+    uLandPainted.initModule;        // computes drawn land
+    uIO.initModule;                 // sets up sockets
 
     if complete then
     begin
-{$IFDEF ANDROID}GLUnit.init;{$ENDIF}
-{$IFDEF SDL13}uTouch.initModule;{$ENDIF}
-	uAI.initModule;
-        //uAIActions does not need initialization
-        //uAIAmmoTests does not need initialization
+{$IFDEF ANDROID}GLUnit.initModule;{$ENDIF}
+{$IFDEF USE_TOUCH_INTERFACE}uTouch.initModule;{$ENDIF}
+{$IFDEF USE_VIDEO_RECORDING}uVideoRec.initModule;{$ENDIF}   //stub
+        uAI.initModule;
         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;
@@ -413,7 +486,6 @@
         uTeams.initModule;
         uVisualGears.initModule;
         uWorld.initModule;
-        uCaptions.initModule;
     end;
 end;
 
@@ -421,93 +493,91 @@
 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
+{$IFDEF HWLIBRARY}
     initEverything(false);
-{$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;
@@ -515,13 +585,28 @@
     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
+            initEverything(false);
+            ipcPort:= StrToInt(ParamStr(2));
+            GameType:= gmtLandPreview;
+            exit;
+            end
         else
-            if (ParamCount = cDefaultParamNum) then
-                internalStartGameWithParameters()
+            begin
+            initEverything(true);
+            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;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -529,14 +614,18 @@
 ////////////////////////////////////////////////////////////////////////////////
 begin
     GetParams();
-    if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
-    else cLocale := Copy(cLocaleFName,1,2);
+    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.
--- a/hedgewars/options.inc	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/options.inc	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004, 2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,39 +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}
 
+{$MACRO ON}
 {$MODE OBJFPC}
-{$MACRO ON}
+{$DEFINE GLunit:=GL}
+{$WRITEABLECONST OFF}
+{$IMPLICITEXCEPTIONS OFF}
+{$VARSTRINGCHECKS ON}
 
-{$DEFINE GLunit:=GL}
+{$DEFINE USE_LUA_SCRIPT}
+
 
 {$IFDEF ANDROID}
-  {$DEFINE SDL13}
-  {$DEFINE HWLIBRARY}
-  {$DEFINE S3D_DISABLED}
-  {$DEFINE GLunit:=gles11}
-  {$DEFINE MOBILE}
-  {$DEFINE Java_Prefix := 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'}
+    {$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}
+    {$DEFINE MOBILE}
+{$ENDIF}
+
+{$IFDEF MOBILE}
+    {$DEFINE HWLIBRARY}
+    {$DEFINE S3D_DISABLED}
+    {$DEFINE GLunit:=gles11}
+    {$DEFINE USE_LANDSCAPE_AMMOMENU}
+    {$DEFINE USE_TOUCH_INTERFACE}
+{$ELSE}
+    {$DEFINE USE_AM_NUMCOLUMN}
+{$ENDIF}
+
+
+{$IFDEF WIN32}
+    {$DEFINE USE_CONTEXT_RESTORE}
 {$ENDIF}
 
-{$IFNDEF IPHONEOS}
-  // not needed on ios because it is switched from the compiler command line arguments
-  {$DEFINE DEBUGFILE}
-  //{$DEFINE TRACEAIACTIONS}
-  //{$DEFINE COUNTTICKS}
+{$IFDEF DARWIN}
+    {$IFNDEF IPHONEOS}
+        {$DEFINE USE_CONTEXT_RESTORE}
+    {$ENDIF}
+{$ENDIF}
+
+{$IFDEF USE_TOUCH_INTERFACE}
+    {$DEFINE SDL13}
 {$ENDIF}
 
-//also available LUA_DISABLED
+{$IFDEF PAS2C}
+    {$DEFINE NOCONSOLE}
+    {$DEFINE USE_SDLTHREADS}
+{$ENDIF}
+
+{$DEFINE _S:=}
+{$DEFINE _P:=}
+
+//{$DEFINE TRACEAIACTIONS}
+//{$DEFINE COUNTTICKS}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/pas2c.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/pas2cSystem.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -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;
+
--- a/hedgewars/uAI.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uAI.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,108 +30,44 @@
 
 implementation
 uses uConsts, SDLh, uAIMisc, uAIAmmoTests, uAIActions,
-     uAmmos, SysUtils{$IFDEF UNIX}{$IFNDEF ANDROID}, cthreads{$ENDIF}{$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;
 
-procedure TestAmmos(var Actions: TActions; Me: PGear; isMoved: boolean);
-var BotLevel: Byte;
-    ap: TAttackParams;
-    Score, i: LongInt;
-    a, aa: TAmmoType;
-begin
-BotLevel:= Me^.Hedgehog^.BotLevel;
 
-for i:= 0 to Pred(Targets.Count) do
-    if (Targets.ar[i].Score >= 0) and (not StopThinking) then
-       begin
-       with CurrentHedgehog^ do
-            a:= CurAmmoType;
-       aa:= a;
-       SDL_delay(0);    //ThreadSwitch was only a hint
-       
-       repeat
-        if (CanUseAmmo[a]) and
-           ((not isMoved) or ((AmmoTests[a].flags and amtest_OnTurn) = 0)) then
-           begin
-{$HINTS OFF}
-           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);
-
-              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
-                    begin
-                    AddAction(BestActions, aia_Down, aim_push, 300 + random(250), 0, 0);
-                    AddAction(BestActions, aia_Down, aim_release, -ap.Angle, 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_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;
-
-procedure Walk(Me: PGear);
-const FallPixForBranching = cHHRadius * 2 + 8;
-      cBranchStackSize = 12;
-
+const cBranchStackSize = 12;
 type TStackEntry = record
                    WastedTicks: Longword;
                    MadeActions: TActions;
@@ -143,12 +79,12 @@
            States: array[0..Pred(cBranchStackSize)] of TStackEntry;
            end;
 
-    function Push(Ticks: Longword; const Actions: TActions; const Me: TGear; Dir: integer): boolean;
-    var bRes: boolean;
-    begin
+function Push(Ticks: Longword; const Actions: TActions; const Me: TGear; Dir: integer): boolean;
+var bRes: boolean;
+begin
     bRes:= (Stack.Count < cBranchStackSize) and (Actions.Count < MAXACTIONS - 5);
     if bRes then
-       with Stack.States[Stack.Count] do
+        with Stack.States[Stack.Count] do
             begin
             WastedTicks:= Ticks;
             MadeActions:= Actions;
@@ -157,209 +93,455 @@
             inc(Stack.Count)
             end;
     Push:= bRes
-    end;
+end;
 
-    procedure Pop(var Ticks: Longword; var Actions: TActions; var Me: TGear);
-    begin
+procedure Pop(var Ticks: Longword; var Actions: TActions; var Me: TGear);
+begin
     dec(Stack.Count);
     with Stack.States[Stack.Count] do
-         begin
-         Ticks:= WastedTicks;
-         Actions:= MadeActions;
-         Me:= Hedgehog
-         end
-    end;
+        begin
+        Ticks:= WastedTicks;
+        Actions:= MadeActions;
+        Me:= Hedgehog
+        end
+end;
+
+
+
+procedure TestAmmos(var Actions: TActions; Me: PGear; rareChecks: boolean);
+var BotLevel: Byte;
+    ap: TAttackParams;
+    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 Me^.Hedgehog^ do
+            a:= CurAmmoType;
+        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);
+{$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;
+
+                    AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
 
-var Actions: TActions;
-    ticks, maxticks, steps, tmp: Longword;
+                    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 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;
+var
+    ticks, maxticks, oldticks, steps, tmp: Longword;
     BaseRate, BestRate, Rate: integer;
     GoInfo: TGoInfo;
     CanGo: boolean;
     AltMe: TGear;
     BotLevel: Byte;
+    a: TAmmoType;
 begin
-ticks:= 0; // avoid compiler hint
-Actions.Count:= 0;
-Actions.Pos:= 0;
-Actions.Score:= 0;
+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) > 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;
+        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) 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 (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);
 
-       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;
-          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;
+                // 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;
 
-    if BestRate > BaseRate then exit
-    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;
-    StartTicks: Longword;
+    switchCount: LongInt;
+    StartTicks, currHedgehogIndex, itHedgehog, switchesNum, i: Longword;
+    switchImmediatelyAvailable: boolean;
+    Actions: TActions;
 begin
 InterlockedIncrement(hasThread);
 StartTicks:= GameTicks;
-BackMe:= PGear(Me)^;
+currHedgehogIndex:= CurrentTeam^.CurrHedgehog;
+itHedgehog:= currHedgehogIndex;
+switchesNum:= 0;
+
+switchImmediatelyAvailable:= (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtSwitcher);
+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^;
+
+            Actions.Count:= 0;
+            Actions.Pos:= 0;
+            Actions.Score:= 0;
+            if switchesNum > 0 then
+                begin
+                if not switchImmediatelyAvailable  then
+                    begin
+                    // 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);
+                    end;
+                for i:= 1 to switchesNum do
+                    AddAction(Actions, aia_Switch, 0, 300 + random(200), 0, 0);
+                end;
+            Walk(@WalkMe, Actions);
+
+            // find another hog in team
+            repeat
+                itHedgehog:= Succ(itHedgehog) mod CurrentTeam^.HedgehogsNumber;
+            until (itHedgehog = currHedgehogIndex) or (CurrentTeam^.Hedgehogs[itHedgehog].Gear <> nil);
+
 
-      WalkMe:= BackMe;
-      Walk(@WalkMe);
-      if (StartTicks > GameTicks - 1500) and (not StopThinking) then SDL_Delay(1000);
-      if BestActions.Score < -1023 then
-         begin
-         BestActions.Count:= 0;
-         AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
-         end;
-      end else
-else begin
-      while (not StopThinking) and (BestActions.Count = 0) do
+            inc(switchesNum);
+        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 (BestActions.Score < -1023) and (not BestActions.isWalkingToABetterPlace) then
             begin
-            FillBonuses(true);
-            WalkMe:= BackMe;
-            Walk(@WalkMe);
-            if not StopThinking then SDL_Delay(100)
-            end
-      end;
-PGear(Me)^.State:= PGear(Me)^.State and not gstHHThinking;
+            BestActions.Count:= 0;
+            AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
+            end;
+
+        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)
+        end
+    end;
+
+PGear(Me)^.State:= PGear(Me)^.State and (not gstHHThinking);
 Think:= 0;
 InterlockedDecrement(hasThread)
 end;
 
 procedure StartThink(Me: PGear);
-var a: TAmmoType;
 begin
 if ((Me^.State and (gstAttacking or gstHHJumping or gstMoving)) <> 0)
-   or isInMultiShoot then exit;
+or isInMultiShoot then
+    exit;
 
-//DeleteCI(Me); // this might break demo
+//DeleteCI(Me); // this will break demo/netplay
+
 Me^.State:= Me^.State or gstHHThinking;
 Me^.Message:= 0;
 
 BestActions.Count:= 0;
 BestActions.Pos:= 0;
 BestActions.Score:= Low(LongInt);
+BestActions.isWalkingToABetterPlace:= false;
 
 StopThinking:= false;
 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);
-for a:= Low(TAmmoType) to High(TAmmoType) do
-    CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(Me^.Hedgehog^, a);
 AddFileLog('Enter Think Thread');
-{$IFDEF IPHONEOS}
-//TODO: sdl_thread works on device but crashes in simulator, most likely because of outdated toolchain
+{$IFDEF USE_SDLTHREADS}
+ThinkThread := SDL_CreateThread(@Think{$IFDEF SDL13}, nil{$ENDIF}, Me);
+{$ELSE}
 BeginThread(@Think, Me, ThinkThread);
-{$ELSE}
-ThinkThread := SDL_CreateThread(@Think{$IFDEF SDL13}, nil{$ENDIF}, Me);
-{$ENDIF}
 {$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.
--- a/hedgewars/uAIActions.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uAIActions.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,55 +23,65 @@
 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_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_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;
-                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};
 
-const ActionIdToStr: array[0..6] of string[16] = (
+var PrevX: LongInt = 0;
+    timedelta: Longword = 0;
+
+const ActionIdToStr: array[0..8] of string[16] = (
 {aia_none}           '',
 {aia_Left}           'left',
 {aia_Right}          'right',
 {aia_Timer}          'timer',
 {aia_attack}         'attack',
 {aia_Up}             'up',
-{aia_Down}           'down'
+{aia_Down}           'down',
+{aia_Switch}         'switch',
+{aia_waitAngle}      'waitAngle'
                      );
 
 {$IFDEF TRACEAIACTIONS}
@@ -91,121 +101,164 @@
 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 CheckHang(Me: PGear);
+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;
 
 procedure ProcessAction(var Actions: TActions; Me: PGear);
 var s: shortstring;
-
-    procedure CheckHang;
-    const PrevX: LongInt = 0;
-          timedelta: Longword = 0;
-    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;
-
 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;
 
--- a/hedgewars/uAIAmmoTests.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uAIAmmoTests.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 @@
             (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 @@
             //(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 @@
             (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 @@
             (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 @@
 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 @@
 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
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
-        ap.Power:= hwRound(r * cMaxPower) + AIrndSign(random(Level) * 15);
+        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:= 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);
+        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, 200) + RateExplosion(Me, EX, EY + 120, 200)
+        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.Time:= TestTime div 1000 * 1000;
+            ap.ExplR:= 300;
+            ap.ExplX:= EX;
+            ap.ExplY:= EY;
+            valueResult:= Score
+            end;
+        end
+until (TestTime = 4100);
 TestWatermelon:= valueResult
 end;
 
+
+    function Solve(TX, TY, MX, MY: LongInt): LongWord;
+    var A, B, D, T: real;
+        C: LongInt;
+    begin
+        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:= sqrt(D) - B;
+            if D >= 0 then
+                T:= sqrt(D * 2 / A)
+            else
+                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: hwFloat;
-    Score, EX, EY, valueResult: LongInt;
+var Vx, Vy: real;
+    Score, EX, EY: LongInt;
     TestTime: Longword;
+    x, y, dY, meX, meY: real;
+begin
+    TestMortar:= BadTurn;
+    ap.ExplR:= 0;
 
-    function CheckTrace: LongInt;
-    var x, y, dY: hwFloat;
-        value: LongInt;
-    begin
-        x:= Me^.X;
-        y:= Me^.Y;
-        dY:= -Vy;
+    meX:= hwFloat2Float(Me^.X);
+    meY:= hwFloat2Float(Me^.Y);
 
-        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 (Level > 2) then
+        exit(BadTurn);
+
+    TestTime:= Solve(Targ.X, Targ.Y, trunc(meX), trunc(meY));
 
-        if (EY < cWaterLine) and not dY.isNegative 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;
+    if TestTime = 0 then
+        exit(BadTurn);
 
-        CheckTrace:= value;
-    end;
+    Vx:= (Targ.X - meX) / TestTime;
+    Vy:= cGravityf * (TestTime div 2) - (Targ.Y - meY) / TestTime;
+
+    x:= meX;
+    y:= meY;
+    dY:= -Vy;
 
-    function Solve: LongWord;
-    var A, B, D, T: hwFloat;
-        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
-            begin
-            D:= ( - B + hwSqrt(D)) * _0_5 / A;
-            if D.isNegative = false then
-                T:= hwSqrt(D)
+    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
+        Score:= RateExplosion(Me, EX, EY, 91);
+        if (Score = 0) then
+            if (dY > 0.15) then
+                Score:= - abs(Targ.Y - EY) div 32
             else
-                T:= _0;
-            Solve:= hwRound(T)
-            end else Solve:= 0
-    end;
-
-begin
-valueResult:= BadTurn;
-ap.ExplR:= 0;
-
-if (Level > 2) then exit(BadTurn);
+                Score:= BadTurn
+        else if (Score < 0) then
+            Score:= BadTurn
+        end
+    else
+        Score:= BadTurn;
 
-TestTime:= Solve;
-
-if TestTime = 0 then exit(BadTurn);
-
-    Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime);
-    Vy:= cGravity * (TestTime div 2) - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(TestTime);
-
-    Score:= CheckTrace;
-    if valueResult < Score then
+    if BadTurn < Score then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
+        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:= 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 ((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 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;
 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) < 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 ((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);
+    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 > 23);
 
-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;
-TestDesertEagle:= valueResult
+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: LongInt;
-    x, y: hwFloat;
+var valueResult, a, v1, v2: LongInt;
+    x, y, trackFall: LongInt;
+    dx, dy: real;
 begin
-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);
+    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;
 
-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;
+        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
+    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;
+
+    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
-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)
+    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);
+
+    // 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
-        valueResult:= BadTurn;
-    exit(valueResult)
-    end;
+        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;
 
-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);
+    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;
 
-TestFirePunch:= valueResult;
+    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 @@
 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 @@
 valueResult:= 0;
 
 repeat
-  X:= X + cBombsSpeed;
-  Y:= Y + dY;
-  dY:= dY + cGravity;
-  fexit:= true;
+    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(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);
+    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 @@
     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 @@
     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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uAILandMarks.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -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.
--- a/hedgewars/uAIMisc.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uAIMisc.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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;
+
+    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, uDebug;
-
-const KillScore = 200;
+uses uCollisions, uVariables, uUtils, uLandTexture, uGearsUtils;
 
-var friendlyfactor: LongInt = 300;
+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 @@
             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,186 +137,427 @@
 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
-                       ((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
-          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; 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 $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 TestColl(x, y, r: LongInt): boolean;
+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] <> 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] > 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
+            dmg:= min(baseDmg - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))), 25);
+            dmg:= trunc(dmg * dmgMod);
+            end;
+        if dmg > 0 then
             begin
-                if dmg >= abs(Score) then dmg := KillScore;
-                if Score > 0 then inc(rate, dmg)
-                else dec(rate, dmg * friendlyfactor div 100);
+            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;        
+        end;        
 RateShotgun:= rate * 1024;
 end;
 
@@ -308,189 +571,195 @@
 
 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 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;
+            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 ((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;}
 
-   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);
+    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;
@@ -503,7 +772,6 @@
 
 procedure freeModule;
 begin
-
 end;
 
 end.
--- a/hedgewars/uAmmos.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uAmmos.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 @@
 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 @@
             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 @@
 
 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 @@
     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 @@
     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 @@
 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 @@
     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 @@
                 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;
+if Hedgehog.Gear <> nil then
+    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
-        begin
-        if Angle < CurMinAngle then Angle:= CurMinAngle;
-        if Angle > CurMaxAngle then Angle:= CurMaxAngle;
+        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 @@
         ((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 @@
         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 @@
     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 @@
 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 @@
         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 @@
     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 @@
 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 @@
 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.
--- a/hedgewars/uCaptions.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uCaptions.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
 procedure DrawCaptions;
+procedure ReloadCaptions(unload: boolean);
 
 procedure initModule;
 procedure freeModule;
@@ -33,19 +34,28 @@
 uses uTextures, uRenderUtils, uVariables, uRender;
 
 type TCaptionStr = record
-                   Tex: PTexture;
-                   EndTime: LongWord;
-                   end;
+    Tex: PTexture;
+    EndTime: LongWord;
+    Text: shortstring;
+    Color: Longword
+    end;
 var
     Captions: array[TCapGroup] of TCaptionStr;
 
 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
 begin
-    if Captions[Group].Tex <> nil then
+    if Captions[Group].Text <> s then
+        begin
         FreeTexture(Captions[Group].Tex);
-    Captions[Group].Tex:= nil;
-
-    Captions[Group].Tex:= RenderStringTex(s, Color, fntBig);
+        Captions[Group].Tex:= nil
+        end;
+    
+    if Captions[Group].Tex = nil then
+        begin
+        Captions[Group].Color:= Color;
+        Captions[Group].Text:= s;
+        Captions[Group].Tex:= RenderStringTex(s, Color, fntBig)
+        end;
 
     case Group of
         capgrpGameState: Captions[Group].EndTime:= RealTicks + 2200
@@ -54,12 +64,23 @@
     end;
 end;
 
+// For uStore texture recreation
+procedure ReloadCaptions(unload: boolean);
+var Group: TCapGroup;
+begin
+for Group:= Low(TCapGroup) to High(TCapGroup) do
+    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;
+
 procedure DrawCaptions;
 var
     grp: TCapGroup;
     offset: LongInt;
 begin
-{$IFDEF MOBILE}
+{$IFDEF USE_TOUCH_INTERFACE}
     offset:= 48;
 {$ELSE}
     offset:= 8;
@@ -68,16 +89,17 @@
     for grp:= Low(TCapGroup) to High(TCapGroup) do
         with Captions[grp] do
             if Tex <> nil then
-            begin
-                DrawCentered(0, offset, Tex);
+                begin
+                DrawTextureCentered(0, offset, Tex);
                 inc(offset, Tex^.h + 2);
                 if EndTime <= RealTicks then
-                begin
+                    begin
                     FreeTexture(Tex);
                     Tex:= nil;
+                    Text:= '';
                     EndTime:= 0
+                    end;
                 end;
-            end;
 end;
 
 procedure initModule;
@@ -86,13 +108,13 @@
 end;
 
 procedure freeModule;
-var
-    group: TCapGroup;
+var group: TCapGroup;
 begin
     for group:= Low(TCapGroup) to High(TCapGroup) do
-    begin
+        begin
         FreeTexture(Captions[group].Tex);
-    end;
+        Captions[group].Tex:= nil
+        end
 end;
 
 end.
--- a/hedgewars/uChat.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uChat.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,22 +24,23 @@
 
 procedure initModule;
 procedure freeModule;
+procedure ReloadLines;
 
 procedure AddChatString(s: shortstring);
 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;
@@ -51,7 +52,8 @@
     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]
@@ -72,15 +74,15 @@
 cl.s:= str;
 
 if isInput then
-begin
+    begin
     color:= colors[#6];
     str:= UserNick + '> ' + str + '_'
-end
+    end
 else
-begin
+    begin
     color:= colors[str[1]];
     delete(str, 1, 1)
-end;
+    end;
 
 font:= CheckCJKFont(str, fnt16);
 w:= 0; h:= 0; // avoid compiler hints
@@ -99,6 +101,21 @@
 SDL_FreeSurface(resSurface)
 end;
 
+// For uStore texture recreation
+procedure ReloadLines;
+var i, t: LongWord;
+begin
+    if InputStr.s <> '' then
+        SetLine(InputStr, InputStr.s, true);
+    for i:= 0 to MaxStrIndex do
+        if Strs[i].s <> '' then
+            begin
+            t:= Strs[i].Time;
+            SetLine(Strs[i], Strs[i].s, false);
+            Strs[i].Time:= t
+            end;
+end;
+
 procedure AddChatString(s: shortstring);
 begin
 if not ChatReady then
@@ -137,8 +154,7 @@
 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);
@@ -150,9 +166,8 @@
 
 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);
@@ -162,7 +177,11 @@
     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;
@@ -183,12 +202,19 @@
 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
@@ -247,11 +273,10 @@
 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}
@@ -267,6 +292,7 @@
                 FreezeEnterKey;
                 SDL_EnableKeyRepeat(0,0);
                 GameState:= gsGame;
+                ResetKbd;
                 end;
         {Return}
         3, 13, 271: begin
@@ -278,12 +304,17 @@
             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:= '';
 
@@ -293,9 +324,10 @@
         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)
@@ -312,7 +344,7 @@
     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;
 
@@ -331,7 +363,7 @@
 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);
@@ -344,6 +376,7 @@
     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);
@@ -357,11 +390,11 @@
 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;
@@ -371,9 +404,7 @@
 
     inputStr.Tex := nil;
     for i:= 0 to MaxStrIndex do
-    begin
         Strs[i].Tex := nil;
-    end;
 end;
 
 procedure freeModule;
@@ -381,9 +412,7 @@
 begin
     FreeTexture(InputStr.Tex);
     for i:= 0 to MaxStrIndex do
-    begin
         FreeTexture(Strs[i].Tex);
-    end;
 end;
 
 end.
--- a/hedgewars/uCollisions.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uCollisions.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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  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 @@
 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 @@
     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 @@
 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 @@
 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 @@
 
 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 @@
 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;
+    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);
+    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
+    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;
+    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);
+    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
-         ((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
+    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;
 
-function TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt; withGear: boolean = true): boolean;
+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): boolean;
 begin
 Gear^.X:= Gear^.X + ShiftX;
 Gear^.Y:= Gear^.Y + int2hwFloat(ShiftY);
@@ -305,22 +337,28 @@
 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 @@
 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 @@
 var x, y: LongInt;
     TestWord: LongWord;
 begin
+TestRectancleForObstacle:= true;
+
 if landOnly then
     TestWord:= 255
 else
@@ -377,13 +431,12 @@
 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 @@
     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 @@
                     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 @@
                 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 @@
                 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 @@
 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 @@
 
     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;
--- a/hedgewars/uCommandHandlers.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uCommandHandlers.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 @@
         prevGState:= GameState;
         GameState:= gsConfirm;
         SDL_ShowCursor(1)
-        end else
+        end
+    else
         if GameState = gsConfirm then
             begin
             GameState:= prevGState;
@@ -67,18 +71,18 @@
 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 @@
     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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
     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 @@
 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 @@
 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 @@
 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;
 
-if not CurrentTeam^.ExtDriven then SendIPC(s);
+TryDo((s[0] = #1) and (s[1] >= '1') and (s[1] <= '5'), 'Malformed /timer', true);
+
+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,38 +532,57 @@
 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
     begin
-    UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s;
-    Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
+    if s = '' then
+        begin
+        UserPathz[ptMapCurrent]:= s;
+        Pathz[ptMapCurrent]:= s;
+        end
+    else
+        begin
+        UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s;
+        Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
+        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
@@ -494,10 +596,15 @@
             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;
@@ -517,17 +624,21 @@
 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;
@@ -547,12 +658,16 @@
 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;
 
@@ -582,90 +697,197 @@
     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,@cMineDudPercent, false);
-    RegisterVariable('minesnum', vtLongInt, @cLandMines     , false);
-    RegisterVariable('explosives',vtLongInt,@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',@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',@chDamagePercent , false);
+    RegisterVariable('ropepct' , @chRopePercent   , false);
+    RegisterVariable('getawaytime' , @chGetAwayTime , false);
+    RegisterVariable('minedudpct',@chMineDudPercent, false);
+    RegisterVariable('minesnum', @chLandMines     , false);
+    RegisterVariable('explosives',@chExplosives    , false);
+    RegisterVariable('gmflags' , @chGameFlags      , false);
+    RegisterVariable('turntime', @chHedgehogTurnTime, false);
+    RegisterVariable('minestime',@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',@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;
--- a/hedgewars/uCommands.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uCommands.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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;
--- a/hedgewars/uConsole.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uConsole.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,18 +26,18 @@
 procedure WriteToConsole(s: shortstring);
 procedure WriteLnToConsole(s: shortstring);
 function  GetLastConsoleLine: shortstring;
-function ShortStringAsPChar(s: shortstring): PChar;
+function  ShortStringAsPChar(s: shortstring): PChar;
 
 implementation
 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;
@@ -45,17 +45,19 @@
 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));
+    Log.__android_log_write(Log.Android_LOG_DEBUG, 'HW_Engine', ShortStringAsPChar('[Con]' + s));
 {$ELSE}
 Write(stderr, s);
 done:= false;
@@ -68,7 +70,8 @@
     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);
@@ -82,7 +85,7 @@
 {$IFNDEF NOCONSOLE}
 WriteToConsole(s);
 {$IFNDEF ANDROID}
-WriteLn(stderr);
+WriteLn(stderr, '');
 inc(CurrLine);
 if CurrLine = cLinesCount then
     CurrLine:= 0;
@@ -91,11 +94,12 @@
 {$ENDIF}
 end;
 
-function ShortStringAsPChar(s: ShortString) : PChar;
+function ShortStringAsPChar(s: shortstring) : PChar;
 begin
-    if Length(s) = High(s) then Dec(s[0]);
+    if Length(s) = High(s) then
+        Dec(s[0]);
     s[Ord(Length(s))+1] := #0;
-    exit(@s[1]);
+    ShortStringAsPChar:= @s[1];
 end;
 
 function GetLastConsoleLine: shortstring;
--- a/hedgewars/uConsts.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uConsts.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 const
     sfMax = 1000;
     cDefaultParamNum = 17;
+    cVideorecParamNum = cDefaultParamNum + 7;
 
     // message constants
     errmsgCreateSurface   = 'Error creating SDL surface';
@@ -51,7 +52,6 @@
     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 @@
     lfObject         = $2000;  
     lfDamaged        = $1000;  //
     lfIce            = $0800;  // blue
+    lfBouncy         = $0400;  // green
 
     cMaxPower     = 1500;
     cMaxAngle     = 2048;
@@ -103,18 +104,18 @@
     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 @@
     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,8 +147,16 @@
     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;
@@ -226,20 +229,24 @@
     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;
@@ -259,11 +266,15 @@
     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;
@@ -289,8 +300,33 @@
     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.
--- a/hedgewars/uCursor.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uCursor.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -24,7 +24,8 @@
         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;
 
--- a/hedgewars/uDebug.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uDebug.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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.
--- a/hedgewars/uFloat.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uFloat.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 {$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,7 +62,10 @@
 
 // The implemented operators
 
-operator = (const z1, z2: hwFloat) z:boolean; inline;
+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;
@@ -82,13 +85,16 @@
 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-}
@@ -110,10 +116,12 @@
          _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);
@@ -143,13 +151,21 @@
           _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);
@@ -158,6 +174,8 @@
              _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);
@@ -189,150 +207,264 @@
 
 {$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.QWordValue / $100000000;
-if i.isNegative then hwFloat2Float:= -hwFloat2Float;
+hwFloat2Float:= i.Frac / $100000000 + i.Round;
+if i.isNegative then
+    hwFloat2Float:= -hwFloat2Float;
 end;
 
-operator = (const z1, z2: hwFloat) z:boolean; inline;
+{$IFNDEF WEB}
+operator = (const z1, z2: hwFloat) z : boolean; inline;
 begin
     z:= (z1.isNegative = z2.isNegative) and (z1.QWordValue = z2.QWordValue);
 end;
 
+{$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;
+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
+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
+end;
+
+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
+    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
-   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
+    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 : hwFloat;
+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.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
+    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: hwFloat) z : hwFloat;
+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;
@@ -341,35 +473,62 @@
 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
@@ -394,7 +553,18 @@
 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;
 
 
@@ -402,22 +572,54 @@
 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 isZero(const z: hwFloat): boolean; inline; 
+function vector2Angle(const x, y: hwFloat): LongInt;
+var d, nf: hwFloat;
+    l, r, c, oc: Longword;
+    n: QWord;
 begin
-    isZero := z.QWordValue = 0;
+    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}
 
 end.
--- a/hedgewars/uGame.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uGame.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,55 +24,74 @@
 procedure DoGameTick(Lag: LongInt);
 
 ////////////////////
-   implementation
+    implementation
 ////////////////////
-uses uKeys, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
+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;
-       {$IFDEF SDL13}ProcessTouch;{$ENDIF}
-       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);
@@ -80,9 +99,9 @@
                         {$IFDEF IPHONEOS}InitIPC;{$ENDIF}
                         uMobile.SaveLoadingEnded();
                         end;
-               end
-          else ProcessGears
-       end;
+                end
+        else ProcessGears
+        end;
     inc(i)
     end
 end;
--- a/hedgewars/uGears.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uGears.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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,624 +52,39 @@
 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);
-
-if Gear^.Tex <> nil then
-    begin
-    FreeTexture(Gear^.Tex);
-    Gear^.Tex:= nil
-    end;
-
-// 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);
-                if Team^.AIKillsTex <> nil then 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;
@@ -682,11 +94,12 @@
 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;
 
@@ -699,11 +112,8 @@
             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
+            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);
@@ -712,7 +122,8 @@
             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
@@ -722,9 +133,9 @@
 procedure HealthMachine;
 var Gear: PGear;
     team: PTeam;
-       i: LongWord;
+    i: LongWord;
     flag: Boolean;
-     tmp: LongWord;
+    tmp: LongWord;
 begin
     Gear:= GearsList;
 
@@ -733,29 +144,31 @@
         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 
@@ -770,12 +183,7 @@
 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
@@ -786,7 +194,7 @@
     StepSoundChannel:= LoopSound(sndSteps)
 else if (StepSoundTimer = 0) and (StepSoundChannel > -1) then
     begin
-    StopSound(StepSoundChannel);
+    StopSoundChan(StepSoundChannel);
     StepSoundChannel:= -1
     end;
 
@@ -796,25 +204,39 @@
 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
-            if Gear^.Tex <> nil then 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
@@ -823,104 +245,133 @@
         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;
-
-                inc(step)
-                end else inc(step);
-    stChWin2: begin
-            CheckForWin;
             inc(step)
             end;
-    stHealth: begin
-            if (cWaterRise <> 0) or (cHealthDecrease <> 0) then
+    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;
+
+    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;
+                    SuddenDeathDmg:= true;
                         
-                        // 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);
-                        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;
 
@@ -943,26 +394,32 @@
         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
@@ -970,29 +427,30 @@
     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);
@@ -1002,15 +460,16 @@
     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;
 
@@ -1070,7 +529,7 @@
         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
@@ -1078,69 +537,6 @@
             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
@@ -1160,7 +556,8 @@
 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;
@@ -1173,7 +570,7 @@
 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;
@@ -1197,7 +594,8 @@
 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);
@@ -1231,138 +629,34 @@
 
 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;
+for i:= GetRandom(10)+30 downto 0 do
+    begin
+    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 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);
+snowRight:= max(LAND_WIDTH,4096)+512;
+snowLeft:= -(snowRight-LAND_WIDTH);
+
+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 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
-    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
-    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;
 
 procedure ShotgunShot(Gear: PGear);
 var t: PGear;
@@ -1377,6 +671,7 @@
         gtHedgehog,
             gtMine,
             gtSMine,
+            gtKnife,
             gtCase,
             gtTarget,
             gtExplosives,
@@ -1404,6 +699,7 @@
                         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
@@ -1429,20 +725,21 @@
         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)
@@ -1450,7 +747,8 @@
 
 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);
@@ -1462,61 +760,101 @@
         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 
-                        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
+            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
-                        Gear^.dX:= Ammo^.dX * Power * _0_01;
-                        Gear^.dY:= Ammo^.dY * Power * _0_01
+                        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;
-
-                    Gear^.Active:= true;
-                    Gear^.State:= Gear^.State or gstMoving;
+                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;
 
-                    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 (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;
 
-                    if (Ammo^.Kind <> gtFlame) or ((Ammo^.State and gsttmpFlag) = 0) then FollowGear:= Gear
-                    end;
+            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 (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;
@@ -1524,7 +862,8 @@
     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;
@@ -1538,8 +877,10 @@
                         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);
@@ -1569,8 +910,10 @@
     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;
@@ -1582,43 +925,30 @@
     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);
@@ -1641,21 +971,6 @@
     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;
@@ -1665,65 +980,46 @@
 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);
-            if Team^.AIKillsTex <> nil then 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;
@@ -1734,33 +1030,40 @@
     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
@@ -1773,23 +1076,24 @@
     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;
@@ -1798,11 +1102,12 @@
     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;
@@ -1814,9 +1119,10 @@
     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;
@@ -1889,119 +1195,6 @@
     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;
@@ -2030,7 +1223,8 @@
 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;
@@ -2049,12 +1243,16 @@
     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);
 
     (*
@@ -2068,7 +1266,8 @@
     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
@@ -2105,12 +1304,83 @@
 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;
@@ -2119,6 +1389,14 @@
 
     AllInactive:= false;
     PrvInactive:= false;
+
+    //typed const
+    delay:= 0;
+    delay2:= 0;
+    step:= stDelay;
+    upd:= 0;
+
+    //SDMusic:= 'hell.ogg';
 end;
 
 procedure freeModule;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uGearsHandlers.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,86 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uGearsHandlersRope.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,463 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uGearsHedgehog.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,1251 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uGearsList.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,593 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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.
--- a/hedgewars/uGearsRender.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uGearsRender.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
                 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 @@
 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
+            dec(eX, d);
+            inc(x, sX);
+            b:= true
+            end;
+        if (eY > 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(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 @@
             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;
 
 
@@ -195,9 +205,11 @@
     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 @@
         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 @@
     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
         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
@@ -309,8 +321,8 @@
                 // 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
@@ -323,7 +335,7 @@
             CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
  
             
-            DrawRotatedTex(HH^.Team^.CrosshairTex,
+            DrawTextureRotated(HH^.Team^.CrosshairTex,
                     12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
             end;
@@ -335,20 +347,20 @@
             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
@@ -357,38 +369,40 @@
                         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,
@@ -421,8 +435,9 @@
                             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,
@@ -430,13 +445,15 @@
                             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,
@@ -444,8 +461,9 @@
                             0);
                     defaultPos:= false
                     end;
-                gtHammer: begin
-                    DrawRotatedF(sprHammer,
+                gtHammer:
+                    begin
+                    DrawSpriteRotatedF(sprHammer,
                             sx,
                             sy,
                             1,
@@ -453,11 +471,13 @@
                             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,
@@ -465,14 +485,15 @@
                                 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,
@@ -481,7 +502,7 @@
                                 0)
                     else
                         begin
-                        DrawRotatedF(sprDress,
+                        DrawSpriteRotatedF(sprDress,
                                 ox, oy,
                                 CurAmmoGear^.Pos,
                                 sign,
@@ -490,12 +511,21 @@
                         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 DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
-                    if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex)
+                gtLandGun:
+                    begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
+                    if CurAmmoGear^.Tex <> nil then
+                        DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
+                    end;
+                gtIceGun:
+                    begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
+                    if CurAmmoGear^.Tex <> nil then
+                        DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
                     end;
             end;
 
@@ -503,12 +533,9 @@
                 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
@@ -542,11 +569,11 @@
             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,
@@ -561,54 +588,61 @@
             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,
@@ -617,34 +651,35 @@
                                     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,
@@ -672,7 +707,7 @@
             end;
 
             case amt of
-                amBaseballBat: DrawRotated(sprHandBaseball,
+                amBaseballBat: DrawSpriteRotated(sprHandBaseball,
                         sx - 4 * sign,
                         sy + 9, sign, aangle);
             end;
@@ -708,7 +743,7 @@
         begin
         if defaultPos then
             begin
-            DrawRotatedF(sprHHIdle,
+            DrawSpriteRotatedF(sprHHIdle,
                 sx,
                 sy,
                 (RealTicks div 128 + Gear^.Pos) mod 19,
@@ -792,11 +827,15 @@
                         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;
@@ -805,7 +844,7 @@
 
     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
@@ -815,17 +854,17 @@
             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)
@@ -833,7 +872,7 @@
         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,
@@ -845,12 +884,12 @@
             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);
@@ -875,55 +914,54 @@
 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);
@@ -936,52 +974,72 @@
                         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);
+                        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
+                        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 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;
       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)
@@ -992,15 +1050,16 @@
                     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
@@ -1008,15 +1067,17 @@
                     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
@@ -1025,9 +1086,9 @@
                             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
@@ -1036,9 +1097,9 @@
                             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;
@@ -1051,7 +1112,7 @@
                             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
@@ -1069,61 +1130,96 @@
                         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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uGearsUtils.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,759 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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.
--- a/hedgewars/uIO.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uIO.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 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 @@
 var IPCSock: PTCPSocket;
     fds: PSDLNet_SocketSet;
     isPonged: boolean;
+    SocketString: shortstring;
 
     headcmd: PCmd;
     lastcmd: PCmd;
@@ -71,14 +71,15 @@
 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 @@
 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 @@
     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 @@
                '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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 begin
 inc(SendEmptyPacketTicks, Lag);
 if (SendEmptyPacketTicks >= cSendEmptyPacketTime) then
-    SendIPC('+')
+    SendIPC(_S'+')
 end;
 
 procedure NetGetNextCmd;
@@ -307,28 +308,29 @@
         '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 @@
                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 @@
 
 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 @@
                 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 @@
             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 @@
 
 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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uInputHandler.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,440 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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: 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;
+
+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(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');
+
+// 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('grave')]:= '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.
--- a/hedgewars/uKeys.pas	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,516 +0,0 @@
-(*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@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.
--- a/hedgewars/uLand.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLand.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
+uses uConsole, uStore, uRandom, uLandObjects, uIO, uLandTexture, SysUtils,
+     uVariables, uUtils, uCommands, adler32, uDebug, uLandPainted, uTextures,
+     uLandGenMaze, uLandOutline;
 
-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 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;
+var digest: shortstring;
 
-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 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
+    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 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)
+    SetLength(Land, LAND_HEIGHT, LAND_WIDTH);
+    SetLength(LandDirty, (LAND_HEIGHT div 32), (LAND_WIDTH div 32));
     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;
-
-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 @@
     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 @@
     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 @@
             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 @@
                 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 @@
                 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 @@
 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;
+    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 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 @@
      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;
+    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;
 
-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;
-
-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 @@
     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 @@
         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 @@
     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 @@
                 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 @@
         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 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 @@
     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 @@
     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
                 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 @@
                     ((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;
@@ -1117,13 +415,11 @@
 
 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 +430,16 @@
     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 +452,22 @@
         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 +477,9 @@
     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 +493,40 @@
     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 +571,6 @@
     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 +596,7 @@
             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 +650,21 @@
         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 +674,8 @@
                 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 +685,41 @@
                 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 +730,13 @@
                 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 +754,7 @@
 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 +763,14 @@
 
 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 +778,14 @@
 
     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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uLandGenMaze.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -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.
--- a/hedgewars/uLandGraphics.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLandGraphics.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 @@
 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
         addBgColor:= NewColor;
         exit
-        end; 
+        end;
     // Get colors
     oRed   := (OldColor shr RShift);
     oGreen := (OldColor shr GShift);
@@ -69,7 +72,7 @@
     // 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 (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 @@
             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 @@
 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 @@
 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;
+    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;
+            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 @@
     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 @@
     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 @@
     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;
 
@@ -468,9 +502,9 @@
                     begin
                     by:= ty div 2; bx:= tx div 2;
                     end;
-                if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and not disableLandBack then
+                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 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 @@
     end;
 
 
-UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT)
+UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false)
 end;
 
 //
@@ -529,19 +563,19 @@
     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 @@
     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
@@ -588,7 +622,7 @@
                 begin
                 by:= ty div 2; bx:= tx div 2;
                 end;
-            if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and not disableLandBack then
+            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
                 LandPixels[by, bx]:= 0;
@@ -601,18 +635,18 @@
     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 @@
     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 @@
 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 @@
     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 @@
 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 @@
                                     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 @@
 // 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.
--- a/hedgewars/uLandObjects.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLandObjects.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 @@
     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 @@
 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 @@
 
 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 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);
+    CountNonZeroz:= lRes;
+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
-    lRes:= 0;
-    for i:= y to y + 15 do
-        if Land[i, x] <> 0 then inc(lRes);
-    CountNonZeroz:= lRes;
-    end;
-
 begin
 y:= topY+150;
 repeat
@@ -174,7 +180,8 @@
     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 @@
     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 @@
 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 @@
 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 @@
     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 @@
     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 @@
     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 @@
         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 @@
         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 @@
     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 @@
     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 @@
 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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
                     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 @@
         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 @@
             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 @@
         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 @@
         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 @@
             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 @@
 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 @@
 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 @@
 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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uLandOutline.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -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.
--- a/hedgewars/uLandPainted.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLandPainted.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 @@
 
 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 @@
         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 @@
 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
         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 @@
     pointsListHead:= nil;
     pointsListLast:= nil;
 
-    RegisterVariable('draw', vtCommand, @chDraw, false);
+    RegisterVariable('draw', @chDraw, false);
 end;
 
 procedure freeModule;
--- a/hedgewars/uLandTemplates.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLandTemplates.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
        );
       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 @@
        );
       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 @@
       );
       Template7FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 
@@ -264,7 +264,7 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
        );
       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 @@
        );
       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 @@
       );
       Template25FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 
@@ -896,7 +896,7 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
       );
       Template35FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 ///////////////////////// CAVERNS ///////////////////////////////////
@@ -1322,7 +1322,7 @@
       );
       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 @@
       );
       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 @@
       );
       Template38FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 // 8 tiny islands
@@ -1437,7 +1437,7 @@
       );
       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 @@
       );
       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 @@
       );
       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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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
 
--- a/hedgewars/uLandTexture.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLandTexture.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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 = 256;
+const TEXSIZE = 128;
 
 type TLandRecord = record
-            shouldUpdate: boolean;
+            shouldUpdate, landAdded: boolean;
             tex: PTexture;
             end;
 
@@ -62,10 +63,11 @@
 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 @@
     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 @@
 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,15 +200,22 @@
     SetLength(LandTextures, LANDTEXARW, LANDTEXARH);
 end;
 
+procedure initModule;
+begin
+end;
+
 procedure ResetLand;
 var x, y: LongInt;
 begin
-    for x:= 0 to LANDTEXARW -1 do
+    for x:= 0 to LANDTEXARW - 1 do
         for y:= 0 to LANDTEXARH - 1 do
             with LandTextures[x, y] do
                 begin
-                if tex <> nil then FreeTexture(tex);
-                tex:= nil;
+                if tex <> nil then
+                    begin
+                    FreeTexture(tex);
+                    tex:= nil
+                    end
                 end;
 end;
 
@@ -154,6 +225,6 @@
     if LandBackSurface <> nil then
         SDL_FreeSurface(LandBackSurface);
     LandBackSurface:= nil;
-    LandTextures:= nil;
+    SetLength(LandTextures, 0, 0);
 end;
 end.
--- a/hedgewars/uLocale.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uLocale.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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 @@
     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 @@
 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.
--- a/hedgewars/uMisc.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uMisc.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,20 +1,20 @@
 (*
-* Hedgewars, a free turn based strategy game
-* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@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@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 @@
 
 uses SDLh, uConsts, GLunit, uTypes;
 
-procedure movecursor(dx, dy: LongInt);
-function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
-function  MakeScreenshot(filename: shortstring): boolean;
-function  GetTeamStatString(p: PTeam): shortstring;
-
 procedure initModule;
 procedure freeModule;
 
+procedure movecursor(dx, dy: LongInt);
+function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
+function  MakeScreenshot(filename: shortstring; k: LongInt): boolean;
+function  GetTeamStatString(p: PTeam): shortstring;
+{$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 @@
 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,@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 @@
     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);
+image:= PScreenshot(screenshot);
 
-// memory could not be allocated
-if p = nil then
-begin
-    AddFileLog('Error: Could not allocate memory for screenshot.');
-    exit(false);
-end;
-
-// 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 @@
 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;
 
--- a/hedgewars/uMobile.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uMobile.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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}
-    exit(false);
+end;
+
+function getScreenDPI: Double; inline;
+begin
+{$IFDEF ANDROID}
+//    getScreenDPI:= Android_JNI_getDensity();
+    getScreenDPI:= 1;
+{$ELSE}
+    getScreenDPI:= 1;
+{$ENDIF}
 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 @@
 {$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}
--- a/hedgewars/uRandom.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uRandom.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
  *)
 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 @@
 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:= 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 @@
 rndSign:= num
 end;
 
-procedure initModule;
-begin
-    n:= 54;
-    FillChar(cirbuf, 64*sizeof(Longword), 0);
-end;
-
-procedure freeModule;
-begin
-
-end;
-
 end.
--- a/hedgewars/uRender.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uRender.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,51 +24,58 @@
 
 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);
 
-var
-    HHTexture: PTexture;
+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
@@ -106,12 +113,15 @@
 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
@@ -131,10 +141,10 @@
 
 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;
@@ -194,31 +204,32 @@
 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)
@@ -231,14 +242,15 @@
 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;
@@ -250,20 +262,31 @@
 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);
@@ -287,20 +310,10 @@
 dec(r.h, r.y);
 dec(r.w, r.x);
 
-DrawFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture)
+DrawTextureFromRect(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)
-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
@@ -395,10 +408,10 @@
 
 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
@@ -412,13 +425,14 @@
     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;
 
 
@@ -444,34 +458,78 @@
     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;
+    nc:= (a shl 24) or (b shl 16) or (g shl 8) or r;
 
-if nc = lastTint then
-    exit;
+    if nc = lastTint then
+        exit;
 
-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 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;
+    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.
--- a/hedgewars/uRenderUtils.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uRenderUtils.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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);
-function  RenderStringTex(s: ansistring; Color: Longword; font: THWFont): PTexture;
-function  RenderSpeechBubbleTex(s: ansistring; SpeechType: Longword; font: THWFont): PTexture;
+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;
+
 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 @@
     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): TSDL_Rect;
+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 @@
             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 @@
         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 @@
             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 @@
 
     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 @@
                 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
         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;
 
--- a/hedgewars/uScript.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uScript.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 ScriptLoad(name : shortstring);
 procedure ScriptOnGameInit;
-procedure ScriptOnScreenResize();
+procedure ScriptOnScreenResize;
 
 procedure ScriptCall(fname : shortstring);
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
@@ -46,21 +46,24 @@
 function ScriptExists(fname : shortstring) : boolean;
 
 
-function ParseCommandOverride(key, value : shortstring) : shortstring;
+//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,
@@ -77,7 +80,8 @@
     uTextures,
     uLandGraphics,
     SDLh,
-    sysutils; 
+    SysUtils, 
+    uIO;
 
 var luaState : Plua_State;
     ScriptAmmoLoadout : shortstring;
@@ -110,7 +114,8 @@
         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;
 
@@ -121,7 +126,8 @@
         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;
 
@@ -132,15 +138,29 @@
         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;
 
@@ -148,7 +168,8 @@
 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;
 
@@ -164,10 +185,19 @@
 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,@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!');
@@ -230,45 +260,51 @@
 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;
 
@@ -276,48 +312,65 @@
 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;
 
@@ -359,7 +412,8 @@
     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;
@@ -389,7 +443,8 @@
             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;
@@ -404,7 +459,8 @@
     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;
@@ -462,7 +518,8 @@
             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);
@@ -557,12 +614,79 @@
     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)
@@ -654,7 +778,7 @@
             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);
@@ -724,11 +848,11 @@
         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);
-            gear^.Hedgehog^.NameTagTex:= RenderStringTex(gear^.Hedgehog^.Name, gear^.Hedgehog^.Team^.Clan^.Color, fnt16);
+        FreeTexture(gear^.Hedgehog^.NameTagTex);
+        gear^.Hedgehog^.NameTagTex:= RenderStringTex(gear^.Hedgehog^.Name, gear^.Hedgehog^.Team^.Clan^.Color, fnt16);
 
         end;
     lc_sethogname:= 0;
@@ -850,8 +974,10 @@
    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
@@ -864,11 +990,13 @@
                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
@@ -886,21 +1014,21 @@
         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
@@ -912,19 +1040,19 @@
 
     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;
@@ -938,8 +1066,10 @@
         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
@@ -955,8 +1085,10 @@
         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
@@ -982,9 +1114,10 @@
             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;
@@ -1016,7 +1149,7 @@
     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;
@@ -1031,9 +1164,9 @@
         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;
@@ -1075,6 +1208,25 @@
     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
@@ -1116,11 +1268,14 @@
         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;
@@ -1151,11 +1306,11 @@
         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));
@@ -1174,8 +1329,8 @@
     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;
@@ -1238,10 +1393,12 @@
             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;
@@ -1293,6 +1450,7 @@
 
 function lc_getgearvelocity(L : Plua_State) : LongInt; Cdecl;
 var gear: PGear;
+var t: LongInt;
 begin
     if lua_gettop(L) <> 1 then
         begin
@@ -1305,7 +1463,10 @@
         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;
@@ -1337,8 +1498,10 @@
     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;
@@ -1368,6 +1531,22 @@
     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
@@ -1490,7 +1669,7 @@
         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
             hat:= lua_tostring(L, 2);
             gear^.Hedgehog^.Hat:= hat;
-            LoadHedgehogHat(gear, hat);
+            LoadHedgehogHat(gear^.Hedgehog^, hat);
         end;
     lc_sethoghat:= 0;
 end;
@@ -1516,6 +1695,68 @@
     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;
@@ -1556,52 +1797,54 @@
 
 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);
@@ -1610,6 +1853,7 @@
 ScriptSetInteger('HealthCaseProb', cHealthCaseProb);
 ScriptSetInteger('HealthCaseAmount', cHealthCaseAmount);
 ScriptSetInteger('DamagePercent', cDamagePercent);
+ScriptSetInteger('RopePercent', cRopePercent);
 ScriptSetInteger('MinesNum', cLandMines);
 ScriptSetInteger('MinesTime', cMinesTime);
 ScriptSetInteger('MineDudPercent', cMineDudPercent);
@@ -1619,15 +1863,17 @@
 ScriptSetInteger('SuddenDeathTurns', cSuddenDTurns);
 ScriptSetInteger('WaterRise', cWaterRise);
 ScriptSetInteger('HealthDecrease', cHealthDecrease);
-ScriptSetString('Map', '');
+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');
@@ -1635,6 +1881,7 @@
 cHealthCaseProb  := ScriptGetInteger('HealthCaseProb');
 cHealthCaseAmount:= ScriptGetInteger('HealthCaseAmount');
 cDamagePercent   := ScriptGetInteger('DamagePercent');
+cRopePercent     := ScriptGetInteger('RopePercent');
 cLandMines       := ScriptGetInteger('MinesNum');
 cMinesTime       := ScriptGetInteger('MinesTime');
 cMineDudPercent  := ScriptGetInteger('MineDudPercent');
@@ -1645,16 +1892,49 @@
 cWaterRise       := ScriptGetInteger('WaterRise');
 cHealthDecrease  := ScriptGetInteger('HealthDecrease');
 
-if ScriptGetString('Map') <> '' 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;
 
@@ -1677,8 +1957,10 @@
       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
@@ -1702,6 +1984,14 @@
 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
@@ -1715,7 +2005,7 @@
 
 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));
@@ -1727,10 +2017,12 @@
 GetGlobals;
 end;
 
+(*
 function ParseCommandOverride(key, value : shortstring) : shortstring;
 begin
 ParseCommandOverride:= value;
-if not ScriptExists('ParseCommandOverride') then exit;
+if not ScriptExists('ParseCommandOverride') then
+    exit;
 lua_getglobal(luaState, Str2PChar('ParseCommandOverride'));
 lua_pushstring(luaState, Str2PChar(key));
 lua_pushstring(luaState, Str2PChar(value));
@@ -1745,6 +2037,7 @@
     lua_pop(luaState, 1)
     end;
 end;
+*)
 
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
 begin
@@ -1763,7 +2056,7 @@
 
 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));
@@ -1800,9 +2093,6 @@
 procedure ScriptPrepareAmmoStore;
 var i: ShortInt;
 begin
-// reset ammostore (quite unclean, but works?)
-uAmmos.freeModule;
-uAmmos.initModule;
 ScriptAmmoLoadout:= '';
 ScriptAmmoDelay:= '';
 ScriptAmmoProbability:= '';
@@ -1828,23 +2118,57 @@
 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;
@@ -1866,9 +2190,7 @@
 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);
@@ -1962,86 +2284,97 @@
 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
@@ -2064,6 +2397,7 @@
 
 procedure ScriptLoad(name : shortstring);
 begin
+    name:= name; // avoid hint
 end;
 
 procedure ScriptOnGameInit;
@@ -2072,36 +2406,64 @@
 
 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
-ParseCommandOverride:= value
+    // avoid hints
+    key:= key;
+    value:= value;
+    ParseCommandOverride:= ''
+end;
+*)
+
+procedure ScriptOnScreenResize;
+begin
 end;
 
 procedure initModule;
--- a/hedgewars/uSinTable.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uSinTable.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
      $FFFF4E59,
      $FFFFB10B,
      $FFFFEC43,
-    $100000000
+     $100000000
      );
 
 implementation
--- a/hedgewars/uSound.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uSound.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,26 @@
  *                   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 initModule;
 procedure freeModule;
 
-procedure InitSound; // Initiates sound-system if isSoundEnabled.
-procedure ReleaseSound; // 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 +62,41 @@
 // 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 +109,17 @@
 
 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 +131,25 @@
         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,110 +167,93 @@
 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 MOBILE}
-    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;
-
-    Volume:= 0;
-    ChangeVolume(cInitVolume)
+    ChangeVolume(cInitVolume);	
 end;
 
-procedure ReleaseSound;
+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
+// in this way music is not stopped, nor are chucks currently being played
+procedure ReleaseSound(complete: boolean);
 var i: TSound;
     t: Longword;
 begin
+    // release and nil all sounds
     for t:= 0 to cMaxTeams do
         if voicepacks[t].name <> '' then
             for i:= Low(TSound) to High(TSound) do
                 if voicepacks[t].chunks[i] <> nil then
-                    Mix_FreeChunk(voicepacks[t].chunks[i]);
-
-    if Mus <> nil then
-        Mix_FreeMusic(Mus);
-
-    // make sure all instances of sdl_mixer are unloaded before continuing
-    while Mix_Init(0) <> 0 do
-        Mix_Quit();
-
-    Mix_CloseAudio();
-end;
-
-procedure SoundLoad;
-var i: TSound;
-    t: Longword;
-    s:shortstring;
-begin
-    if not isSoundEnabled then exit;
-
-    defVoicepack:= AskForVoicepack('Default');
+                    if complete or (Mix_Playing(lastChan[i]) = 0) then
+                        begin
+                        Mix_HaltChannel(lastChan[i]);
+                        lastChan[i]:= -1;
+                        Mix_FreeChunk(voicepacks[t].chunks[i]);
+                        voicepacks[t].chunks[i]:= nil;
+                        end;
 
-    for t:= 0 to cMaxTeams do
-        if voicepacks[t].name <> '' then
-            for i:= Low(TSound) to High(TSound) do
-                voicepacks[t].chunks[i]:= nil;
+    // stop music
+    if complete then
+        begin
+        if Mus <> nil then
+            begin
+            Mix_HaltMusic();
+            Mix_FreeMusic(Mus);
+            Mus:= nil;
+            end;
 
-    for i:= Low(TSound) to High(TSound) do
-    begin
-        defVoicepack^.chunks[i]:= nil;
-        // preload all the big sound files (>32k) that would otherwise lockup the game
-        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);
+        // make sure all instances of sdl_mixer are unloaded before continuing
+        while Mix_Init(0) <> 0 do
+            Mix_Quit();
+
+        Mix_CloseAudio();
         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
@@ -258,9 +267,10 @@
         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
@@ -273,10 +283,11 @@
         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)
@@ -286,12 +297,23 @@
 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;
+        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;
@@ -299,100 +321,107 @@
 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
+        begin
         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
-        begin
+           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
+        begin
         if (defVoicepack^.chunks[snd] = nil) and (Soundz[snd].Path <> ptVoices) and (Soundz[snd].FileName <> '') then
-        begin
+            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);
@@ -405,27 +434,91 @@
         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;
@@ -433,7 +526,8 @@
     if (MusicFN = '') or (not isMusicEnabled) then
         exit;
 
-    Mix_PauseMusic(Mus);
+    if Mus <> nil then
+        Mix_PauseMusic(Mus);
 end;
 
 procedure ResumeMusic;
@@ -441,39 +535,85 @@
     if (MusicFN = '') or (not isMusicEnabled) then
         exit;
 
-    Mix_ResumeMusic(Mus);
+    if Mus <> nil then
+        Mix_ResumeMusic(Mus);
 end;
 
-procedure ChangeMusic;
+procedure ChangeMusic(musicname: shortstring);
+begin
+    MusicFN:= musicname;
+    if (MusicFN = '') or (not isMusicEnabled) then
+        exit;
+
+    StopMusic;
+    PlayMusic;
+end;
+
+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 initModule;
+var t: LongInt;
+    i: TSound;
 begin
-    RegisterVariable('voicepack', vtCommand, @chVoicepack, false);
+    RegisterVariable('voicepack', @chVoicepack, false);
+    RegisterVariable('mute'     , @chMute     , true );
+
     MusicFN:='';
+    Mus:= nil;
+    isMusicEnabled:= true;
+    isSoundEnabled:= true;
+    isAudioMuted:= false;
+    isSEBackup:= isSoundEnabled;
+    Volume:= 0;
+    cInitVolume:= 100;
+    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;
 begin
     if isSoundEnabled then
-        ReleaseSound();
+        ReleaseSound(true);
 end;
 
 end.
--- a/hedgewars/uStats.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uStats.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
     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 @@
     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 @@
                 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 @@
 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 @@
     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 @@
         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 @@
     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 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 @@
 
 procedure freeModule;
 begin
-
 end;
 
 end.
--- a/hedgewars/uStore.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uStore.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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;
+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 ShowWeaponTooltip(x, y: LongInt);
 procedure FreeWeaponTooltip;
 procedure MakeCrossHairs;
+{$IFDEF USE_VIDEO_RECORDING}
+procedure InitOffscreenOpenGL;
+{$ENDIF}
+
+procedure WarpMouse(x, y: Word); inline;
+procedure SwapBuffers; inline;
 
 implementation
-uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands, uDebug;
+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 @@
 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_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 @@
 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,12 +123,13 @@
 
     // 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);
 
-    if CrosshairTex <> nil then FreeTexture(CrosshairTex);
+    FreeTexture(CrosshairTex);
     CrosshairTex:= Surface2Tex(texsurf, false);
     SDL_FreeSurface(texsurf)
     end;
@@ -118,23 +137,22 @@
 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 @@
         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 @@
         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';
+        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;
 
-        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);
+        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 @@
 
         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 @@
         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 LoadGraves;
-    var t: LongInt;
-        texsurf: PSDL_Surface;
-    begin
-    for t:= 0 to Pred(TeamsCount) do
+procedure InitHealth;
+var i, t: LongInt;
+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);
+            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
+    if TeamsArray[t] <> nil then
+        with TeamsArray[t]^ do
+            begin
+            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 @@
         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,11 +318,11 @@
             WriteLnToConsole(msgOK)
             end;
 
-WriteNames(fnt16);
 MakeCrossHairs;
 LoadGraves;
+if not reload then
+    AddProgress;
 
-AddProgress;
 for ii:= Low(TSprite) to High(TSprite) do
     with SpritesData[ii] do
         // FIXME - add a sprite attribute to match on rq flags?
@@ -288,35 +332,19 @@
            (((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, sprFireButton] 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
@@ -347,10 +375,13 @@
 // 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
@@ -358,10 +389,13 @@
                 Surface:= nil
         end;
 
-AddProgress;
+WriteNames(fnt16);
 
-tmpsurf:= LoadImage(UserPathz[ptGraphics] + '/' + cHHFileName, ifAlpha or ifTransparent);
-if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptGraphics] + '/' + cHHFileName, ifAlpha or ifCritical or ifTransparent);
+if not reload then
+    AddProgress;
+
+tmpsurf:= LoadDataImage(ptGraphics, cHHFileName, ifAlpha or ifCritical or ifTransparent);
+
 HHTexture:= Surface2Tex(tmpsurf, false);
 SDL_FreeSurface(tmpsurf);
 
@@ -371,82 +405,112 @@
 ConfirmTexture:= RenderStringTex(trmsg[sidConfirm], cYellowColor, fntBig);
 SyncTexture:= RenderStringTex(trmsg[sidSync], cYellowColor, fntBig);
 
-AddProgress;
+if not reload then
+    AddProgress;
 
 // name of weapons in ammo menu
 for ai:= Low(TAmmoType) to High(TAmmoType) do
     with Ammoz[ai] do
-    begin
+        begin
         TryDo(trAmmo[NameId] <> '','No default text/translation found for ammo type #' + intToStr(ord(ai)) + '!',true);
         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(trAmmo[NameId],fnt16)].Handle, Str2PChar(trAmmo[NameId]), cWhiteColorChannels);
         TryDo(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ai)) + ' failed!',true);
         tmpsurf:= doSurfaceConversion(tmpsurf);
-        if (NameTex <> nil) then
-            FreeTexture(NameTex);
+        FreeTexture(NameTex);
         NameTex:= Surface2Tex(tmpsurf, false);
         SDL_FreeSurface(tmpsurf)
-    end;
+        end;
 
 // 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);
-    if (CountTexz[i] <> nil) then
-        FreeTexture(CountTexz[i]);
+    FreeTexture(CountTexz[i]);
     CountTexz[i]:= Surface2Tex(tmpsurf, false);
     SDL_FreeSurface(tmpsurf)
+    end;
+
+if not reload then
+    AddProgress;
+IMG_Quit();
 end;
 
-AddProgress;
-IMG_Quit();
+{$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
+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(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);
-    FreeTexture(ropeIconTex);
-    ropeIconTex:= nil;
-    FreeTexture(HHTexture);
-    HHTexture:= nil;
-    FreeTexture(PauseTexture);
-    PauseTexture:= nil;
-    FreeTexture(ConfirmTexture);
-    ConfirmTexture:= nil;
-    FreeTexture(SyncTexture);
-    SyncTexture:= nil;
-    // free all ammo name textures
-    for ai:= Low(TAmmoType) to High(TAmmoType) do
-        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
-    begin
+        begin
         if TeamsArray[t] <> nil then
-        begin
+            begin
             FreeTexture(TeamsArray[t]^.NameTagTex);
             TeamsArray[t]^.NameTagTex:= nil;
             FreeTexture(TeamsArray[t]^.CrosshairTex);
@@ -460,26 +524,26 @@
             FreeTexture(TeamsArray[t]^.FlagTex);
             TeamsArray[t]^.FlagTex:= nil;
             for i:= 0 to cMaxHHIndex do
-            begin
+                begin
                 FreeTexture(TeamsArray[t]^.Hedgehogs[i].NameTagTex);
                 TeamsArray[t]^.Hedgehogs[i].NameTagTex:= nil;
                 FreeTexture(TeamsArray[t]^.Hedgehogs[i].HealthTagTex);
                 TeamsArray[t]^.Hedgehogs[i].HealthTagTex:= nil;
                 FreeTexture(TeamsArray[t]^.Hedgehogs[i].HatTex);
                 TeamsArray[t]^.Hedgehogs[i].HatTex:= nil;
+                end;
             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)
-    end
+        begin
+        DeleteFramebuffer(framel, depthl, texl);
+        DeleteFramebuffer(framer, depthr, texr);
+        end
 {$ENDIF}
 end;
 
@@ -487,33 +551,34 @@
 procedure RenderHealth(var Hedgehog: THedgehog);
 var s: shortstring;
 begin
-    str(Hedgehog.Gear^.Health, s);
-    if Hedgehog.HealthTagTex <> nil then
-        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);
@@ -526,20 +591,69 @@
     LoadImage:= tmpsurf //Result
 end;
 
-procedure LoadHedgehogHat(HHGear: PGear; newHat: shortstring);
+
+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
+    // 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:= LoadImage(UserPathz[ptHats] + '/' + newHat, ifNone);
-    if texsurf = nil then texsurf:= LoadImage(Pathz[ptHats] + '/' + newHat, ifNone);
-
+    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)
@@ -585,14 +699,23 @@
 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}
@@ -632,60 +755,84 @@
     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);
 
@@ -704,19 +851,19 @@
 
 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;
@@ -729,8 +876,7 @@
     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);
 
@@ -739,33 +885,32 @@
         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;
 
 procedure FinishProgress;
 begin
+    uMobile.GameLoaded();
     WriteLnToConsole('Freeing progress surface... ');
     FreeTexture(ProgrTex);
-    uMobile.GameLoaded();
+    ProgrTex:= nil;
     Step:= 0
 end;
 
@@ -778,8 +923,10 @@
     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);
@@ -788,8 +935,8 @@
 
 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
 
@@ -804,7 +951,8 @@
 // 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
@@ -816,7 +964,8 @@
     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;
@@ -825,7 +974,8 @@
     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;
 
@@ -844,9 +994,9 @@
 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;
@@ -857,21 +1007,21 @@
     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);
@@ -887,12 +1037,12 @@
     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;
@@ -905,7 +1055,7 @@
 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
@@ -920,7 +1070,7 @@
     end
 else
     begin
-    extra:= '';
+    extra:= _S'';
     extracolor:= 0;
     end;
 
@@ -938,52 +1088,100 @@
 procedure FreeWeaponTooltip;
 begin
 // free the existing texture (if there is any)
-if WeaponTooltipTex = nil then
-    exit;
 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();
+    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;
-{$ENDIF}
+        StoreRelease(true);
+        ResetLand;
+        ResetWorldTex;
+        //uTextures.freeModule; //DEBUG ONLY
+    {$ENDIF}
         AddFileLog('Freeing old primary surface...');
+    {$IFNDEF SDL13}        
         SDL_FreeSurface(SDLPrimSurface);
         SDLPrimSurface:= nil;
+    {$ENDIF}
+{$ENDIF}
         end;
-{$ENDIF}
 
     // these attributes must be set up before creating the sdl window
 {$IFNDEF WIN32}
@@ -997,20 +1195,21 @@
     // 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;
+    // 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;
 
-{$IFDEF MOBILE}
-    // make the sdl window appear on the second monitor when present
-    x:= x or (SDL_GetNumVideoDisplays() - 1);
-    y:= y or (SDL_GetNumVideoDisplays() - 1);
-
-    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;
@@ -1019,31 +1218,34 @@
 
     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}
 
     SetupOpenGL();
     if reinit then
         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);
 
-        StoreRelease(true);
+        // reload everything we had before
+        ReloadCaptions(false);
+        ReloadLines;
         StoreLoad(true);
-
-        ResetLand;
-
-        UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT)
+        // redraw all land
+        UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
         end;
 end;
 
@@ -1051,16 +1253,12 @@
 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
@@ -1070,10 +1268,43 @@
     // 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; inline;
+begin
+    if GameType = gmtRecord then
+        exit;
+{$IFDEF SDL13}
+    SDL_GL_SwapWindow(SDLwindow);
+{$ELSE}
+    SDL_GL_SwapBuffers();
+{$ENDIF}
 end;
 
 end.
--- a/hedgewars/uTeams.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uTeams.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 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 @@
         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 @@
         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 @@
            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 @@
         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 @@
 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 @@
             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 @@
                     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;
+    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;
+    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 @@
         Z:= cCurrHHZ;
         State:= gstHHDriven;
         Active:= true;
+        Power:= 0;
         LastDamage:= nil
         end;
     RemoveGearFromList(Gear);
@@ -218,34 +258,32 @@
     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 @@
         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 @@
     ReadyTimeLeft:= 0
     end;
 
-uMobile.NewTurnBeginning();
+{$IFDEF SDL13}
+uTouch.NewTurnBeginning();
+{$ENDIF}
 ScriptCall('onNewTurn');
 end;
 
@@ -292,22 +333,23 @@
 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 @@
         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 @@
 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 @@
         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 @@
                 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 @@
 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);
+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;
+    // 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;
 
-        AddTeam(Color);
-        CurrentTeam^.TeamName:= ts;
-        CurrentTeam^.PlayerHash:= s;
-        if GameType in [gmtDemo, gmtSave] then CurrentTeam^.ExtDriven:= true;
-
-        CurrentTeam^.voicepack:= AskForVoicepack('Default')
-        end
+    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 @@
 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
+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;
+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.
--- a/hedgewars/uTextures.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uTextures.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,7 +31,7 @@
 procedure freeModule;
 
 implementation
-uses GLunit, uUtils, uVariables, uConsts, uDebug;
+uses GLunit, uUtils, uVariables, uConsts, uDebug, uConsole;
 
 var TextureList: PTexture;
 
@@ -39,10 +39,10 @@
 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 @@
     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 @@
 
 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 @@
     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,16 +212,16 @@
 // if nil is passed nothing is done
 procedure FreeTexture(tex: PTexture);
 begin
-    if tex <> nil then
+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);
+    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;
 
@@ -226,7 +232,13 @@
 
 procedure freeModule;
 begin
-    while TextureList <> nil do FreeTexture(TextureList);
+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)));
+        FreeTexture(TextureList);
+        end
 end;
 
 end.
--- a/hedgewars/uTouch.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uTouch.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2012 Richard Deurwaarder <xeli@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
@@ -22,61 +22,54 @@
 
 interface
 
-uses sysutils, math, uConsole, uVariables, SDLh, uTypes, uFloat, uConsts, uIO, uCommands, GLUnit;
-
-// TODO: this type should be Int64
-// TODO: this type should be named TSDL_FingerId
-type SDL_FingerId = LongInt;
+uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, GLUnit, uTypes, uCaptions, uAmmos, uWorld, uMobile;
 
-type
-    PTouch_Finger = ^Touch_Finger;
-    Touch_Finger = record
-        id                       : SDL_FingerId;
-        x,y                      : LongInt;
-        historicalX, historicalY : LongInt;
-        timeSinceDown            : Longword;
-        end;
 
 procedure initModule;
+procedure freeModule;
 
 procedure ProcessTouch;
-procedure onTouchDown(x,y: Longword; pointerId: SDL_FingerId);
-procedure onTouchMotion(x,y: Longword; dx,dy: LongInt; pointerId: SDL_FingerId);
-procedure onTouchUp(x,y: Longword; pointerId: SDL_FingerId);
-function convertToCursor(scale: LongInt; xy: LongInt): LongInt;
-function addFinger(x,y: Longword; id: SDL_FingerId): PTouch_Finger;
-procedure deleteFinger(id: SDL_FingerId);
-procedure onTouchClick(finger: Touch_Finger);
-procedure onTouchDoubleClick(finger: Touch_Finger);
+procedure NewTurnBeginning;
 
-function findFinger(id: SDL_FingerId): PTouch_Finger;
-procedure aim(finger: Touch_Finger);
-function isOnCrosshair(finger: Touch_Finger): boolean;
-function isOnCurrentHog(finger: Touch_Finger): boolean;
-function isOnFireButton(finger: Touch_Finger): boolean;
-procedure convertToWorldCoord(var x,y: hwFloat; finger: Touch_Finger);
-procedure convertToFingerCoord(var x,y: hwFloat; oldX, oldY: hwFloat);
-function fingerHasMoved(finger: Touch_Finger): boolean;
-function calculateDelta(finger1, finger2: Touch_Finger): hwFloat;
-function getSecondFinger(finger: Touch_Finger): PTouch_Finger;
-procedure printFinger(finger: Touch_Finger);
+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(SDL_FingerId);
+    clickTime = 200;
+    nilFingerId = High(TSDL_FingerId);
+    baseRectSize = 96;
 
 var
-    fireButtonLeft, fireButtonRight, fireButtonTop, fireButtonBottom : LongInt;
-        
-
+    rectSize, halfRectSize: LongInt;
 
-    leftButtonBoundary  : LongInt;
-    rightButtonBoundary : LongInt;
-    topButtonBoundary   : LongInt;
-    
     pointerCount : Longword;
-    fingers: array of Touch_Finger;
+    fingers: array of TTouch_Data;
     moveCursor : boolean;
     invertCursor : boolean;
 
@@ -84,188 +77,275 @@
     timeSinceClick : Longword;
 
     //Pinch to zoom 
-    pinchSize : hwFloat;
+    pinchSize : LongInt;
     baseZoomValue: GLFloat;
 
-
     //aiming
-    aiming, movingCrosshair: boolean; 
-    crosshairCommand: ShortString;
+    aimingCrosshair: boolean;
+    aimingUp, aimingDown: boolean; 
     targetAngle: LongInt;
-    stopFiring: boolean;
+
+    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;
 
-    //moving
-    stopLeft, stopRight, walkingLeft, walkingRight :  boolean;
-
+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;
 
-procedure onTouchDown(x,y: Longword; pointerId: SDL_FingerId);
-var 
-    finger: PTouch_Finger;
-begin
-    finger := addFinger(x,y,pointerId);
+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:
-        begin
-            moveCursor:= false;
-            if bShowAmmoMenu then
-            begin
-                moveCursor := true;
-                exit;
-            end;
-
-            if isOnCrosshair(finger^) then
-            begin
-                aiming:= true;
-                exit;
-            end;
-
-            if isOnFireButton(finger^) then
-            begin
-                stopFiring:= false;
-                ParseCommand('+attack', true);
-                exit;
-            end;
-            if (finger^.x < leftButtonBoundary) and (finger^.y < 390) then
+            targetting:= not(targetted) and (CurrentHedgehog <> nil) and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0);
+        2:
             begin
-                ParseCommand('+left', true);
-                walkingLeft := true;
-                exit;
-            end;
-            if finger^.x > rightButtonBoundary then
-            begin
-                ParseCommand('+right', true);
-                walkingRight:= true;
-                exit;
-            end;
-            if finger^.y < topButtonBoundary then
-            begin
-                ParseCommand('hjump', true);
-                exit;
-            end;
-            moveCursor:= true; 
-        end;
-        2:
-        begin
-            aiming:= false;
-            stopFiring:= true;
             moveCursor:= false;
             pinchSize := calculateDelta(finger^, getSecondFinger(finger^)^);
             baseZoomValue := ZoomValue
+            end;
         end;
-    end;//end case pointerCount of
+    end;
+{$ENDIF}
 end;
 
-procedure onTouchMotion(x,y: Longword;dx,dy: LongInt; pointerId: SDL_FingerId);
+procedure onTouchMotion(x,y: Longword;dx,dy: LongInt; pointerId: TSDL_FingerId);
 var
-    finger, secondFinger: PTouch_Finger;
-    currentPinchDelta, zoom : hwFloat;
-    tmpX, tmpY: LongInt;
+    finger, secondFinger: PTouch_Data;
+    currentPinchDelta, zoom : single;
 begin
-    x := x;
-    y := y;
-    dx := dx;
-    dy := dy;
-    finger:= findFinger(pointerId);
-    tmpX := convertToCursor(cScreenWidth, x);
-    tmpY := convertToCursor(cScreenHeight, y);
+finger:= updateFinger(x,y,dx,dy,pointerId);
 
-    if moveCursor then
+if moveCursor then
     begin
         if invertCursor then
         begin
-            CursorPoint.X := CursorPoint.X + (finger^.x - tmpX);
-            CursorPoint.Y := CursorPoint.Y - (finger^.y - tmpY);
+            CursorPoint.X := CursorPoint.X - finger^.dx;
+            CursorPoint.Y := CursorPoint.Y + finger^.dy;
         end
-        else
+    else
         begin
-            CursorPoint.X := CursorPoint.X - (finger^.x - tmpX);
-            CursorPoint.Y := CursorPoint.Y + (finger^.y - tmpY);
+            CursorPoint.X := CursorPoint.X + finger^.dx;
+            CursorPoint.Y := CursorPoint.Y - finger^.dy;
         end;
-        finger^.x := tmpX;
-        finger^.y := tmpY;
         exit //todo change into switch rather than ugly ifs
     end;
     
-    finger^.x := tmpX;
-    finger^.y := tmpY;
-    
-    if aiming then 
+if aimingCrosshair then 
     begin
         aim(finger^);
         exit
     end;
-    if pointerCount = 2 then
+
+if (buttonsDown = 0) and (pointerCount = 2) then
     begin
        secondFinger := getSecondFinger(finger^);
        currentPinchDelta := calculateDelta(finger^, secondFinger^) - pinchSize;
        zoom := currentPinchDelta/cScreenWidth;
-       ZoomValue := baseZoomValue - ((hwFloat2Float(zoom) * cMinMaxZoomLevelDelta));
-       if ZoomValue < cMaxZoomLevel then ZoomValue := cMaxZoomLevel;
-       if ZoomValue > cMinZoomLevel then ZoomValue := cMinZoomLevel;
-    end;
-end;
-
-procedure onTouchUp(x,y: Longword; pointerId: SDL_FingerId);
-begin
-    x := x;
-    y := y;
-    aiming:= false;
-    stopFiring:= true;
-    deleteFinger(pointerId);
-
-    if walkingLeft then
-    begin
-        ParseCommand('-left', true);
-        walkingLeft := false;
+       ZoomValue := baseZoomValue - (zoom * cMinMaxZoomLevelDelta);
+       if ZoomValue < cMaxZoomLevel then
+           ZoomValue := cMaxZoomLevel;
+       if ZoomValue > cMinZoomLevel then
+           ZoomValue := cMinZoomLevel;
     end;
 
-    if walkingRight then
-    begin
-        ParseCommand('-right', true);
-        walkingRight := false;
-    end;
-end;
-
-procedure onTouchDoubleClick(finger: Touch_Finger);
-begin
-    finger := finger;//avoid compiler hint
-    ParseCommand('ljump', true);
 end;
 
-procedure onTouchClick(finger: Touch_Finger);
+procedure onTouchUp(x,y: Longword; pointerId: TSDL_FingerId);
+var
+    finger: PTouch_Data;
+    widget: POnScreenWidget;
 begin
-    if (SDL_GetTicks - timeSinceClick < 300) and (DistanceI(finger.X-xTouchClick, finger.Y-yTouchClick) < _30) then
+{$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
-    onTouchDoubleClick(finger);
-    exit; 
-    end
+    if (RealTicks - finger^.timeSinceDown) < clickTime then
+        onTouchClick(finger^)
     else
+            onTouchLongClick(finger^);
+    end;
+
+if aimingCrosshair then
     begin
-        xTouchClick := finger.x;
-        yTouchClick := finger.y;
-        timeSinceClick := SDL_GetTicks;
+    aimingCrosshair:= false;
+    ParseTeamCommand('-up');
+    ParseTeamCommand('-down');
+    dec(buttonsDown);
     end;
 
-    if bShowAmmoMenu then 
+widget:= finger^.pressedWidget;
+if (buttonsDown > 0) and (widget <> nil) then
     begin
-        doPut(CursorPoint.X, CursorPoint.Y, false); 
-        exit
+    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;
 
-    if isOnCurrentHog(finger) then
-    begin
-        bShowAmmoMenu := true;
-        exit;
+{$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;
 
-    if finger.y < topButtonBoundary then
+{$IFDEF USE_TOUCH_INTERFACE}
+if isOnCurrentHog(finger) or isOnWidget(AMWidget, finger) then
     begin
-        ParseCommand('hjump', true);
-        exit;
+    bShowAmmoMenu := true;
+    exit;
     end;
+
+if isOnWidget(jumpWidget, finger) then
+    begin
+    ParseTeamCommand('hjump');    
+    exit;
+    end;
+{$ENDIF}
 end;
 
-function addFinger(x,y: Longword; id: SDL_FingerId): PTouch_Finger;
+function addFinger(x,y: Longword; id: TSDL_FingerId): PTouch_Data;
 var 
     xCursor, yCursor, index : LongInt;
 begin
@@ -273,12 +353,13 @@
     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;
+        for index := length(fingers) div 2 to length(fingers) do
+            fingers[index].id := nilFingerId;
     end;
     
     
-    xCursor := convertToCursor(cScreenWidth, x);
-    yCursor := convertToCursor(cScreenHeight, y);
+    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
@@ -287,13 +368,26 @@
     fingers[pointerCount].historicalY := yCursor;
     fingers[pointerCount].x := xCursor;
     fingers[pointerCount].y := yCursor;
-    fingers[pointerCount].timeSinceDown:= SDL_GetTicks;
+    fingers[pointerCount].dx := 0;
+    fingers[pointerCount].dy := 0;
+    fingers[pointerCount].timeSinceDown:= RealTicks;
+    fingers[pointerCount].pressedWidget:= nil;
  
     addFinger:= @fingers[pointerCount];
     inc(pointerCount);
 end;
 
-procedure deleteFinger(id: SDL_FingerId);
+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
@@ -301,16 +395,13 @@
     dec(pointerCount);
     for index := 0 to pointerCount do
     begin
-         if fingers[index].id = id then
-         begin
-             //Check for onTouchClick event
-             if ((SDL_GetTicks - fingers[index].timeSinceDown) < clickTime) AND  
-                 not(fingerHasMoved(fingers[index])) then onTouchClick(fingers[index]);
-
-             //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
+        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;    
@@ -319,170 +410,221 @@
                 fingers[index].timeSinceDown := fingers[pointerCount].timeSinceDown;
 
                 fingers[pointerCount].id := nilFingerId;
-             end
-             else fingers[index].id := nilFingerId;
-             break;
-         end;
+            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);
-    if aiming then
-    begin
-        if CurrentHedgehog^.Gear <> nil then
+invertCursor := not(bShowAmmoMenu or targetting); 
+if aimingCrosshair then
+    if CurrentHedgehog^.Gear <> nil then
         begin
-            deltaAngle:= CurrentHedgehog^.Gear^.Angle - targetAngle;
-            if (deltaAngle <> 0) and not(movingCrosshair) then 
+        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
-                ParseCommand('+' + crosshairCommand, true);
-                movingCrosshair := true;
-            end
-            else 
-                if movingCrosshair then 
+            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
-                    ParseCommand('-' + crosshairCommand, true);
-                    movingCrosshair:= false;
-                end;
+                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
-    else if movingCrosshair then 
-    begin
-        ParseCommand('-' + crosshairCommand, true);
-        movingCrosshair := false;
-    end;
-
-    if stopFiring then 
-    begin
-        ParseCommand('-attack', true);
-        stopFiring:= false;
-    end;
-    
-    if stopRight then
-    begin
-        stopRight := false;
-        ParseCommand('-right', true);
-    end;
- 
-    if stopLeft then
-    begin
-        stopLeft := false;
-        ParseCommand('-left', true);
-    end;
-    
 end;
 
-function findFinger(id: SDL_FingerId): PTouch_Finger;
+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;
+    for index := 0 to High(fingers) do
+        if fingers[index].id = id then 
+            begin
+            findFinger := @fingers[index];
+            break;
+            end;
 end;
 
-procedure aim(finger: Touch_Finger);
+procedure aim(finger: TTouch_Data);
 var 
-    hogX, hogY, touchX, touchY, deltaX, deltaY, tmpAngle: hwFloat;
-    tmp: ShortString;
+    hogX, hogY, touchX, touchY, deltaX, deltaY: LongInt;
 begin
     if CurrentHedgehog^.Gear <> nil then
-    begin
-        touchX := _0;//avoid compiler hint
-        touchY := _0;
-        hogX := CurrentHedgehog^.Gear^.X;
-        hogY := CurrentHedgehog^.Gear^.Y;
+        begin
+        touchX := 0;//avoid compiler hint
+        touchY := 0;
+        hogX := hwRound(CurrentHedgehog^.Gear^.X);
+        hogY := hwRound(CurrentHedgehog^.Gear^.Y);
 
         convertToWorldCoord(touchX, touchY, finger);
-        deltaX := hwAbs(TouchX-HogX);
-        deltaY := (TouchY-HogY);
+        deltaX := abs(TouchX-HogX);
+        deltaY := TouchY-HogY;
         
-        tmpAngle:= DeltaY / Distance(deltaX, deltaY) *_2048;
-        targetAngle:= (hwRound(tmpAngle) + 2048) div 2;
+        targetAngle:= (Round(DeltaY / sqrt(sqr(deltaX) + sqr(deltaY)) * 2048) + 2048) div 2;
+        end; //if CurrentHedgehog^.Gear <> nil
+end;
 
-        tmp := crosshairCommand;
-        if CurrentHedgehog^.Gear^.Angle - targetAngle < 0 then crosshairCommand := 'down'
-        else crosshairCommand:= 'up';
-        if movingCrosshair and (tmp <> crosshairCommand) then 
-        begin
-            ParseCommand('-' + tmp, true);
-            movingCrosshair := false;
-        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;
 
-    end; //if CurrentHedgehog^.Gear <> nil
+function convertToCursorY(y: LongInt): LongInt;
+begin
+    convertToCursorY := cScreenHeight - round((y/32768)*cScreenHeight)
 end;
 
-function convertToCursor(scale: LongInt; xy: LongInt): LongInt;
+function convertToCursorDeltaX(x: LongInt): LongInt;
 begin
-    convertToCursor := round(xy/32768*scale)
+    convertToCursorDeltaX := round(x/32768*cScreenWidth)
+end;
+
+function convertToCursorDeltaY(y: LongInt): LongInt;
+begin
+    convertToCursorDeltaY := round(y/32768*cScreenHeight)
 end;
 
-function isOnFireButton(finger: Touch_Finger): boolean;
-begin
-    isOnFireButton:= (finger.x <= fireButtonRight) and (finger.x >= fireButtonLeft) and (finger.y <= fireButtonBottom) and (finger.y >= fireButtonTop);
-end;
-
-function isOnCrosshair(finger: Touch_Finger): boolean;
+function isOnCrosshair(finger: TTouch_Data): boolean;
 var
-    x,y : hwFloat;
+    x,y : LongInt;
 begin
-    x := _0;//avoid compiler hint
-    y := _0;
-    convertToFingerCoord(x, y, int2hwFloat(CrosshairX), int2hwFloat(CrosshairY));
-    isOnCrosshair:= Distance(int2hwFloat(finger.x)-x, int2hwFloat(finger.y)-y) < _50;
+    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: Touch_Finger): boolean;
+function isOnCurrentHog(finger: TTouch_Data): boolean;
 var
-    x,y : hwFloat;
+    x,y : LongInt;
 begin
-    x := _0;
-    y := _0;
-    convertToFingerCoord(x, y, CurrentHedgehog^.Gear^.X, CurrentHedgehog^.Gear^.Y);
-    isOnCurrentHog := Distance(int2hwFloat(finger.X)-x, int2hwFloat(finger.Y)-y) < _50;
+    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 : hwFloat; oldX, oldY: hwFloat);
+procedure convertToFingerCoord(var x,y : LongInt; oldX, oldY: LongInt);
 begin
-    x := oldX + int2hwFloat(WorldDx + (cScreenWidth div 2));
-    y := oldY + int2hwFloat(WorldDy);
+    x := oldX + WorldDx;
+    y := cScreenHeight - (oldY + WorldDy);
 end;
 
-procedure convertToWorldCoord(var x,y: hwFloat; finger: Touch_Finger);
+procedure convertToWorldCoord(var x,y: LongInt; finger: TTouch_Data);
 begin
 //if x <> nil then 
-    x := int2hwFloat((finger.x-WorldDx) - (cScreenWidth div 2));
+    x := finger.x-WorldDx;
 //if y <> nil then 
-    y := int2hwFloat(finger.y-WorldDy);
+    y := (cScreenHeight - finger.y)-WorldDy;
 end;
 
 //Method to calculate the distance this finger has moved since the downEvent
-function fingerHasMoved(finger: Touch_Finger): boolean;
+function fingerHasMoved(finger: TTouch_Data): boolean;
 begin
-    fingerHasMoved := trunc(sqrt(Power(finger.X-finger.historicalX,2) + Power(finger.y-finger.historicalY, 2))) > 330;
+    fingerHasMoved := trunc(sqrt(sqr(finger.X-finger.historicalX) + sqr(finger.y-finger.historicalY))) > 30;
 end;
 
-function calculateDelta(finger1, finger2: Touch_Finger): hwFloat; inline;
+function calculateDelta(finger1, finger2: TTouch_Data): LongInt; inline;
 begin
-    calculateDelta := DistanceI(finger2.x-finger1.x, finger2.y-finger1.y);
+    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;
 
-// Under the premise that all pointer ids in pointerIds:SDL_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: Touch_Finger): PTouch_Finger;
+function isOnRect(rect: TSDL_Rect; finger: TTouch_Data): boolean;
 begin
-    if fingers[0].id = finger.id then getSecondFinger := @fingers[1]
-    else getSecondFinger := @fingers[0];
+    isOnRect:= isOnRect(rect.x, rect.y, rect.w, rect.h, finger);
 end;
 
-procedure printFinger(finger: Touch_Finger);
+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;
@@ -492,25 +634,18 @@
     index: Longword;
     //uRenderCoordScaleX, uRenderCoordScaleY: Longword;
 begin
-    movingCrosshair := false;
-    stopFiring:= false;
-    walkingLeft := false;
-    walkingRight := false;
+    buttonsDown:= 0;
 
-    leftButtonBoundary := cScreenWidth div 4;
-    rightButtonBoundary := cScreenWidth div 4*3;
-    topButtonBoundary := cScreenHeight div 6;
-    
     setLength(fingers, 4);
     for index := 0 to High(fingers) do 
         fingers[index].id := nilFingerId;
 
+    rectSize:= round(baseRectSize * uMobile.getScreenDPI);
+    halfRectSize:= rectSize shl 1;
+end;
 
-    //uRenderCoordScaleX := Round(cScreenWidth/0.8 * 2);
-    fireButtonLeft := Round(cScreenWidth*0.01);
-    fireButtonRight := Round(fireButtonLeft + (spritesData[sprFireButton].Width*0.4));
-    fireButtonBottom := Round(cScreenHeight*0.99);
-    fireButtonTop := fireButtonBottom - Round(spritesData[sprFireButton].Height*0.4);
+procedure freeModule;
+begin
 end;
 
 begin
--- a/hedgewars/uTypes.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uTypes.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,7 +39,7 @@
     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,
@@ -51,20 +51,23 @@
             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,
@@ -83,22 +86,24 @@
             sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
             sprBulletHit, sprSnowball, sprHandSnowball, sprSnow,
             sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis,
-            sprFireButton
+            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,
@@ -109,8 +114,6 @@
             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);
 
@@ -148,7 +151,7 @@
             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);
@@ -172,7 +175,7 @@
             Handle: PTTF_Font;
             Height: LongInt;
             style: LongInt;
-            Name: string[21];
+            Name: string[31];
             end;
 
     PAmmo = ^TAmmo;
@@ -190,12 +193,12 @@
             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
@@ -207,7 +210,7 @@
             PrevTexture, NextTexture: PTexture;
             end;
 
-    THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected);
+    THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen);
 
     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
 
@@ -247,7 +250,8 @@
             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.
@@ -255,8 +259,12 @@
             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);
@@ -306,7 +314,7 @@
         TeamDamage : Longword;
         end;
 
-    TBinds = array[0..cKeyMaxIndex] of shortstring;
+    TBinds = array[0..cKbdMaxIndex] of shortstring;
     TKeyboardState = array[0..cKeyMaxIndex] of Byte;
 
     PVoicepack = ^TVoicepack;
@@ -320,11 +328,11 @@
         voicepack: PVoicePack;
         end;
 
+    THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo;
     PHHAmmo = ^THHAmmo;
-    THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo;
 
     THedgehog = record
-            Name: string[MAXNAMELEN];
+            Name: shortstring;
             Gear: PGear;
             GearHidden: PGear;
             SpeechGear: PVisualGear;
@@ -333,6 +341,8 @@
             HatTex: PTexture;
             Ammo: PHHAmmo;
             CurAmmoType: TAmmoType;
+            PickUpType: LongWord;
+            PickUpDelay: LongInt;
             AmmoStore: Longword;
             Team: PTeam;
             MultiShootAttacks: Longword;
@@ -345,12 +355,12 @@
             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;
@@ -397,29 +407,62 @@
             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
 
--- a/hedgewars/uUtils.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uUtils.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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  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(isGame: 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 @@
     end else b:= '';
 end;
 
+{$IFNDEF PAS2C}
 function EnumToStr(const en : TGearType) : shortstring; overload;
 begin
 EnumToStr:= GetEnumName(TypeInfo(TGearType), ord(en))
@@ -127,16 +150,22 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
     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 @@
 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 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 @@
        ((#$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 @@
 
 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 @@
 
 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,14 +389,41 @@
 CheckNoTeamOrHH:= (CurrentTeam = nil) or (CurrentHedgehog^.Gear = nil);
 end;
 
-procedure initModule;
-{$IFDEF DEBUGFILE}{$IFNDEF MOBILE}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(isGame: boolean);
+{$IFDEF DEBUGFILE}
+var logfileBase: shortstring;
+{$IFNDEF MOBILE}var i: LongInt;{$ENDIF}
+{$ENDIF}
 begin
 {$IFDEF DEBUGFILE}
+    if isGame then
+    begin
+        if GameType = gmtRecord then
+            logfileBase:= 'rec'
+        else
+            logfileBase:= 'game';
+    end
+    else
+        logfileBase:= 'preview';
+{$IFDEF USE_VIDEO_RECORDING}
+    InitCriticalSection(logMutex);
+{$ENDIF}
 {$I-}
 {$IFDEF MOBILE}
-    {$IFDEF IPHONEOS} Assign(f,'../Documents/hw-' + cLogfileBase + '.log'); {$ENDIF}
-    {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + cLogfileBase + '.log'); {$ENDIF}
+    {$IFDEF IPHONEOS} Assign(f,'../Documents/hw-' + logfileBase + '.log'); {$ENDIF}
+    {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + logfileBase + '.log'); {$ENDIF}
     Rewrite(f);
 {$ELSE}
     if (UserPathPrefix <> '') then
@@ -347,12 +431,14 @@
             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;
@@ -364,12 +450,15 @@
 
 procedure freeModule;
 begin
-    recordFileName:= '';
+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;
 
--- a/hedgewars/uVariables.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uVariables.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 
 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 @@
 
     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,6 @@
     bBetweenTurns   : boolean;
     bWaterRising    : boolean;
 
-    //ShowCrosshair   : boolean;  This variable is inconvenient to set.  Easier to decide when rendering
     CrosshairX      : LongInt;
     CrosshairY      : LongInt;
     CursorMovementX : LongInt;
@@ -152,7 +159,12 @@
     cLaserSighting  : boolean;
     cVampiric       : boolean;
     cArtillery      : boolean;
-    WeaponTooltipTex : PTexture;
+    WeaponTooltipTex: PTexture;
+    AmmoMenuTex     : PTexture;
+    AmmoMenuInvalidated: boolean;
+    AmmoRect		: TSDL_Rect;
+    HHTexture       : PTexture;
+
 
     flagMakeCapture : boolean;
 
@@ -162,7 +174,6 @@
 
     WaterColorArray : array[0..3] of HwColor4f;
     SDWaterColorArray : array[0..3] of HwColor4f;
-    SDMusic         : shortstring;
     SDTint          : LongInt;
 
     CursorPoint     : TPoint;
@@ -174,12 +185,6 @@
 
     Theme           : shortstring;
     disableLandBack : boolean;
-    conversionFormat: PSDL_PixelFormat;
-
-{$IFDEF SDL13}
-    SDLwindow       : PSDL_Window;
-    SDLGLcontext    : PSDL_GLContext;
-{$ENDIF}
 
     WorldDx: LongInt;
     WorldDy: LongInt;
@@ -187,19 +192,41 @@
     hiTicks: Word;
 
     LuaGoals        : shortstring;
+    hiddenHedgehogs : array [0..cMaxHHs] of PHedgehog;
+    hiddenHedgehogsNumber : longint;
 
-const
-    cHHFileName = 'Hedgehog';
-    cCHFileName = 'Crosshair';
-    cThemeCFGFilename = 'theme.cfg';
+    LuaTemplateNumber : LongWord;
+
+    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 );
 
-    FontBorder = 2;
+/////////////////////////////////////
+//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
@@ -219,20 +246,6 @@
         '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;
@@ -262,8 +275,9 @@
             {$ENDIF}
             );
 
+var
     SpritesData: array[TSprite] of record
-            FileName: String[16];
+            FileName: string[15];
             Path, AltPath: TPathType;
             Texture: PTexture;
             Surface: PSDL_Surface;
@@ -330,14 +344,12 @@
             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;
@@ -372,6 +384,28 @@
             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;
@@ -405,7 +439,7 @@
             (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;
@@ -432,8 +466,6 @@
             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;
@@ -581,13 +613,13 @@
             (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),
@@ -623,18 +655,30 @@
             Width:  80; Height: 50; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprSDSplash
             (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:  'Egg'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;//TODO change back 'Egg' to 'Tardis'
-            Width:  0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: true; getImageDimensions: true),// sprTardis
-            (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 450; Height: 150; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true) // sprFireButton
+            (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
+            (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 = (
@@ -648,7 +692,7 @@
             );
 
     Soundz: array[TSound] of record
-            FileName: String[25];
+            FileName: string[31];
             Path    : TPathType;
             end = (
             (FileName:                         ''; Path: ptNone  ),// sndNone
@@ -763,10 +807,10 @@
             (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:                'plane.ogg'; Path: ptSounds) // sndTardis TODO change when using a new data set
+            (FileName:                'plane.ogg'; Path: ptSounds),// sndPlane
+            (FileName:               'TARDIS.ogg'; Path: ptSounds) // sndTardis
             );
-
+var
     Ammoz: array [TAmmoType] of record
             NameId: TAmmoStrId;
             NameTex: PTexture;
@@ -809,7 +853,11 @@
             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;
@@ -833,7 +881,11 @@
             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;
@@ -857,7 +909,9 @@
             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;
@@ -881,7 +935,10 @@
             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;
@@ -905,7 +962,8 @@
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs;
+            Ammo: (Propz: ammoprop_ForwMsgs or
+                          ammoprop_NeedUpDown;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 1;
                 Timer: 0;
@@ -929,7 +987,10 @@
             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;
@@ -953,7 +1014,8 @@
             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;
@@ -981,7 +1043,8 @@
                           ammoprop_ForwMsgs or
                           ammoprop_AttackInMove or
                           ammoprop_Utility or
-                          ammoprop_AltAttack;
+                          ammoprop_AltAttack or
+                          ammoprop_NeedUpDown;
                     Count: 5;
                     NumPerTurn: 0;
                     Timer: 0;
@@ -1005,7 +1068,11 @@
             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;
@@ -1029,7 +1096,7 @@
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: 0;
+            Ammo: (Propz: ammoprop_NeedUpDown;
                 Count: 3;
                 NumPerTurn: 3;
                 Timer: 0;
@@ -1053,7 +1120,10 @@
             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;
@@ -1077,7 +1147,9 @@
             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;
@@ -1087,7 +1159,7 @@
                 Bounciness: 1000);
             Slot: 3;
             TimeAfterTurn: 3000;
-            MinAngle: 0;
+            minAngle: 0;
             maxAngle: 0;
             isDamaging: true;
             SkipTurns: 0;
@@ -1111,7 +1183,7 @@
                 Bounciness: 1000);
             Slot: 3;
             TimeAfterTurn: 3000;
-            MinAngle: 0;
+            minAngle: 0;
             maxAngle: 0;
             isDamaging: true;
             SkipTurns: 0;
@@ -1125,7 +1197,8 @@
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_DontHold or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1155,7 +1228,8 @@
                           ammoprop_NoCrosshair or
                           ammoprop_DontHold or
                           ammoprop_Utility or
-                          ammoprop_AltAttack;
+                          ammoprop_AltAttack or
+                          ammoprop_NeedUpDown;
                 Count: 2;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1180,10 +1254,10 @@
             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;
@@ -1208,10 +1282,10 @@
             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;
@@ -1235,7 +1309,8 @@
             NameTex: nil;
             Probability: 100;
             NumberInCase: 2;
-            Ammo: (Propz: ammoprop_ForwMsgs;
+            Ammo: (Propz: ammoprop_ForwMsgs or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1368,7 +1443,10 @@
             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;
@@ -1392,7 +1470,10 @@
             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;
@@ -1416,7 +1497,9 @@
             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;
@@ -1440,7 +1523,10 @@
             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;
@@ -1464,7 +1550,9 @@
             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;
@@ -1489,10 +1577,10 @@
             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;
@@ -1516,7 +1604,9 @@
             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;
@@ -1540,7 +1630,9 @@
             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;
@@ -1564,9 +1656,10 @@
             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;
@@ -1711,6 +1804,7 @@
                           ammoprop_DontHold or
                           ammoprop_AltUse or
                           ammoprop_Utility or
+                          ammoprop_NeedUpDown or
                           ammoprop_Effect;
                     Count: 1;
                     NumPerTurn: 0;
@@ -1764,7 +1858,9 @@
             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;
@@ -1794,6 +1890,7 @@
                           ammoprop_NoCrosshair or
                           ammoprop_DontHold or
                           ammoprop_Utility or
+                          ammoprop_NeedUpDown or
                           ammoprop_AltAttack;
                 Count: 1;
                 NumPerTurn: 0;
@@ -1818,7 +1915,9 @@
             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;
@@ -1844,6 +1943,7 @@
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_ForwMsgs or
                           ammoprop_NoCrosshair or
+                          ammoprop_NeedUpDown or
                           ammoprop_DontHold;
                 Count: 1;
                 NumPerTurn: 0;
@@ -1871,6 +1971,7 @@
             Ammo: (Propz: ammoprop_NoRoundEnd or
                           ammoprop_AttackInMove or
                           ammoprop_DontHold or
+                          ammoprop_NeedUpDown or
                           ammoprop_Utility;
                 Count: 1;
                 NumPerTurn: 3;
@@ -1923,7 +2024,11 @@
             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;
@@ -1947,7 +2052,8 @@
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: ammoprop_AttackInMove;
+            Ammo: (Propz: ammoprop_AttackInMove or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1971,7 +2077,9 @@
             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;
@@ -1995,7 +2103,9 @@
             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;
@@ -2029,7 +2139,7 @@
                 Bounciness: 1000);
             Slot: 3;
             TimeAfterTurn: 3000;
-            MinAngle: 0;
+            minAngle: 0;
             maxAngle: 0;
             isDamaging: true;
             SkipTurns: 0;
@@ -2196,26 +2306,78 @@
             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
@@ -2243,7 +2405,6 @@
 (*gtSniperRifleShot *) , amSniperRifle
 (*        gtJetpack *) , amJetpack
 (*        gtMolotov *) , amMolotov
-(*     gtExplosives *) , amNothing
 (*          gtBirdy *) , amBirdy
 (*            gtEgg *) , amBirdy
 (*         gtPortal *) , amPortalGun
@@ -2262,6 +2423,10 @@
 (*      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
@@ -2270,10 +2435,8 @@
     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;
@@ -2284,7 +2447,6 @@
     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;
@@ -2300,7 +2462,6 @@
     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;
@@ -2321,7 +2482,6 @@
     bAFRRight: Boolean;
 
 
-    SDLPrimSurface: PSDL_Surface;
     PauseTexture,
     SyncTexture,
     ConfirmTexture: PTexture;
@@ -2333,12 +2493,15 @@
     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;
@@ -2346,10 +2509,7 @@
     vobSDFrameTicks, vobSDFramesCount, vobSDCount: Longword;
     vobSDVelocity, vobSDFallSpeed: LongInt;
 
-
     hideAmmoMenu: boolean;
-    wheelUp: boolean;
-    wheelDown: boolean;
 
     ControllerNumControllers: Integer;
     ControllerEnabled: Integer;
@@ -2362,29 +2522,9 @@
     ControllerHats: array[0..5] of array[0..19] of Byte;
     ControllerButtons: array[0..5] of array[0..19] of Byte;
 
-    DefaultBinds, CurrentBinds: TBinds;
-
-    coeff: LongInt;
-
-{$IFDEF HWLIBRARY}
-    leftClick: boolean;
-    middleClick: boolean;
-    rightClick: boolean;
+    DefaultBinds : TBinds;
 
-    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
@@ -2400,6 +2540,32 @@
 
 procedure initModule;
 begin
+    // initialisation flags - they are going to be overwritten by args or by msgs
+    cScreenWidth    := 1024;
+    cScreenHeight   := 768;
+    cBits           := 32;
+    ipcPort         := 0;
+    cFullScreen     := false;
+    cLocaleFName    := 'en.txt';
+    cLocale         := 'en';
+    cTimerInterval  := 8;
+    PathPrefix      := './';
+    UserPathPrefix  := './';
+    cShowFPS        := false;
+    cFlattenFlakes  := false;
+    cFlattenClouds  := false;
+    cAltDamage      := true;
+    cReducedQuality := rqNone;
+    UserNick        := '';
+    recordFileName  := '';
+    cScriptName     := '';
+    cReadyDelay     := 5000;
+    cStereoMode     := smNone;
+    GrayScale       := false;
+
+    cFlattenFlakes  := false;
+    cFlattenClouds  := false;
+    cOnlyStats      := False;
     lastVisualGearByUID:= nil;
     lastGearByUID:= nil;
     
@@ -2434,9 +2600,10 @@
     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;
@@ -2452,6 +2619,7 @@
     CursorMovementX     := 0;
     CursorMovementY     := 0;
     GameTicks           := 0;
+    CheckSum            := 0;
     cWaterLine          := LAND_HEIGHT;
     cGearScrEdgesDist   := 240;
 
@@ -2485,7 +2653,6 @@
     cExplosives     := 2;
 
     GameState       := Low(TGameState);
-    GameType        := gmtLocal;
     zoom            := cDefaultZoomLevel;
     ZoomValue       := cDefaultZoomLevel;
     WeaponTooltipTex:= nil;
@@ -2496,14 +2663,13 @@
     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           := '';
@@ -2516,20 +2682,16 @@
 
     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;
@@ -2537,34 +2699,25 @@
     vobSDVelocity:= 15;
     vobSDFallSpeed:= 250;
 
+    cMinScreenWidth    := 640;
+    cMinScreenHeight   := 480;
+    cScreenWidth       := 1024;
+    cScreenHeight      := 768;
+    cOrigScreenWidth   := 1024;
+    cOrigScreenHeight  := 768;
+    cNewScreenWidth    := 1024;
+    cNewScreenHeight   := 768;
+    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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uVideoRec.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,382 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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
--- a/hedgewars/uVisualGears.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uVisualGears.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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 @@
 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 @@
             @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 @@
     vgtSmokeTrace,
     vgtEvilTrace,
     vgtNote,
-    vgtSmoothWindBar]) then exit;
+    vgtSmoothWindBar])) then
+    
+        exit;
 
 inc(VGCounter);
 New(gear);
@@ -149,10 +168,12 @@
 
 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 @@
                     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 @@
                 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 @@
                 //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,
@@ -401,15 +495,18 @@
 
 procedure DeleteVisualGear(Gear: PVisualGear);
 begin
-    if Gear^.Tex <> nil then
-        FreeTexture(Gear^.Tex);
+    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;
@@ -418,17 +515,18 @@
 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;
 
@@ -436,30 +534,33 @@
 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);
@@ -471,43 +572,44 @@
 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;
@@ -517,20 +619,23 @@
        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
@@ -538,17 +643,19 @@
                   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
@@ -556,7 +663,8 @@
                   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;
@@ -566,52 +674,59 @@
        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;
@@ -621,13 +736,14 @@
        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
@@ -647,7 +763,7 @@
                                  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
@@ -655,121 +771,129 @@
                                    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
+                            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
+                                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
-                                 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;
+        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;
 
@@ -778,7 +902,8 @@
     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;
@@ -791,11 +916,11 @@
     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
@@ -812,7 +937,8 @@
 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
@@ -829,13 +955,14 @@
 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;
 
@@ -843,8 +970,10 @@
 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];
@@ -858,16 +987,17 @@
         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;
@@ -875,6 +1005,7 @@
 procedure freeModule;
 var i: LongWord;
 begin
+VGCounter:= 0;
 for i:= 0 to 6 do
     while VisualGearLayers[i] <> nil do DeleteVisualGear(VisualGearLayers[i]);
 end;
--- a/hedgewars/uWorld.pas	Thu Nov 24 13:44:30 2011 +0100
+++ b/hedgewars/uWorld.pas	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@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,45 +21,55 @@
 
 unit uWorld;
 interface
-uses SDLh, uGears, uConsts, uFloat, uRandom, uTypes;
+uses SDLh, uGears, uConsts, uFloat, uRandom, uTypes, uRenderUtils;
 
 procedure initModule;
 procedure freeModule;
 
 procedure InitWorld;
+procedure ResetWorldTex;
+
 procedure DrawWorld(Lag: LongInt);
 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
 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;
@@ -71,6 +81,9 @@
     missionTex: PTexture;
     missionTimer: LongInt;
     stereoDepth: GLfloat;
+    isFirstFrame: boolean;
+    AMAnimType: LongInt;
+    recTexture: PTexture;
 
 const cStereo_Sky           = 0.0500;
       cStereo_Horizon       = 0.0250;
@@ -80,56 +93,59 @@
       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;
-
-    // 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 + format(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;
 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;
+    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?
@@ -172,7 +188,8 @@
     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;
@@ -182,29 +199,15 @@
 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;
@@ -212,173 +215,483 @@
 cGearScrEdgesDist:= min(2 * cScreenHeight div 5, 2 * cScreenWidth div 5);
 end;
 
-procedure ShowAmmoMenu;
-const MENUSPEED = 15;
-const BORDERSIZE = 2;
-var x, y, i, t, g: LongInt;
-    Slot, Pos, STurns: LongInt;
-    Ammo: PHHAmmo;
+procedure InitTouchInterface;
 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;
+{$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;
 
-    if bShowAmmoMenu then
-    // show ammo menu
-        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;
-        end
-    else
-    // hide ammo menu
+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
-        if AMxShift = 0 then
-            begin
-            CursorPoint.X:= cScreenWidth shr 1;
-            CursorPoint.Y:= cScreenHeight shr 1;
-            prevPoint:= CursorPoint;
-            end;
-        if (cReducedQuality and rqSlowMenu) <> 0 then AMxShift:= AMWidth+2
-        else
-            if AMxShift < (AMWidth - MENUSPEED) then inc(AMxShift, MENUSPEED)
-            else AMxShift:= AMWidth;
+        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;
 
-    // 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;
+// for uStore texture resetting
+procedure ResetWorldTex;
+begin
+    FreeTexture(fpsTexture);
+    fpsTexture:= nil;
+    FreeTexture(timeTexture);
+    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;
-    x:= (cScreenWidth shr 1) - AMWidth + AMxShift;
+    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}
 
-{$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);
 
+    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
-            if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i;
-            inc(SlotsNum);
-            DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
-            t:= 0;
-            g:= 0;
-            while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
+{$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
-                DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1);
-                if (Ammo^[i, t].AmmoType <> amNothing) then
+                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
+                    AMFrame:= LongInt(Ammo^[i,t].AmmoType) - 1;
+                    if STurns >= 0 then //weapon not usable yet, draw grayed out with turns remaining
                         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);
+                        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
-                        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
+                    else //draw colored version
                         begin
-                        if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
-                        Pos:= t;
+                        DrawSpriteFrame2Surf(sprAMAmmos, amSurface, x + AMSlotPadding, 
+                                                               y + AMSlotPadding, AMFrame);
                         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);
-            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;
 
-    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);
+procedure ShowAmmoMenu;
+const BORDERSIZE = 2;
+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;
+
+// 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;
+
+//Init the menu 
+if(AmmoMenuInvalidated) then 
+    begin
+    AmmoMenuInvalidated:= false;
+    FreeTexture(AmmoMenuTex);
+    AmmoMenuTex:= GetAmmoMenuTexture(Ammo);
+
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+    if isPhone() then
+        begin
+        AmmoRect.x:= -(AmmoRect.w shr 1);
+        AmmoRect.y:= (cScreenHeight shr 1) - (AmmoRect.h shr 1);
+        end
+    else
+        begin
+        AmmoRect.x:= -(AmmoRect.w shr 1);
+        AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
+        end;
 {$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);
+        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;
 
-    for i:= cMaxSlotIndex downto 0 do
+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
+            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;
+    end;
+    
+DrawTexture(AmmoRect.x + AMShiftX, AmmoRect.y + AMShiftY, AmmoMenuTex);
+
+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 - 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) - ( 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
-                        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 + (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 + 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);
+{$ELSE}
+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
+            inc(c);
+    {$IFDEF USE_AM_NUMCOLUMN}
+            g:= 1;
+    {$ELSE}
+            g:= 0;
+    {$ENDIF}
+            for t:=0 to cMaxSlotAmmoIndex do
+                if (Ammo^[i, t].Count > 0) and (Ammo^[i, t].AmmoType <> amNothing) then
+                    begin
+                    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
+                        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;
+            end;
 {$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
@@ -387,15 +700,13 @@
                 RenderWeaponTooltip(amSel)
                 end;
 
-{$IFDEF IPHONEOS}
-            DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, 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 - (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);
-            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
@@ -403,6 +714,23 @@
                 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
@@ -410,15 +738,19 @@
     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);
@@ -426,27 +758,27 @@
     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;
@@ -545,74 +877,72 @@
 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
-        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
+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;
-        lw:= SpritesData[sprL].Width * SpritesData[spr].Texture^.Scale;
-        lh:= SpritesData[sprL].Height * SpritesData[spr].Texture^.Scale;
-        if SpritesData[sprR].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
+        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
-            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
+            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;
@@ -622,7 +952,7 @@
     //glPushMatrix;
     //glScalef(1.0, 1.0, 1.0);
 
-    if not isPaused then
+    if (not isPaused) and (GameType <> gmtRecord) then
         MoveCamera;
 
     if cStereoMode = smNone then
@@ -653,7 +983,7 @@
         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);
 
@@ -748,8 +1078,10 @@
     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);
@@ -763,7 +1095,8 @@
     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);
@@ -772,15 +1105,15 @@
 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);
@@ -792,18 +1125,20 @@
 
         // 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); 
@@ -816,7 +1151,7 @@
         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);
@@ -825,6 +1160,209 @@
 
     DrawWater(255, 0);
 
+DrawVisualGears(1);
+DrawGears;
+DrawVisualGears(6);
+
+if SuddenDeathDmg then
+    DrawWater(SDWaterOpacity, 0)
+else
+    DrawWater(WaterOpacity, 0);
+
+    // Waves
+ChangeDepth(RM, cStereo_Water_near);
+DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 12);
+
+if (cReducedQuality and rq2DWater) = 0 then
+    begin
+    //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(SDWaterOpacity, - offsetY div 10)
+        else
+            DrawWater(WaterOpacity, - offsetY div 10);
+        ChangeDepth(RM, cStereo_Water_near);
+        DrawWaves( -1, 25 + WorldDx div 3, - cWaveHeight - offsetY div 10, 0);
+        end
+    else
+        DrawWaves(-1, 50, - (cWaveHeight shr 1), 0);
+
+// everything after this ChangeDepth will be drawn outside the screen
+// note: negative parallax gears should last very little for a smooth stereo effect
+    ChangeDepth(RM, cStereo_Outside);
+    DrawVisualGears(2);
+
+// everything after this ResetDepth will be drawn at screen level (depth = 0)
+// note: everything that needs to be readable should be on this level
+    ResetDepth(RM);
+    DrawVisualGears(3);
+
+{$WARNINGS OFF}
+// Target
+if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
+    begin
+    with PHedgehog(CurrentHedgehog)^ do
+        begin
+        if CurAmmoType = amBee then
+            DrawSpriteRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+        else
+            DrawSpriteRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+        end
+    end;
+{$WARNINGS ON}
+
+// this scale is used to keep the various widgets at the same dimension at all zoom levels
+SetScale(cDefaultZoomLevel);
+
+// Turn time
+{$IFDEF USE_TOUCH_INTERFACE}
+offsetX:= cScreenHeight - 13;
+{$ELSE}
+offsetX:= 48;
+{$ENDIF}
+offsetY:= cOffsetY;
+if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) then
+    begin
+    if ReadyTimeLeft <> 0 then
+        i:= Succ(Pred(ReadyTimeLeft) div 1000)
+    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;
+
+// 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);
+    end
+else smallScreenOffset:= 0;
+for t:= 0 to Pred(TeamsCount) do
+    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
+        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);
+    end;
+
 // Attack bar
     if CurrentTeam <> nil then
         case AttackBar of
@@ -847,175 +1385,13 @@
                 end
         end;
 
-    DrawVisualGears(1);
-    DrawGears;
-    DrawVisualGears(6);
-
-    if SuddenDeathDmg then
-        DrawWater(cSDWaterOpacity, 0)
-    else
-        DrawWater(cWaterOpacity, 0);
-
-    // Waves
-    ChangeDepth(RM, cStereo_Water_near);
-    DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 12);
-
-    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);
-        if SuddenDeathDmg then
-            DrawWater(cSDWaterOpacity, - offsetY div 10)
-        else
-            DrawWater(cWaterOpacity, - offsetY div 10);
-        ChangeDepth(RM, cStereo_Water_near);
-        DrawWaves( -1, 25 + WorldDx div 3, - cWaveHeight - offsetY div 10, 0);
-    end
-    else
-        DrawWaves(-1, 50, - (cWaveHeight shr 1), 0);
-
-// everything after this ChangeDepth will be drawn outside the screen
-// note: negative parallax gears should last very little for a smooth stereo effect
-    ChangeDepth(RM, cStereo_Outside);
-    DrawVisualGears(2);
-
-// everything after this ResetDepth will be drawn at screen level (depth = 0)
-// note: everything that needs to be readable should be on this level
-    ResetDepth(RM);
-    DrawVisualGears(3);
-
-{$WARNINGS OFF}
-// Target
-if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
-    begin
-    with PHedgehog(CurrentHedgehog)^ do
-        begin
-        if CurAmmoType = amBee then
-            DrawRotatedF(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)
-        end
-    end;
-{$WARNINGS ON}
-
-// this scale is used to keep the various widgets at the same dimension at all zoom levels
-SetScale(cDefaultZoomLevel);
-
-// Turn time
-{$IFDEF MOBILE}
-offsetX:= cScreenHeight - 13;
-{$ELSE}
-offsetX:= 48;
-{$ENDIF}
-offsetY:= cOffsetY;
-if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) then
-    begin
-    if ReadyTimeLeft <> 0 then
-        i:= Succ(Pred(ReadyTimeLeft) div 1000)
-    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;
-
-// Captions
-DrawCaptions;
-
-{$IFDEF ANDROID}
-// Draw buttons Related to the Touch interface
-DrawTexture(Round(-cScreenWidth*0.5 + cScreenHeight*0.02),Round((cScreenHeight*0.98)-(spritesData[sprFireButton].Height*0.4) ),spritesData[sprFireButton].Texture, 0.4);
-{$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);
-    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);
-
-         // 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;
-if smallScreenOffset <> 0 then
-    begin
-    SetScale(cDefaultZoomLevel);
-    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 MOBILE}
+{$IFDEF USE_TOUCH_INTERFACE}
     offsetX:= cScreenHeight - 13;
     offsetY:= (cScreenWidth shr 1) + 74;
 {$ELSE}
@@ -1024,7 +1400,7 @@
 {$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}
@@ -1032,7 +1408,7 @@
         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
@@ -1046,102 +1422,122 @@
         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 MOBILE}
-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;
    
-        if timeTexture <> nil then
-            FreeTexture(timeTexture);
-        timeTexture:= nil;
     
         tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), cWhiteColorChannels);
         tmpSurface:= doSurfaceConversion(tmpSurface);
+        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
+        begin
         if CountTicks >= 1000 then
-        begin
+            begin
             FPS:= Frames;
             Frames:= 0;
             CountTicks:= 0;
             s:= inttostr(FPS) + ' fps';
-            if fpsTexture <> nil then
-                FreeTexture(fpsTexture);
-            fpsTexture:= nil;
             tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), cWhiteColorChannels);
             tmpSurface:= doSurfaceConversion(tmpSurface);
+            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
@@ -1179,44 +1575,73 @@
 
         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);
 
 // 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 MOBILE}
-if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
+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;
@@ -1232,84 +1657,103 @@
         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 MOBILE}
-    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
+    begin
     if (not CurrentTeam^.ExtDriven) and (GameTicks >= PrevSentPointTime + cSendCursorPosTime) then
-    begin
+        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 isCursorVisible or ((FollowGear <> nil) and autoCameraOn) then
+    begin
     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
     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);
@@ -1318,11 +1762,10 @@
 r.w:= 32;
 r.h:= 32;
 
-if time = 0 then time:= 5000;
+if time = 0 then
+    time:= 5000;
 missionTimer:= time;
-if missionTex <> nil then
-    FreeTexture(missionTex);
-missionTex:= nil;
+FreeTexture(missionTex);
 
 if icon > -1 then
     begin
@@ -1345,12 +1788,13 @@
 
 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;
 
 
@@ -1358,12 +1802,76 @@
 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;
@@ -1372,6 +1880,7 @@
     Frames:= 0;
     WorldDx:= -512;
     WorldDy:= -256;
+    PrevSentPointTime:= 0;
 
     FPS:= 0;
     CountTicks:= 0;
@@ -1382,14 +1891,14 @@
     missionTex:= nil;
     cOffsetY:= 0;
     stereoDepth:= 0;
+    AMState:= AMHidden;
+    isFirstFrame:= true;
+    stereoDepth:= stereoDepth; // avoid hint
 end;
 
 procedure freeModule;
 begin
-    stereoDepth:= stereoDepth; // avoid hint
-    FreeTexture(fpsTexture);
-    FreeTexture(timeTexture);
-    FreeTexture(missionTex);
+    ResetWorldTex();
 end;
 
 end.
--- a/misc/hats_js_anim.xhtml	Thu Nov 24 13:44:30 2011 +0100
+++ b/misc/hats_js_anim.xhtml	Sun Oct 28 13:28:23 2012 +0100
@@ -10,7 +10,7 @@
 {
     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 @@
 /*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,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/default.mode1v3	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,1369 @@
+<?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>611E0B7211FA8F650077A41E</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>08FB77AEFE84172EC02AAC07</string>
+								<string>1C37FBAC04509CD000000102</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>586 569 788 504 0 0 1920 1178 </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>ftconfig.h</string>
+								<key>PBXSplitModuleInNavigatorKey</key>
+								<dict>
+									<key>Split0</key>
+									<dict>
+										<key>PBXProjectModuleGUID</key>
+										<string>1CE0B20406471E060097A5F4</string>
+										<key>PBXProjectModuleLabel</key>
+										<string>ftconfig.h</string>
+										<key>_historyCapacity</key>
+										<integer>0</integer>
+										<key>bookmark</key>
+										<string>619599D11364E6FE00B429B6</string>
+										<key>history</key>
+										<array>
+											<string>611E0E5811FA92660077A41E</string>
+											<string>619599AE1364E63300B429B6</string>
+											<string>619599C11364E6C400B429B6</string>
+										</array>
+									</dict>
+									<key>SplitCount</key>
+									<string>1</string>
+								</dict>
+								<key>StatusBarVisibility</key>
+								<true/>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 0}, {580, 211}}</string>
+								<key>RubberWindowFrame</key>
+								<string>586 569 788 504 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXNavigatorGroup</string>
+							<key>Proportion</key>
+							<string>211pt</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, 216}, {580, 247}}</string>
+								<key>RubberWindowFrame</key>
+								<string>586 569 788 504 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>XCDetailModule</string>
+							<key>Proportion</key>
+							<string>247pt</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>619599D21364E6FE00B429B6</string>
+				<string>1CE0B1FE06471DED0097A5F4</string>
+				<string>619599D31364E6FE00B429B6</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>611E0B7311FA8F650077A41E</string>
+		<string>/Users/vittorio/hedgewars/trunk/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj</string>
+	</array>
+	<key>WindowString</key>
+	<string>586 569 788 504 0 0 1920 1178 </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}, {1145, 432}}</string>
+								<key>RubberWindowFrame</key>
+								<string>1167 248 1145 714 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXNavigatorGroup</string>
+							<key>Proportion</key>
+							<string>432pt</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, 437}, {1145, 236}}</string>
+								<key>RubberWindowFrame</key>
+								<string>1167 248 1145 714 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXBuildResultsModule</string>
+							<key>Proportion</key>
+							<string>236pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>673pt</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>611E0B7311FA8F650077A41E</string>
+				<string>619599D41364E6FE00B429B6</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>1167 248 1145 714 0 0 1920 1178 </string>
+			<key>WindowToolGUID</key>
+			<string>611E0B7311FA8F650077A41E</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>&lt;No Editor&gt;</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>&lt;No Editor&gt;</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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/default.pbxuser	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,165 @@
+// !$*UTF8*$!
+{
+	0867D690FE84028FC02AAC07 /* Project object */ = {
+		activeBuildConfigurationName = Release;
+		activeSDKPreference = iphoneos4.2;
+		activeTarget = D2AAC07D0554694100DB518D /* libFreetype */;
+		addToTargets = (
+			D2AAC07D0554694100DB518D /* libFreetype */,
+		);
+		codeSenseManager = 611E0AC211FA8EB70077A41E /* 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,
+					43,
+					43,
+				);
+				PBXFileTableDataSourceColumnsKey = (
+					PBXFileDataSource_FiletypeID,
+					PBXFileDataSource_Filename_ColumnID,
+					PBXTargetDataSource_PrimaryAttribute,
+					PBXFileDataSource_Built_ColumnID,
+					PBXFileDataSource_ObjectSize_ColumnID,
+					PBXFileDataSource_Errors_ColumnID,
+					PBXFileDataSource_Warnings_ColumnID,
+				);
+			};
+			PBXPerProjectTemplateStateSaveDate = 325379832;
+			PBXWorkspaceStateSaveDate = 325379832;
+		};
+		perUserProjectItems = {
+			611E0E5811FA92660077A41E /* PBXTextBookmark */ = 611E0E5811FA92660077A41E /* PBXTextBookmark */;
+			619599AE1364E63300B429B6 /* PBXTextBookmark */ = 619599AE1364E63300B429B6 /* PBXTextBookmark */;
+			619599C11364E6C400B429B6 /* PBXTextBookmark */ = 619599C11364E6C400B429B6 /* PBXTextBookmark */;
+			619599D11364E6FE00B429B6 /* PBXTextBookmark */ = 619599D11364E6FE00B429B6 /* PBXTextBookmark */;
+		};
+		sourceControlManager = 611E0AC111FA8EB70077A41E /* Source Control */;
+		userBuildSettings = {
+		};
+	};
+	611E0AC111FA8EB70077A41E /* Source Control */ = {
+		isa = PBXSourceControlManager;
+		fallbackIsa = XCSourceControlManager;
+		isSCMEnabled = 0;
+		scmConfiguration = {
+			repositoryNamesForRoots = {
+				"" = "";
+			};
+		};
+	};
+	611E0AC211FA8EB70077A41E /* Code sense */ = {
+		isa = PBXCodeSenseManager;
+		indexTemplatePath = "";
+	};
+	611E0AC611FA8F610077A41E /* ftconfig.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {551, 8010}}";
+			sepNavSelRange = "{14485, 0}";
+			sepNavVisRange = "{14279, 398}";
+			sepNavWindowFrame = "{{1172, 58}, {1078, 737}}";
+		};
+	};
+	611E0AC811FA8F610077A41E /* ftmodule.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {530, 540}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 593}";
+			sepNavWindowFrame = "{{846, 195}, {1078, 737}}";
+		};
+	};
+	611E0B9D11FA8FA50077A41E /* ftbase.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1084, 540}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1416}";
+			sepNavWindowFrame = "{{130, 223}, {1081, 845}}";
+		};
+	};
+	611E0BB111FA8FA50077A41E /* ftoutln.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {551, 16755}}";
+			sepNavSelRange = "{4755, 0}";
+			sepNavVisRange = "{4575, 410}";
+		};
+	};
+	611E0CC111FA8FA50077A41E /* ttgload.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {829, 32040}}";
+			sepNavSelRange = "{52031, 0}";
+			sepNavVisRange = "{51255, 1537}";
+			sepNavWindowFrame = "{{130, 250}, {888, 818}}";
+		};
+	};
+	611E0E5811FA92660077A41E /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 611E0AC811FA8F610077A41E /* ftmodule.h */;
+		name = "ftmodule.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 593;
+		vrLoc = 0;
+	};
+	619599AE1364E63300B429B6 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 611E0BB111FA8FA50077A41E /* ftoutln.c */;
+		name = "ftoutln.c: 130";
+		rLen = 0;
+		rLoc = 4755;
+		rType = 0;
+		vrLen = 410;
+		vrLoc = 4575;
+	};
+	619599C11364E6C400B429B6 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 611E0AC611FA8F610077A41E /* ftconfig.h */;
+		name = "ftconfig.h: 351";
+		rLen = 0;
+		rLoc = 14485;
+		rType = 0;
+		vrLen = 398;
+		vrLoc = 14279;
+	};
+	619599D11364E6FE00B429B6 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 611E0AC611FA8F610077A41E /* ftconfig.h */;
+		name = "ftconfig.h: 351";
+		rLen = 0;
+		rLoc = 14485;
+		rType = 0;
+		vrLen = 398;
+		vrLoc = 14279;
+	};
+	D2AAC07D0554694100DB518D /* libFreetype */ = {
+		activeExec = 0;
+	};
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/project.pbxproj	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,1161 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 45;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		611E0B1C11FA8F610077A41E /* ftconfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC611FA8F610077A41E /* ftconfig.h */; };
+		611E0B1D11FA8F610077A41E /* ftheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC711FA8F610077A41E /* ftheader.h */; };
+		611E0B1E11FA8F610077A41E /* ftmodule.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC811FA8F610077A41E /* ftmodule.h */; };
+		611E0B1F11FA8F610077A41E /* ftoption.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC911FA8F610077A41E /* ftoption.h */; };
+		611E0B2011FA8F610077A41E /* ftstdlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACA11FA8F610077A41E /* ftstdlib.h */; };
+		611E0B2111FA8F610077A41E /* freetype.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACB11FA8F610077A41E /* freetype.h */; };
+		611E0B2211FA8F610077A41E /* ftadvanc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACC11FA8F610077A41E /* ftadvanc.h */; };
+		611E0B2311FA8F610077A41E /* ftbbox.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACD11FA8F610077A41E /* ftbbox.h */; };
+		611E0B2411FA8F610077A41E /* ftbdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACE11FA8F610077A41E /* ftbdf.h */; };
+		611E0B2511FA8F610077A41E /* ftbitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACF11FA8F610077A41E /* ftbitmap.h */; };
+		611E0B2611FA8F610077A41E /* ftcache.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD011FA8F610077A41E /* ftcache.h */; };
+		611E0B2711FA8F610077A41E /* ftchapters.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD111FA8F610077A41E /* ftchapters.h */; };
+		611E0B2811FA8F610077A41E /* ftcid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD211FA8F610077A41E /* ftcid.h */; };
+		611E0B2911FA8F610077A41E /* fterrdef.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD311FA8F610077A41E /* fterrdef.h */; };
+		611E0B2A11FA8F610077A41E /* fterrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD411FA8F610077A41E /* fterrors.h */; };
+		611E0B2B11FA8F610077A41E /* ftgasp.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD511FA8F610077A41E /* ftgasp.h */; };
+		611E0B2C11FA8F610077A41E /* ftglyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD611FA8F610077A41E /* ftglyph.h */; };
+		611E0B2D11FA8F610077A41E /* ftgxval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD711FA8F610077A41E /* ftgxval.h */; };
+		611E0B2E11FA8F610077A41E /* ftgzip.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD811FA8F610077A41E /* ftgzip.h */; };
+		611E0B2F11FA8F610077A41E /* ftimage.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD911FA8F610077A41E /* ftimage.h */; };
+		611E0B3011FA8F610077A41E /* ftincrem.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADA11FA8F610077A41E /* ftincrem.h */; };
+		611E0B3111FA8F610077A41E /* ftlcdfil.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADB11FA8F610077A41E /* ftlcdfil.h */; };
+		611E0B3211FA8F610077A41E /* ftlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADC11FA8F610077A41E /* ftlist.h */; };
+		611E0B3311FA8F610077A41E /* ftlzw.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADD11FA8F610077A41E /* ftlzw.h */; };
+		611E0B3411FA8F610077A41E /* ftmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADE11FA8F610077A41E /* ftmac.h */; };
+		611E0B3511FA8F610077A41E /* ftmm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADF11FA8F610077A41E /* ftmm.h */; };
+		611E0B3611FA8F610077A41E /* ftmodapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE011FA8F610077A41E /* ftmodapi.h */; };
+		611E0B3711FA8F610077A41E /* ftmoderr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE111FA8F610077A41E /* ftmoderr.h */; };
+		611E0B3811FA8F610077A41E /* ftotval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE211FA8F610077A41E /* ftotval.h */; };
+		611E0B3911FA8F610077A41E /* ftoutln.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE311FA8F610077A41E /* ftoutln.h */; };
+		611E0B3A11FA8F610077A41E /* ftpfr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE411FA8F610077A41E /* ftpfr.h */; };
+		611E0B3B11FA8F610077A41E /* ftrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE511FA8F610077A41E /* ftrender.h */; };
+		611E0B3C11FA8F610077A41E /* ftsizes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE611FA8F610077A41E /* ftsizes.h */; };
+		611E0B3D11FA8F610077A41E /* ftsnames.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE711FA8F610077A41E /* ftsnames.h */; };
+		611E0B3E11FA8F610077A41E /* ftstroke.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE811FA8F610077A41E /* ftstroke.h */; };
+		611E0B3F11FA8F610077A41E /* ftsynth.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE911FA8F610077A41E /* ftsynth.h */; };
+		611E0B4011FA8F610077A41E /* ftsystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEA11FA8F610077A41E /* ftsystem.h */; };
+		611E0B4111FA8F610077A41E /* fttrigon.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEB11FA8F610077A41E /* fttrigon.h */; };
+		611E0B4211FA8F610077A41E /* fttypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEC11FA8F610077A41E /* fttypes.h */; };
+		611E0B4311FA8F610077A41E /* ftwinfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AED11FA8F610077A41E /* ftwinfnt.h */; };
+		611E0B4411FA8F610077A41E /* ftxf86.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEE11FA8F610077A41E /* ftxf86.h */; };
+		611E0B4511FA8F610077A41E /* autohint.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF011FA8F610077A41E /* autohint.h */; };
+		611E0B4611FA8F610077A41E /* ftcalc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF111FA8F610077A41E /* ftcalc.h */; };
+		611E0B4711FA8F610077A41E /* ftdebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF211FA8F610077A41E /* ftdebug.h */; };
+		611E0B4811FA8F610077A41E /* ftdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF311FA8F610077A41E /* ftdriver.h */; };
+		611E0B4911FA8F610077A41E /* ftgloadr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF411FA8F610077A41E /* ftgloadr.h */; };
+		611E0B4A11FA8F610077A41E /* ftmemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF511FA8F610077A41E /* ftmemory.h */; };
+		611E0B4B11FA8F610077A41E /* ftobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF611FA8F610077A41E /* ftobjs.h */; };
+		611E0B4C11FA8F610077A41E /* ftpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF711FA8F610077A41E /* ftpic.h */; };
+		611E0B4D11FA8F610077A41E /* ftrfork.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF811FA8F610077A41E /* ftrfork.h */; };
+		611E0B4E11FA8F610077A41E /* ftserv.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF911FA8F610077A41E /* ftserv.h */; };
+		611E0B4F11FA8F610077A41E /* ftstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFA11FA8F610077A41E /* ftstream.h */; };
+		611E0B5011FA8F610077A41E /* fttrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFB11FA8F610077A41E /* fttrace.h */; };
+		611E0B5111FA8F610077A41E /* ftvalid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFC11FA8F610077A41E /* ftvalid.h */; };
+		611E0B5211FA8F610077A41E /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFD11FA8F610077A41E /* internal.h */; };
+		611E0B5311FA8F610077A41E /* pcftypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFE11FA8F610077A41E /* pcftypes.h */; };
+		611E0B5411FA8F610077A41E /* psaux.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFF11FA8F610077A41E /* psaux.h */; };
+		611E0B5511FA8F610077A41E /* pshints.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0011FA8F610077A41E /* pshints.h */; };
+		611E0B5611FA8F610077A41E /* svbdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0211FA8F610077A41E /* svbdf.h */; };
+		611E0B5711FA8F610077A41E /* svcid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0311FA8F610077A41E /* svcid.h */; };
+		611E0B5811FA8F610077A41E /* svgldict.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0411FA8F610077A41E /* svgldict.h */; };
+		611E0B5911FA8F610077A41E /* svgxval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0511FA8F610077A41E /* svgxval.h */; };
+		611E0B5A11FA8F610077A41E /* svkern.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0611FA8F610077A41E /* svkern.h */; };
+		611E0B5B11FA8F610077A41E /* svmm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0711FA8F610077A41E /* svmm.h */; };
+		611E0B5C11FA8F610077A41E /* svotval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0811FA8F610077A41E /* svotval.h */; };
+		611E0B5D11FA8F610077A41E /* svpfr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0911FA8F610077A41E /* svpfr.h */; };
+		611E0B5E11FA8F610077A41E /* svpostnm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0A11FA8F610077A41E /* svpostnm.h */; };
+		611E0B5F11FA8F610077A41E /* svpscmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0B11FA8F610077A41E /* svpscmap.h */; };
+		611E0B6011FA8F610077A41E /* svpsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0C11FA8F610077A41E /* svpsinfo.h */; };
+		611E0B6111FA8F610077A41E /* svsfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0D11FA8F610077A41E /* svsfnt.h */; };
+		611E0B6211FA8F610077A41E /* svttcmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0E11FA8F610077A41E /* svttcmap.h */; };
+		611E0B6311FA8F610077A41E /* svtteng.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0F11FA8F610077A41E /* svtteng.h */; };
+		611E0B6411FA8F610077A41E /* svttglyf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1011FA8F610077A41E /* svttglyf.h */; };
+		611E0B6511FA8F610077A41E /* svwinfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1111FA8F610077A41E /* svwinfnt.h */; };
+		611E0B6611FA8F610077A41E /* svxf86nm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1211FA8F610077A41E /* svxf86nm.h */; };
+		611E0B6711FA8F610077A41E /* sfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1311FA8F610077A41E /* sfnt.h */; };
+		611E0B6811FA8F610077A41E /* t1types.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1411FA8F610077A41E /* t1types.h */; };
+		611E0B6911FA8F610077A41E /* tttypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1511FA8F610077A41E /* tttypes.h */; };
+		611E0B6A11FA8F610077A41E /* t1tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1611FA8F610077A41E /* t1tables.h */; };
+		611E0B6B11FA8F610077A41E /* ttnameid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1711FA8F610077A41E /* ttnameid.h */; };
+		611E0B6C11FA8F610077A41E /* tttables.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1811FA8F610077A41E /* tttables.h */; };
+		611E0B6D11FA8F610077A41E /* tttags.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1911FA8F610077A41E /* tttags.h */; };
+		611E0B6E11FA8F610077A41E /* ttunpat.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1A11FA8F610077A41E /* ttunpat.h */; };
+		611E0B6F11FA8F610077A41E /* ft2build.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1B11FA8F610077A41E /* ft2build.h */; };
+		611E0D0611FA8FA50077A41E /* basepic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9911FA8FA50077A41E /* basepic.c */; };
+		611E0D0711FA8FA50077A41E /* basepic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B9A11FA8FA50077A41E /* basepic.h */; };
+		611E0D0811FA8FA50077A41E /* ftadvanc.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9B11FA8FA50077A41E /* ftadvanc.c */; };
+		611E0D0911FA8FA50077A41E /* ftapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9C11FA8FA50077A41E /* ftapi.c */; };
+		611E0D0A11FA8FA50077A41E /* ftbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9D11FA8FA50077A41E /* ftbase.c */; };
+		611E0D0B11FA8FA50077A41E /* ftbase.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B9E11FA8FA50077A41E /* ftbase.h */; };
+		611E0D0C11FA8FA50077A41E /* ftbbox.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9F11FA8FA50077A41E /* ftbbox.c */; };
+		611E0D0E11FA8FA50077A41E /* ftbitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA111FA8FA50077A41E /* ftbitmap.c */; };
+		611E0D0F11FA8FA50077A41E /* ftcalc.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA211FA8FA50077A41E /* ftcalc.c */; };
+		611E0D1111FA8FA50077A41E /* ftdbgmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA411FA8FA50077A41E /* ftdbgmem.c */; };
+		611E0D1211FA8FA50077A41E /* ftdebug.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA511FA8FA50077A41E /* ftdebug.c */; };
+		611E0D1511FA8FA50077A41E /* ftgloadr.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA811FA8FA50077A41E /* ftgloadr.c */; };
+		611E0D1611FA8FA50077A41E /* ftglyph.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA911FA8FA50077A41E /* ftglyph.c */; };
+		611E0D1811FA8FA50077A41E /* ftinit.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BAB11FA8FA50077A41E /* ftinit.c */; };
+		611E0D1C11FA8FA50077A41E /* ftobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BAF11FA8FA50077A41E /* ftobjs.c */; };
+		611E0D1E11FA8FA50077A41E /* ftoutln.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB111FA8FA50077A41E /* ftoutln.c */; };
+		611E0D2111FA8FA50077A41E /* ftpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB411FA8FA50077A41E /* ftpic.c */; };
+		611E0D2211FA8FA50077A41E /* ftrfork.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB511FA8FA50077A41E /* ftrfork.c */; };
+		611E0D2311FA8FA50077A41E /* ftsnames.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB611FA8FA50077A41E /* ftsnames.c */; };
+		611E0D2411FA8FA50077A41E /* ftstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB711FA8FA50077A41E /* ftstream.c */; };
+		611E0D2511FA8FA50077A41E /* ftstroke.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB811FA8FA50077A41E /* ftstroke.c */; };
+		611E0D2611FA8FA50077A41E /* ftsynth.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB911FA8FA50077A41E /* ftsynth.c */; };
+		611E0D2711FA8FA50077A41E /* ftsystem.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BBA11FA8FA50077A41E /* ftsystem.c */; };
+		611E0D2811FA8FA50077A41E /* fttrigon.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BBB11FA8FA50077A41E /* fttrigon.c */; };
+		611E0D2A11FA8FA50077A41E /* ftutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BBD11FA8FA50077A41E /* ftutil.c */; };
+		611E0D4411FA8FA50077A41E /* cff.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BDA11FA8FA50077A41E /* cff.c */; };
+		611E0D4511FA8FA50077A41E /* cffcmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BDB11FA8FA50077A41E /* cffcmap.c */; };
+		611E0D4611FA8FA50077A41E /* cffcmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BDC11FA8FA50077A41E /* cffcmap.h */; };
+		611E0D4711FA8FA50077A41E /* cffdrivr.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BDD11FA8FA50077A41E /* cffdrivr.c */; };
+		611E0D4811FA8FA50077A41E /* cffdrivr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BDE11FA8FA50077A41E /* cffdrivr.h */; };
+		611E0D4911FA8FA50077A41E /* cfferrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BDF11FA8FA50077A41E /* cfferrs.h */; };
+		611E0D4A11FA8FA50077A41E /* cffgload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE011FA8FA50077A41E /* cffgload.c */; };
+		611E0D4B11FA8FA50077A41E /* cffgload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE111FA8FA50077A41E /* cffgload.h */; };
+		611E0D4C11FA8FA50077A41E /* cffload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE211FA8FA50077A41E /* cffload.c */; };
+		611E0D4D11FA8FA50077A41E /* cffload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE311FA8FA50077A41E /* cffload.h */; };
+		611E0D4E11FA8FA50077A41E /* cffobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE411FA8FA50077A41E /* cffobjs.c */; };
+		611E0D4F11FA8FA50077A41E /* cffobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE511FA8FA50077A41E /* cffobjs.h */; };
+		611E0D5011FA8FA50077A41E /* cffparse.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE611FA8FA50077A41E /* cffparse.c */; };
+		611E0D5111FA8FA50077A41E /* cffparse.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE711FA8FA50077A41E /* cffparse.h */; };
+		611E0D5211FA8FA50077A41E /* cffpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE811FA8FA50077A41E /* cffpic.c */; };
+		611E0D5311FA8FA50077A41E /* cffpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE911FA8FA50077A41E /* cffpic.h */; };
+		611E0D5411FA8FA50077A41E /* cfftoken.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BEA11FA8FA50077A41E /* cfftoken.h */; };
+		611E0D5511FA8FA50077A41E /* cfftypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BEB11FA8FA50077A41E /* cfftypes.h */; };
+		611E0DC911FA8FA50077A41E /* pshalgo.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6811FA8FA50077A41E /* pshalgo.c */; };
+		611E0DCA11FA8FA50077A41E /* pshalgo.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6911FA8FA50077A41E /* pshalgo.h */; };
+		611E0DCB11FA8FA50077A41E /* pshglob.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6A11FA8FA50077A41E /* pshglob.c */; };
+		611E0DCC11FA8FA50077A41E /* pshglob.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6B11FA8FA50077A41E /* pshglob.h */; };
+		611E0DCD11FA8FA50077A41E /* pshinter.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6C11FA8FA50077A41E /* pshinter.c */; };
+		611E0DCE11FA8FA50077A41E /* pshmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6D11FA8FA50077A41E /* pshmod.c */; };
+		611E0DCF11FA8FA50077A41E /* pshmod.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6E11FA8FA50077A41E /* pshmod.h */; };
+		611E0DD011FA8FA50077A41E /* pshnterr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6F11FA8FA50077A41E /* pshnterr.h */; };
+		611E0DD111FA8FA50077A41E /* pshpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7011FA8FA50077A41E /* pshpic.c */; };
+		611E0DD211FA8FA50077A41E /* pshpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7111FA8FA50077A41E /* pshpic.h */; };
+		611E0DD311FA8FA50077A41E /* pshrec.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7211FA8FA50077A41E /* pshrec.c */; };
+		611E0DD411FA8FA50077A41E /* pshrec.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7311FA8FA50077A41E /* pshrec.h */; };
+		611E0DD511FA8FA50077A41E /* psmodule.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7511FA8FA50077A41E /* psmodule.c */; };
+		611E0DD611FA8FA50077A41E /* psmodule.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7611FA8FA50077A41E /* psmodule.h */; };
+		611E0DD711FA8FA50077A41E /* psnamerr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7711FA8FA50077A41E /* psnamerr.h */; };
+		611E0DD811FA8FA50077A41E /* psnames.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7811FA8FA50077A41E /* psnames.c */; };
+		611E0DD911FA8FA50077A41E /* pspic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7911FA8FA50077A41E /* pspic.c */; };
+		611E0DDA11FA8FA50077A41E /* pspic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7A11FA8FA50077A41E /* pspic.h */; };
+		611E0DDB11FA8FA50077A41E /* pstables.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7B11FA8FA50077A41E /* pstables.h */; };
+		611E0DDC11FA8FA50077A41E /* ftmisc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7D11FA8FA50077A41E /* ftmisc.h */; };
+		611E0DDD11FA8FA50077A41E /* ftraster.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7E11FA8FA50077A41E /* ftraster.c */; };
+		611E0DDE11FA8FA50077A41E /* ftraster.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7F11FA8FA50077A41E /* ftraster.h */; };
+		611E0DDF11FA8FA50077A41E /* ftrend1.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8011FA8FA50077A41E /* ftrend1.c */; };
+		611E0DE011FA8FA50077A41E /* ftrend1.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8111FA8FA50077A41E /* ftrend1.h */; };
+		611E0DE111FA8FA50077A41E /* raster.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8211FA8FA50077A41E /* raster.c */; };
+		611E0DE211FA8FA50077A41E /* rasterrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8311FA8FA50077A41E /* rasterrs.h */; };
+		611E0DE311FA8FA50077A41E /* rastpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8411FA8FA50077A41E /* rastpic.c */; };
+		611E0DE411FA8FA50077A41E /* rastpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8511FA8FA50077A41E /* rastpic.h */; };
+		611E0DE511FA8FA50077A41E /* sfdriver.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8711FA8FA50077A41E /* sfdriver.c */; };
+		611E0DE611FA8FA50077A41E /* sfdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8811FA8FA50077A41E /* sfdriver.h */; };
+		611E0DE711FA8FA50077A41E /* sferrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8911FA8FA50077A41E /* sferrors.h */; };
+		611E0DE811FA8FA50077A41E /* sfnt.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8A11FA8FA50077A41E /* sfnt.c */; };
+		611E0DE911FA8FA50077A41E /* sfntpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8B11FA8FA50077A41E /* sfntpic.c */; };
+		611E0DEA11FA8FA50077A41E /* sfntpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8C11FA8FA50077A41E /* sfntpic.h */; };
+		611E0DEB11FA8FA50077A41E /* sfobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8D11FA8FA50077A41E /* sfobjs.c */; };
+		611E0DEC11FA8FA50077A41E /* sfobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8E11FA8FA50077A41E /* sfobjs.h */; };
+		611E0DED11FA8FA50077A41E /* ttbdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8F11FA8FA50077A41E /* ttbdf.c */; };
+		611E0DEE11FA8FA50077A41E /* ttbdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9011FA8FA50077A41E /* ttbdf.h */; };
+		611E0DEF11FA8FA50077A41E /* ttcmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9111FA8FA50077A41E /* ttcmap.c */; };
+		611E0DF011FA8FA50077A41E /* ttcmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9211FA8FA50077A41E /* ttcmap.h */; };
+		611E0DF111FA8FA50077A41E /* ttcmapc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9311FA8FA50077A41E /* ttcmapc.h */; };
+		611E0DF211FA8FA50077A41E /* ttkern.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9411FA8FA50077A41E /* ttkern.c */; };
+		611E0DF311FA8FA50077A41E /* ttkern.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9511FA8FA50077A41E /* ttkern.h */; };
+		611E0DF411FA8FA50077A41E /* ttload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9611FA8FA50077A41E /* ttload.c */; };
+		611E0DF511FA8FA50077A41E /* ttload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9711FA8FA50077A41E /* ttload.h */; };
+		611E0DF611FA8FA50077A41E /* ttmtx.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9811FA8FA50077A41E /* ttmtx.c */; };
+		611E0DF711FA8FA50077A41E /* ttmtx.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9911FA8FA50077A41E /* ttmtx.h */; };
+		611E0DF811FA8FA50077A41E /* ttpost.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9A11FA8FA50077A41E /* ttpost.c */; };
+		611E0DF911FA8FA50077A41E /* ttpost.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9B11FA8FA50077A41E /* ttpost.h */; };
+		611E0DFA11FA8FA50077A41E /* ttsbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9C11FA8FA50077A41E /* ttsbit.c */; };
+		611E0DFB11FA8FA50077A41E /* ttsbit.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9D11FA8FA50077A41E /* ttsbit.h */; };
+		611E0DFC11FA8FA50077A41E /* ttsbit0.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9E11FA8FA50077A41E /* ttsbit0.c */; };
+		611E0DFD11FA8FA50077A41E /* ftgrays.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA011FA8FA50077A41E /* ftgrays.c */; };
+		611E0DFE11FA8FA50077A41E /* ftgrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA111FA8FA50077A41E /* ftgrays.h */; };
+		611E0DFF11FA8FA50077A41E /* ftsmerrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA211FA8FA50077A41E /* ftsmerrs.h */; };
+		611E0E0011FA8FA50077A41E /* ftsmooth.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA311FA8FA50077A41E /* ftsmooth.c */; };
+		611E0E0111FA8FA50077A41E /* ftsmooth.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA411FA8FA50077A41E /* ftsmooth.h */; };
+		611E0E0211FA8FA50077A41E /* ftspic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA511FA8FA50077A41E /* ftspic.c */; };
+		611E0E0311FA8FA50077A41E /* ftspic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA611FA8FA50077A41E /* ftspic.h */; };
+		611E0E0411FA8FA50077A41E /* smooth.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA711FA8FA50077A41E /* smooth.c */; };
+		611E0E0B11FA8FA50077A41E /* truetype.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CBD11FA8FA50077A41E /* truetype.c */; };
+		611E0E0C11FA8FA50077A41E /* ttdriver.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CBE11FA8FA50077A41E /* ttdriver.c */; };
+		611E0E0D11FA8FA50077A41E /* ttdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CBF11FA8FA50077A41E /* ttdriver.h */; };
+		611E0E0E11FA8FA50077A41E /* tterrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC011FA8FA50077A41E /* tterrors.h */; };
+		611E0E0F11FA8FA50077A41E /* ttgload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC111FA8FA50077A41E /* ttgload.c */; };
+		611E0E1011FA8FA50077A41E /* ttgload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC211FA8FA50077A41E /* ttgload.h */; };
+		611E0E1111FA8FA50077A41E /* ttgxvar.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC311FA8FA50077A41E /* ttgxvar.c */; };
+		611E0E1211FA8FA50077A41E /* ttgxvar.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC411FA8FA50077A41E /* ttgxvar.h */; };
+		611E0E1311FA8FA50077A41E /* ttinterp.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC511FA8FA50077A41E /* ttinterp.c */; };
+		611E0E1411FA8FA50077A41E /* ttinterp.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC611FA8FA50077A41E /* ttinterp.h */; };
+		611E0E1511FA8FA50077A41E /* ttobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC711FA8FA50077A41E /* ttobjs.c */; };
+		611E0E1611FA8FA50077A41E /* ttobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC811FA8FA50077A41E /* ttobjs.h */; };
+		611E0E1711FA8FA50077A41E /* ttpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC911FA8FA50077A41E /* ttpic.c */; };
+		611E0E1811FA8FA50077A41E /* ttpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CCA11FA8FA50077A41E /* ttpic.h */; };
+		611E0E1911FA8FA50077A41E /* ttpload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CCB11FA8FA50077A41E /* ttpload.c */; };
+		611E0E1A11FA8FA50077A41E /* ttpload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CCC11FA8FA50077A41E /* ttpload.h */; };
+		AA747D9F0F9514B9006C5449 /* freetype_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* freetype_Prefix.pch */; };
+		AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		611E0AC611FA8F610077A41E /* ftconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftconfig.h; sourceTree = "<group>"; };
+		611E0AC711FA8F610077A41E /* ftheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftheader.h; sourceTree = "<group>"; };
+		611E0AC811FA8F610077A41E /* ftmodule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmodule.h; sourceTree = "<group>"; };
+		611E0AC911FA8F610077A41E /* ftoption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftoption.h; sourceTree = "<group>"; };
+		611E0ACA11FA8F610077A41E /* ftstdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftstdlib.h; sourceTree = "<group>"; };
+		611E0ACB11FA8F610077A41E /* freetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = freetype.h; sourceTree = "<group>"; };
+		611E0ACC11FA8F610077A41E /* ftadvanc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftadvanc.h; sourceTree = "<group>"; };
+		611E0ACD11FA8F610077A41E /* ftbbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbbox.h; sourceTree = "<group>"; };
+		611E0ACE11FA8F610077A41E /* ftbdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbdf.h; sourceTree = "<group>"; };
+		611E0ACF11FA8F610077A41E /* ftbitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbitmap.h; sourceTree = "<group>"; };
+		611E0AD011FA8F610077A41E /* ftcache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftcache.h; sourceTree = "<group>"; };
+		611E0AD111FA8F610077A41E /* ftchapters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftchapters.h; sourceTree = "<group>"; };
+		611E0AD211FA8F610077A41E /* ftcid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftcid.h; sourceTree = "<group>"; };
+		611E0AD311FA8F610077A41E /* fterrdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fterrdef.h; sourceTree = "<group>"; };
+		611E0AD411FA8F610077A41E /* fterrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fterrors.h; sourceTree = "<group>"; };
+		611E0AD511FA8F610077A41E /* ftgasp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgasp.h; sourceTree = "<group>"; };
+		611E0AD611FA8F610077A41E /* ftglyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftglyph.h; sourceTree = "<group>"; };
+		611E0AD711FA8F610077A41E /* ftgxval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgxval.h; sourceTree = "<group>"; };
+		611E0AD811FA8F610077A41E /* ftgzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgzip.h; sourceTree = "<group>"; };
+		611E0AD911FA8F610077A41E /* ftimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftimage.h; sourceTree = "<group>"; };
+		611E0ADA11FA8F610077A41E /* ftincrem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftincrem.h; sourceTree = "<group>"; };
+		611E0ADB11FA8F610077A41E /* ftlcdfil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftlcdfil.h; sourceTree = "<group>"; };
+		611E0ADC11FA8F610077A41E /* ftlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftlist.h; sourceTree = "<group>"; };
+		611E0ADD11FA8F610077A41E /* ftlzw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftlzw.h; sourceTree = "<group>"; };
+		611E0ADE11FA8F610077A41E /* ftmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmac.h; sourceTree = "<group>"; };
+		611E0ADF11FA8F610077A41E /* ftmm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmm.h; sourceTree = "<group>"; };
+		611E0AE011FA8F610077A41E /* ftmodapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmodapi.h; sourceTree = "<group>"; };
+		611E0AE111FA8F610077A41E /* ftmoderr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmoderr.h; sourceTree = "<group>"; };
+		611E0AE211FA8F610077A41E /* ftotval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftotval.h; sourceTree = "<group>"; };
+		611E0AE311FA8F610077A41E /* ftoutln.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftoutln.h; sourceTree = "<group>"; };
+		611E0AE411FA8F610077A41E /* ftpfr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftpfr.h; sourceTree = "<group>"; };
+		611E0AE511FA8F610077A41E /* ftrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftrender.h; sourceTree = "<group>"; };
+		611E0AE611FA8F610077A41E /* ftsizes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsizes.h; sourceTree = "<group>"; };
+		611E0AE711FA8F610077A41E /* ftsnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsnames.h; sourceTree = "<group>"; };
+		611E0AE811FA8F610077A41E /* ftstroke.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftstroke.h; sourceTree = "<group>"; };
+		611E0AE911FA8F610077A41E /* ftsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsynth.h; sourceTree = "<group>"; };
+		611E0AEA11FA8F610077A41E /* ftsystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsystem.h; sourceTree = "<group>"; };
+		611E0AEB11FA8F610077A41E /* fttrigon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fttrigon.h; sourceTree = "<group>"; };
+		611E0AEC11FA8F610077A41E /* fttypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fttypes.h; sourceTree = "<group>"; };
+		611E0AED11FA8F610077A41E /* ftwinfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftwinfnt.h; sourceTree = "<group>"; };
+		611E0AEE11FA8F610077A41E /* ftxf86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftxf86.h; sourceTree = "<group>"; };
+		611E0AF011FA8F610077A41E /* autohint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autohint.h; sourceTree = "<group>"; };
+		611E0AF111FA8F610077A41E /* ftcalc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftcalc.h; sourceTree = "<group>"; };
+		611E0AF211FA8F610077A41E /* ftdebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftdebug.h; sourceTree = "<group>"; };
+		611E0AF311FA8F610077A41E /* ftdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftdriver.h; sourceTree = "<group>"; };
+		611E0AF411FA8F610077A41E /* ftgloadr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgloadr.h; sourceTree = "<group>"; };
+		611E0AF511FA8F610077A41E /* ftmemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmemory.h; sourceTree = "<group>"; };
+		611E0AF611FA8F610077A41E /* ftobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftobjs.h; sourceTree = "<group>"; };
+		611E0AF711FA8F610077A41E /* ftpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftpic.h; sourceTree = "<group>"; };
+		611E0AF811FA8F610077A41E /* ftrfork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftrfork.h; sourceTree = "<group>"; };
+		611E0AF911FA8F610077A41E /* ftserv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftserv.h; sourceTree = "<group>"; };
+		611E0AFA11FA8F610077A41E /* ftstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftstream.h; sourceTree = "<group>"; };
+		611E0AFB11FA8F610077A41E /* fttrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fttrace.h; sourceTree = "<group>"; };
+		611E0AFC11FA8F610077A41E /* ftvalid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftvalid.h; sourceTree = "<group>"; };
+		611E0AFD11FA8F610077A41E /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
+		611E0AFE11FA8F610077A41E /* pcftypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pcftypes.h; sourceTree = "<group>"; };
+		611E0AFF11FA8F610077A41E /* psaux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psaux.h; sourceTree = "<group>"; };
+		611E0B0011FA8F610077A41E /* pshints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshints.h; sourceTree = "<group>"; };
+		611E0B0211FA8F610077A41E /* svbdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svbdf.h; sourceTree = "<group>"; };
+		611E0B0311FA8F610077A41E /* svcid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svcid.h; sourceTree = "<group>"; };
+		611E0B0411FA8F610077A41E /* svgldict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svgldict.h; sourceTree = "<group>"; };
+		611E0B0511FA8F610077A41E /* svgxval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svgxval.h; sourceTree = "<group>"; };
+		611E0B0611FA8F610077A41E /* svkern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svkern.h; sourceTree = "<group>"; };
+		611E0B0711FA8F610077A41E /* svmm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svmm.h; sourceTree = "<group>"; };
+		611E0B0811FA8F610077A41E /* svotval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svotval.h; sourceTree = "<group>"; };
+		611E0B0911FA8F610077A41E /* svpfr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpfr.h; sourceTree = "<group>"; };
+		611E0B0A11FA8F610077A41E /* svpostnm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpostnm.h; sourceTree = "<group>"; };
+		611E0B0B11FA8F610077A41E /* svpscmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpscmap.h; sourceTree = "<group>"; };
+		611E0B0C11FA8F610077A41E /* svpsinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpsinfo.h; sourceTree = "<group>"; };
+		611E0B0D11FA8F610077A41E /* svsfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svsfnt.h; sourceTree = "<group>"; };
+		611E0B0E11FA8F610077A41E /* svttcmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svttcmap.h; sourceTree = "<group>"; };
+		611E0B0F11FA8F610077A41E /* svtteng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svtteng.h; sourceTree = "<group>"; };
+		611E0B1011FA8F610077A41E /* svttglyf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svttglyf.h; sourceTree = "<group>"; };
+		611E0B1111FA8F610077A41E /* svwinfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svwinfnt.h; sourceTree = "<group>"; };
+		611E0B1211FA8F610077A41E /* svxf86nm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svxf86nm.h; sourceTree = "<group>"; };
+		611E0B1311FA8F610077A41E /* sfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfnt.h; sourceTree = "<group>"; };
+		611E0B1411FA8F610077A41E /* t1types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = t1types.h; sourceTree = "<group>"; };
+		611E0B1511FA8F610077A41E /* tttypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tttypes.h; sourceTree = "<group>"; };
+		611E0B1611FA8F610077A41E /* t1tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = t1tables.h; sourceTree = "<group>"; };
+		611E0B1711FA8F610077A41E /* ttnameid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttnameid.h; sourceTree = "<group>"; };
+		611E0B1811FA8F610077A41E /* tttables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tttables.h; sourceTree = "<group>"; };
+		611E0B1911FA8F610077A41E /* tttags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tttags.h; sourceTree = "<group>"; };
+		611E0B1A11FA8F610077A41E /* ttunpat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttunpat.h; sourceTree = "<group>"; };
+		611E0B1B11FA8F610077A41E /* ft2build.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ft2build.h; path = ../include/ft2build.h; sourceTree = SOURCE_ROOT; };
+		611E0B9911FA8FA50077A41E /* basepic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = basepic.c; sourceTree = "<group>"; };
+		611E0B9A11FA8FA50077A41E /* basepic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basepic.h; sourceTree = "<group>"; };
+		611E0B9B11FA8FA50077A41E /* ftadvanc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftadvanc.c; sourceTree = "<group>"; };
+		611E0B9C11FA8FA50077A41E /* ftapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftapi.c; sourceTree = "<group>"; };
+		611E0B9D11FA8FA50077A41E /* ftbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftbase.c; sourceTree = "<group>"; };
+		611E0B9E11FA8FA50077A41E /* ftbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbase.h; sourceTree = "<group>"; };
+		611E0B9F11FA8FA50077A41E /* ftbbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftbbox.c; sourceTree = "<group>"; };
+		611E0BA111FA8FA50077A41E /* ftbitmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftbitmap.c; sourceTree = "<group>"; };
+		611E0BA211FA8FA50077A41E /* ftcalc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftcalc.c; sourceTree = "<group>"; };
+		611E0BA411FA8FA50077A41E /* ftdbgmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftdbgmem.c; sourceTree = "<group>"; };
+		611E0BA511FA8FA50077A41E /* ftdebug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftdebug.c; sourceTree = "<group>"; };
+		611E0BA811FA8FA50077A41E /* ftgloadr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftgloadr.c; sourceTree = "<group>"; };
+		611E0BA911FA8FA50077A41E /* ftglyph.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftglyph.c; sourceTree = "<group>"; };
+		611E0BAB11FA8FA50077A41E /* ftinit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftinit.c; sourceTree = "<group>"; };
+		611E0BAF11FA8FA50077A41E /* ftobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftobjs.c; sourceTree = "<group>"; };
+		611E0BB111FA8FA50077A41E /* ftoutln.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftoutln.c; sourceTree = "<group>"; };
+		611E0BB411FA8FA50077A41E /* ftpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftpic.c; sourceTree = "<group>"; };
+		611E0BB511FA8FA50077A41E /* ftrfork.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftrfork.c; sourceTree = "<group>"; };
+		611E0BB611FA8FA50077A41E /* ftsnames.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsnames.c; sourceTree = "<group>"; };
+		611E0BB711FA8FA50077A41E /* ftstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftstream.c; sourceTree = "<group>"; };
+		611E0BB811FA8FA50077A41E /* ftstroke.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftstroke.c; sourceTree = "<group>"; };
+		611E0BB911FA8FA50077A41E /* ftsynth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsynth.c; sourceTree = "<group>"; };
+		611E0BBA11FA8FA50077A41E /* ftsystem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsystem.c; sourceTree = "<group>"; };
+		611E0BBB11FA8FA50077A41E /* fttrigon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fttrigon.c; sourceTree = "<group>"; };
+		611E0BBD11FA8FA50077A41E /* ftutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftutil.c; sourceTree = "<group>"; };
+		611E0BDA11FA8FA50077A41E /* cff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cff.c; sourceTree = "<group>"; };
+		611E0BDB11FA8FA50077A41E /* cffcmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffcmap.c; sourceTree = "<group>"; };
+		611E0BDC11FA8FA50077A41E /* cffcmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffcmap.h; sourceTree = "<group>"; };
+		611E0BDD11FA8FA50077A41E /* cffdrivr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffdrivr.c; sourceTree = "<group>"; };
+		611E0BDE11FA8FA50077A41E /* cffdrivr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffdrivr.h; sourceTree = "<group>"; };
+		611E0BDF11FA8FA50077A41E /* cfferrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfferrs.h; sourceTree = "<group>"; };
+		611E0BE011FA8FA50077A41E /* cffgload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffgload.c; sourceTree = "<group>"; };
+		611E0BE111FA8FA50077A41E /* cffgload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffgload.h; sourceTree = "<group>"; };
+		611E0BE211FA8FA50077A41E /* cffload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffload.c; sourceTree = "<group>"; };
+		611E0BE311FA8FA50077A41E /* cffload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffload.h; sourceTree = "<group>"; };
+		611E0BE411FA8FA50077A41E /* cffobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffobjs.c; sourceTree = "<group>"; };
+		611E0BE511FA8FA50077A41E /* cffobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffobjs.h; sourceTree = "<group>"; };
+		611E0BE611FA8FA50077A41E /* cffparse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffparse.c; sourceTree = "<group>"; };
+		611E0BE711FA8FA50077A41E /* cffparse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffparse.h; sourceTree = "<group>"; };
+		611E0BE811FA8FA50077A41E /* cffpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffpic.c; sourceTree = "<group>"; };
+		611E0BE911FA8FA50077A41E /* cffpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffpic.h; sourceTree = "<group>"; };
+		611E0BEA11FA8FA50077A41E /* cfftoken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfftoken.h; sourceTree = "<group>"; };
+		611E0BEB11FA8FA50077A41E /* cfftypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfftypes.h; sourceTree = "<group>"; };
+		611E0C6811FA8FA50077A41E /* pshalgo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshalgo.c; sourceTree = "<group>"; };
+		611E0C6911FA8FA50077A41E /* pshalgo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshalgo.h; sourceTree = "<group>"; };
+		611E0C6A11FA8FA50077A41E /* pshglob.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshglob.c; sourceTree = "<group>"; };
+		611E0C6B11FA8FA50077A41E /* pshglob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshglob.h; sourceTree = "<group>"; };
+		611E0C6C11FA8FA50077A41E /* pshinter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshinter.c; sourceTree = "<group>"; };
+		611E0C6D11FA8FA50077A41E /* pshmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshmod.c; sourceTree = "<group>"; };
+		611E0C6E11FA8FA50077A41E /* pshmod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshmod.h; sourceTree = "<group>"; };
+		611E0C6F11FA8FA50077A41E /* pshnterr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshnterr.h; sourceTree = "<group>"; };
+		611E0C7011FA8FA50077A41E /* pshpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshpic.c; sourceTree = "<group>"; };
+		611E0C7111FA8FA50077A41E /* pshpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshpic.h; sourceTree = "<group>"; };
+		611E0C7211FA8FA50077A41E /* pshrec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshrec.c; sourceTree = "<group>"; };
+		611E0C7311FA8FA50077A41E /* pshrec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshrec.h; sourceTree = "<group>"; };
+		611E0C7511FA8FA50077A41E /* psmodule.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psmodule.c; sourceTree = "<group>"; };
+		611E0C7611FA8FA50077A41E /* psmodule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psmodule.h; sourceTree = "<group>"; };
+		611E0C7711FA8FA50077A41E /* psnamerr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psnamerr.h; sourceTree = "<group>"; };
+		611E0C7811FA8FA50077A41E /* psnames.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psnames.c; sourceTree = "<group>"; };
+		611E0C7911FA8FA50077A41E /* pspic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pspic.c; sourceTree = "<group>"; };
+		611E0C7A11FA8FA50077A41E /* pspic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pspic.h; sourceTree = "<group>"; };
+		611E0C7B11FA8FA50077A41E /* pstables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pstables.h; sourceTree = "<group>"; };
+		611E0C7D11FA8FA50077A41E /* ftmisc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmisc.h; sourceTree = "<group>"; };
+		611E0C7E11FA8FA50077A41E /* ftraster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftraster.c; sourceTree = "<group>"; };
+		611E0C7F11FA8FA50077A41E /* ftraster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftraster.h; sourceTree = "<group>"; };
+		611E0C8011FA8FA50077A41E /* ftrend1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftrend1.c; sourceTree = "<group>"; };
+		611E0C8111FA8FA50077A41E /* ftrend1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftrend1.h; sourceTree = "<group>"; };
+		611E0C8211FA8FA50077A41E /* raster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raster.c; sourceTree = "<group>"; };
+		611E0C8311FA8FA50077A41E /* rasterrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rasterrs.h; sourceTree = "<group>"; };
+		611E0C8411FA8FA50077A41E /* rastpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rastpic.c; sourceTree = "<group>"; };
+		611E0C8511FA8FA50077A41E /* rastpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rastpic.h; sourceTree = "<group>"; };
+		611E0C8711FA8FA50077A41E /* sfdriver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfdriver.c; sourceTree = "<group>"; };
+		611E0C8811FA8FA50077A41E /* sfdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfdriver.h; sourceTree = "<group>"; };
+		611E0C8911FA8FA50077A41E /* sferrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sferrors.h; sourceTree = "<group>"; };
+		611E0C8A11FA8FA50077A41E /* sfnt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfnt.c; sourceTree = "<group>"; };
+		611E0C8B11FA8FA50077A41E /* sfntpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfntpic.c; sourceTree = "<group>"; };
+		611E0C8C11FA8FA50077A41E /* sfntpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfntpic.h; sourceTree = "<group>"; };
+		611E0C8D11FA8FA50077A41E /* sfobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfobjs.c; sourceTree = "<group>"; };
+		611E0C8E11FA8FA50077A41E /* sfobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfobjs.h; sourceTree = "<group>"; };
+		611E0C8F11FA8FA50077A41E /* ttbdf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttbdf.c; sourceTree = "<group>"; };
+		611E0C9011FA8FA50077A41E /* ttbdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttbdf.h; sourceTree = "<group>"; };
+		611E0C9111FA8FA50077A41E /* ttcmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttcmap.c; sourceTree = "<group>"; };
+		611E0C9211FA8FA50077A41E /* ttcmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttcmap.h; sourceTree = "<group>"; };
+		611E0C9311FA8FA50077A41E /* ttcmapc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttcmapc.h; sourceTree = "<group>"; };
+		611E0C9411FA8FA50077A41E /* ttkern.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkern.c; sourceTree = "<group>"; };
+		611E0C9511FA8FA50077A41E /* ttkern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkern.h; sourceTree = "<group>"; };
+		611E0C9611FA8FA50077A41E /* ttload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttload.c; sourceTree = "<group>"; };
+		611E0C9711FA8FA50077A41E /* ttload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttload.h; sourceTree = "<group>"; };
+		611E0C9811FA8FA50077A41E /* ttmtx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttmtx.c; sourceTree = "<group>"; };
+		611E0C9911FA8FA50077A41E /* ttmtx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttmtx.h; sourceTree = "<group>"; };
+		611E0C9A11FA8FA50077A41E /* ttpost.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttpost.c; sourceTree = "<group>"; };
+		611E0C9B11FA8FA50077A41E /* ttpost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttpost.h; sourceTree = "<group>"; };
+		611E0C9C11FA8FA50077A41E /* ttsbit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttsbit.c; sourceTree = "<group>"; };
+		611E0C9D11FA8FA50077A41E /* ttsbit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttsbit.h; sourceTree = "<group>"; };
+		611E0C9E11FA8FA50077A41E /* ttsbit0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttsbit0.c; sourceTree = "<group>"; };
+		611E0CA011FA8FA50077A41E /* ftgrays.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftgrays.c; sourceTree = "<group>"; };
+		611E0CA111FA8FA50077A41E /* ftgrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgrays.h; sourceTree = "<group>"; };
+		611E0CA211FA8FA50077A41E /* ftsmerrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsmerrs.h; sourceTree = "<group>"; };
+		611E0CA311FA8FA50077A41E /* ftsmooth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsmooth.c; sourceTree = "<group>"; };
+		611E0CA411FA8FA50077A41E /* ftsmooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsmooth.h; sourceTree = "<group>"; };
+		611E0CA511FA8FA50077A41E /* ftspic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftspic.c; sourceTree = "<group>"; };
+		611E0CA611FA8FA50077A41E /* ftspic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftspic.h; sourceTree = "<group>"; };
+		611E0CA711FA8FA50077A41E /* smooth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smooth.c; sourceTree = "<group>"; };
+		611E0CBD11FA8FA50077A41E /* truetype.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = truetype.c; sourceTree = "<group>"; };
+		611E0CBE11FA8FA50077A41E /* ttdriver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttdriver.c; sourceTree = "<group>"; };
+		611E0CBF11FA8FA50077A41E /* ttdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttdriver.h; sourceTree = "<group>"; };
+		611E0CC011FA8FA50077A41E /* tterrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tterrors.h; sourceTree = "<group>"; };
+		611E0CC111FA8FA50077A41E /* ttgload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttgload.c; sourceTree = "<group>"; };
+		611E0CC211FA8FA50077A41E /* ttgload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttgload.h; sourceTree = "<group>"; };
+		611E0CC311FA8FA50077A41E /* ttgxvar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttgxvar.c; sourceTree = "<group>"; };
+		611E0CC411FA8FA50077A41E /* ttgxvar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttgxvar.h; sourceTree = "<group>"; };
+		611E0CC511FA8FA50077A41E /* ttinterp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttinterp.c; sourceTree = "<group>"; };
+		611E0CC611FA8FA50077A41E /* ttinterp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttinterp.h; sourceTree = "<group>"; };
+		611E0CC711FA8FA50077A41E /* ttobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttobjs.c; sourceTree = "<group>"; };
+		611E0CC811FA8FA50077A41E /* ttobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttobjs.h; sourceTree = "<group>"; };
+		611E0CC911FA8FA50077A41E /* ttpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttpic.c; sourceTree = "<group>"; };
+		611E0CCA11FA8FA50077A41E /* ttpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttpic.h; sourceTree = "<group>"; };
+		611E0CCB11FA8FA50077A41E /* ttpload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttpload.c; sourceTree = "<group>"; };
+		611E0CCC11FA8FA50077A41E /* ttpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttpload.h; sourceTree = "<group>"; };
+		AA747D9E0F9514B9006C5449 /* freetype_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = freetype_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 /* libFreetype.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFreetype.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 /* libFreetype.a */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		0867D691FE84028FC02AAC07 /* freetype */ = {
+			isa = PBXGroup;
+			children = (
+				08FB77AEFE84172EC02AAC07 /* Source */,
+				32C88DFF0371C24200C91783 /* Public Headers */,
+				0867D69AFE84028FC02AAC07 /* Frameworks */,
+				034768DFFF38A50411DB9C8B /* Products */,
+			);
+			name = freetype;
+			sourceTree = "<group>";
+		};
+		0867D69AFE84028FC02AAC07 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				AACBBE490F95108600F1A2B1 /* Foundation.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+		08FB77AEFE84172EC02AAC07 /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				611E0B9811FA8FA50077A41E /* base */,
+				611E0BD911FA8FA50077A41E /* cff */,
+				611E0C6711FA8FA50077A41E /* pshinter */,
+				611E0C7411FA8FA50077A41E /* psnames */,
+				611E0C7C11FA8FA50077A41E /* raster */,
+				611E0C8611FA8FA50077A41E /* sfnt */,
+				611E0C9F11FA8FA50077A41E /* smooth */,
+				611E0CBC11FA8FA50077A41E /* truetype */,
+			);
+			name = Source;
+			sourceTree = "<group>";
+		};
+		32C88DFF0371C24200C91783 /* Public Headers */ = {
+			isa = PBXGroup;
+			children = (
+				611E0AC411FA8F610077A41E /* freetype */,
+				611E0B1B11FA8F610077A41E /* ft2build.h */,
+				AA747D9E0F9514B9006C5449 /* freetype_Prefix.pch */,
+			);
+			name = "Public Headers";
+			sourceTree = "<group>";
+		};
+		611E0AC411FA8F610077A41E /* freetype */ = {
+			isa = PBXGroup;
+			children = (
+				611E0AC511FA8F610077A41E /* config */,
+				611E0ACB11FA8F610077A41E /* freetype.h */,
+				611E0ACC11FA8F610077A41E /* ftadvanc.h */,
+				611E0ACD11FA8F610077A41E /* ftbbox.h */,
+				611E0ACE11FA8F610077A41E /* ftbdf.h */,
+				611E0ACF11FA8F610077A41E /* ftbitmap.h */,
+				611E0AD011FA8F610077A41E /* ftcache.h */,
+				611E0AD111FA8F610077A41E /* ftchapters.h */,
+				611E0AD211FA8F610077A41E /* ftcid.h */,
+				611E0AD311FA8F610077A41E /* fterrdef.h */,
+				611E0AD411FA8F610077A41E /* fterrors.h */,
+				611E0AD511FA8F610077A41E /* ftgasp.h */,
+				611E0AD611FA8F610077A41E /* ftglyph.h */,
+				611E0AD711FA8F610077A41E /* ftgxval.h */,
+				611E0AD811FA8F610077A41E /* ftgzip.h */,
+				611E0AD911FA8F610077A41E /* ftimage.h */,
+				611E0ADA11FA8F610077A41E /* ftincrem.h */,
+				611E0ADB11FA8F610077A41E /* ftlcdfil.h */,
+				611E0ADC11FA8F610077A41E /* ftlist.h */,
+				611E0ADD11FA8F610077A41E /* ftlzw.h */,
+				611E0ADE11FA8F610077A41E /* ftmac.h */,
+				611E0ADF11FA8F610077A41E /* ftmm.h */,
+				611E0AE011FA8F610077A41E /* ftmodapi.h */,
+				611E0AE111FA8F610077A41E /* ftmoderr.h */,
+				611E0AE211FA8F610077A41E /* ftotval.h */,
+				611E0AE311FA8F610077A41E /* ftoutln.h */,
+				611E0AE411FA8F610077A41E /* ftpfr.h */,
+				611E0AE511FA8F610077A41E /* ftrender.h */,
+				611E0AE611FA8F610077A41E /* ftsizes.h */,
+				611E0AE711FA8F610077A41E /* ftsnames.h */,
+				611E0AE811FA8F610077A41E /* ftstroke.h */,
+				611E0AE911FA8F610077A41E /* ftsynth.h */,
+				611E0AEA11FA8F610077A41E /* ftsystem.h */,
+				611E0AEB11FA8F610077A41E /* fttrigon.h */,
+				611E0AEC11FA8F610077A41E /* fttypes.h */,
+				611E0AED11FA8F610077A41E /* ftwinfnt.h */,
+				611E0AEE11FA8F610077A41E /* ftxf86.h */,
+				611E0AEF11FA8F610077A41E /* internal */,
+				611E0B1611FA8F610077A41E /* t1tables.h */,
+				611E0B1711FA8F610077A41E /* ttnameid.h */,
+				611E0B1811FA8F610077A41E /* tttables.h */,
+				611E0B1911FA8F610077A41E /* tttags.h */,
+				611E0B1A11FA8F610077A41E /* ttunpat.h */,
+			);
+			name = freetype;
+			path = ../include/freetype;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0AC511FA8F610077A41E /* config */ = {
+			isa = PBXGroup;
+			children = (
+				611E0AC611FA8F610077A41E /* ftconfig.h */,
+				611E0AC711FA8F610077A41E /* ftheader.h */,
+				611E0AC811FA8F610077A41E /* ftmodule.h */,
+				611E0AC911FA8F610077A41E /* ftoption.h */,
+				611E0ACA11FA8F610077A41E /* ftstdlib.h */,
+			);
+			path = config;
+			sourceTree = "<group>";
+		};
+		611E0AEF11FA8F610077A41E /* internal */ = {
+			isa = PBXGroup;
+			children = (
+				611E0AF011FA8F610077A41E /* autohint.h */,
+				611E0AF111FA8F610077A41E /* ftcalc.h */,
+				611E0AF211FA8F610077A41E /* ftdebug.h */,
+				611E0AF311FA8F610077A41E /* ftdriver.h */,
+				611E0AF411FA8F610077A41E /* ftgloadr.h */,
+				611E0AF511FA8F610077A41E /* ftmemory.h */,
+				611E0AF611FA8F610077A41E /* ftobjs.h */,
+				611E0AF711FA8F610077A41E /* ftpic.h */,
+				611E0AF811FA8F610077A41E /* ftrfork.h */,
+				611E0AF911FA8F610077A41E /* ftserv.h */,
+				611E0AFA11FA8F610077A41E /* ftstream.h */,
+				611E0AFB11FA8F610077A41E /* fttrace.h */,
+				611E0AFC11FA8F610077A41E /* ftvalid.h */,
+				611E0AFD11FA8F610077A41E /* internal.h */,
+				611E0AFE11FA8F610077A41E /* pcftypes.h */,
+				611E0AFF11FA8F610077A41E /* psaux.h */,
+				611E0B0011FA8F610077A41E /* pshints.h */,
+				611E0B0111FA8F610077A41E /* services */,
+				611E0B1311FA8F610077A41E /* sfnt.h */,
+				611E0B1411FA8F610077A41E /* t1types.h */,
+				611E0B1511FA8F610077A41E /* tttypes.h */,
+			);
+			path = internal;
+			sourceTree = "<group>";
+		};
+		611E0B0111FA8F610077A41E /* services */ = {
+			isa = PBXGroup;
+			children = (
+				611E0B0211FA8F610077A41E /* svbdf.h */,
+				611E0B0311FA8F610077A41E /* svcid.h */,
+				611E0B0411FA8F610077A41E /* svgldict.h */,
+				611E0B0511FA8F610077A41E /* svgxval.h */,
+				611E0B0611FA8F610077A41E /* svkern.h */,
+				611E0B0711FA8F610077A41E /* svmm.h */,
+				611E0B0811FA8F610077A41E /* svotval.h */,
+				611E0B0911FA8F610077A41E /* svpfr.h */,
+				611E0B0A11FA8F610077A41E /* svpostnm.h */,
+				611E0B0B11FA8F610077A41E /* svpscmap.h */,
+				611E0B0C11FA8F610077A41E /* svpsinfo.h */,
+				611E0B0D11FA8F610077A41E /* svsfnt.h */,
+				611E0B0E11FA8F610077A41E /* svttcmap.h */,
+				611E0B0F11FA8F610077A41E /* svtteng.h */,
+				611E0B1011FA8F610077A41E /* svttglyf.h */,
+				611E0B1111FA8F610077A41E /* svwinfnt.h */,
+				611E0B1211FA8F610077A41E /* svxf86nm.h */,
+			);
+			path = services;
+			sourceTree = "<group>";
+		};
+		611E0B9811FA8FA50077A41E /* base */ = {
+			isa = PBXGroup;
+			children = (
+				611E0B9911FA8FA50077A41E /* basepic.c */,
+				611E0B9A11FA8FA50077A41E /* basepic.h */,
+				611E0B9B11FA8FA50077A41E /* ftadvanc.c */,
+				611E0B9C11FA8FA50077A41E /* ftapi.c */,
+				611E0B9D11FA8FA50077A41E /* ftbase.c */,
+				611E0B9E11FA8FA50077A41E /* ftbase.h */,
+				611E0B9F11FA8FA50077A41E /* ftbbox.c */,
+				611E0BA111FA8FA50077A41E /* ftbitmap.c */,
+				611E0BA211FA8FA50077A41E /* ftcalc.c */,
+				611E0BA411FA8FA50077A41E /* ftdbgmem.c */,
+				611E0BA511FA8FA50077A41E /* ftdebug.c */,
+				611E0BA811FA8FA50077A41E /* ftgloadr.c */,
+				611E0BA911FA8FA50077A41E /* ftglyph.c */,
+				611E0BAB11FA8FA50077A41E /* ftinit.c */,
+				611E0BAF11FA8FA50077A41E /* ftobjs.c */,
+				611E0BB111FA8FA50077A41E /* ftoutln.c */,
+				611E0BB411FA8FA50077A41E /* ftpic.c */,
+				611E0BB511FA8FA50077A41E /* ftrfork.c */,
+				611E0BB611FA8FA50077A41E /* ftsnames.c */,
+				611E0BB711FA8FA50077A41E /* ftstream.c */,
+				611E0BB811FA8FA50077A41E /* ftstroke.c */,
+				611E0BB911FA8FA50077A41E /* ftsynth.c */,
+				611E0BBA11FA8FA50077A41E /* ftsystem.c */,
+				611E0BBB11FA8FA50077A41E /* fttrigon.c */,
+				611E0BBD11FA8FA50077A41E /* ftutil.c */,
+			);
+			name = base;
+			path = ../src/base;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0BD911FA8FA50077A41E /* cff */ = {
+			isa = PBXGroup;
+			children = (
+				611E0BDA11FA8FA50077A41E /* cff.c */,
+				611E0BDB11FA8FA50077A41E /* cffcmap.c */,
+				611E0BDC11FA8FA50077A41E /* cffcmap.h */,
+				611E0BDD11FA8FA50077A41E /* cffdrivr.c */,
+				611E0BDE11FA8FA50077A41E /* cffdrivr.h */,
+				611E0BDF11FA8FA50077A41E /* cfferrs.h */,
+				611E0BE011FA8FA50077A41E /* cffgload.c */,
+				611E0BE111FA8FA50077A41E /* cffgload.h */,
+				611E0BE211FA8FA50077A41E /* cffload.c */,
+				611E0BE311FA8FA50077A41E /* cffload.h */,
+				611E0BE411FA8FA50077A41E /* cffobjs.c */,
+				611E0BE511FA8FA50077A41E /* cffobjs.h */,
+				611E0BE611FA8FA50077A41E /* cffparse.c */,
+				611E0BE711FA8FA50077A41E /* cffparse.h */,
+				611E0BE811FA8FA50077A41E /* cffpic.c */,
+				611E0BE911FA8FA50077A41E /* cffpic.h */,
+				611E0BEA11FA8FA50077A41E /* cfftoken.h */,
+				611E0BEB11FA8FA50077A41E /* cfftypes.h */,
+			);
+			name = cff;
+			path = ../src/cff;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0C6711FA8FA50077A41E /* pshinter */ = {
+			isa = PBXGroup;
+			children = (
+				611E0C6811FA8FA50077A41E /* pshalgo.c */,
+				611E0C6911FA8FA50077A41E /* pshalgo.h */,
+				611E0C6A11FA8FA50077A41E /* pshglob.c */,
+				611E0C6B11FA8FA50077A41E /* pshglob.h */,
+				611E0C6C11FA8FA50077A41E /* pshinter.c */,
+				611E0C6D11FA8FA50077A41E /* pshmod.c */,
+				611E0C6E11FA8FA50077A41E /* pshmod.h */,
+				611E0C6F11FA8FA50077A41E /* pshnterr.h */,
+				611E0C7011FA8FA50077A41E /* pshpic.c */,
+				611E0C7111FA8FA50077A41E /* pshpic.h */,
+				611E0C7211FA8FA50077A41E /* pshrec.c */,
+				611E0C7311FA8FA50077A41E /* pshrec.h */,
+			);
+			name = pshinter;
+			path = ../src/pshinter;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0C7411FA8FA50077A41E /* psnames */ = {
+			isa = PBXGroup;
+			children = (
+				611E0C7511FA8FA50077A41E /* psmodule.c */,
+				611E0C7611FA8FA50077A41E /* psmodule.h */,
+				611E0C7711FA8FA50077A41E /* psnamerr.h */,
+				611E0C7811FA8FA50077A41E /* psnames.c */,
+				611E0C7911FA8FA50077A41E /* pspic.c */,
+				611E0C7A11FA8FA50077A41E /* pspic.h */,
+				611E0C7B11FA8FA50077A41E /* pstables.h */,
+			);
+			name = psnames;
+			path = ../src/psnames;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0C7C11FA8FA50077A41E /* raster */ = {
+			isa = PBXGroup;
+			children = (
+				611E0C7D11FA8FA50077A41E /* ftmisc.h */,
+				611E0C7E11FA8FA50077A41E /* ftraster.c */,
+				611E0C7F11FA8FA50077A41E /* ftraster.h */,
+				611E0C8011FA8FA50077A41E /* ftrend1.c */,
+				611E0C8111FA8FA50077A41E /* ftrend1.h */,
+				611E0C8211FA8FA50077A41E /* raster.c */,
+				611E0C8311FA8FA50077A41E /* rasterrs.h */,
+				611E0C8411FA8FA50077A41E /* rastpic.c */,
+				611E0C8511FA8FA50077A41E /* rastpic.h */,
+			);
+			name = raster;
+			path = ../src/raster;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0C8611FA8FA50077A41E /* sfnt */ = {
+			isa = PBXGroup;
+			children = (
+				611E0C8711FA8FA50077A41E /* sfdriver.c */,
+				611E0C8811FA8FA50077A41E /* sfdriver.h */,
+				611E0C8911FA8FA50077A41E /* sferrors.h */,
+				611E0C8A11FA8FA50077A41E /* sfnt.c */,
+				611E0C8B11FA8FA50077A41E /* sfntpic.c */,
+				611E0C8C11FA8FA50077A41E /* sfntpic.h */,
+				611E0C8D11FA8FA50077A41E /* sfobjs.c */,
+				611E0C8E11FA8FA50077A41E /* sfobjs.h */,
+				611E0C8F11FA8FA50077A41E /* ttbdf.c */,
+				611E0C9011FA8FA50077A41E /* ttbdf.h */,
+				611E0C9111FA8FA50077A41E /* ttcmap.c */,
+				611E0C9211FA8FA50077A41E /* ttcmap.h */,
+				611E0C9311FA8FA50077A41E /* ttcmapc.h */,
+				611E0C9411FA8FA50077A41E /* ttkern.c */,
+				611E0C9511FA8FA50077A41E /* ttkern.h */,
+				611E0C9611FA8FA50077A41E /* ttload.c */,
+				611E0C9711FA8FA50077A41E /* ttload.h */,
+				611E0C9811FA8FA50077A41E /* ttmtx.c */,
+				611E0C9911FA8FA50077A41E /* ttmtx.h */,
+				611E0C9A11FA8FA50077A41E /* ttpost.c */,
+				611E0C9B11FA8FA50077A41E /* ttpost.h */,
+				611E0C9C11FA8FA50077A41E /* ttsbit.c */,
+				611E0C9D11FA8FA50077A41E /* ttsbit.h */,
+				611E0C9E11FA8FA50077A41E /* ttsbit0.c */,
+			);
+			name = sfnt;
+			path = ../src/sfnt;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0C9F11FA8FA50077A41E /* smooth */ = {
+			isa = PBXGroup;
+			children = (
+				611E0CA011FA8FA50077A41E /* ftgrays.c */,
+				611E0CA111FA8FA50077A41E /* ftgrays.h */,
+				611E0CA211FA8FA50077A41E /* ftsmerrs.h */,
+				611E0CA311FA8FA50077A41E /* ftsmooth.c */,
+				611E0CA411FA8FA50077A41E /* ftsmooth.h */,
+				611E0CA511FA8FA50077A41E /* ftspic.c */,
+				611E0CA611FA8FA50077A41E /* ftspic.h */,
+				611E0CA711FA8FA50077A41E /* smooth.c */,
+			);
+			name = smooth;
+			path = ../src/smooth;
+			sourceTree = SOURCE_ROOT;
+		};
+		611E0CBC11FA8FA50077A41E /* truetype */ = {
+			isa = PBXGroup;
+			children = (
+				611E0CBD11FA8FA50077A41E /* truetype.c */,
+				611E0CBE11FA8FA50077A41E /* ttdriver.c */,
+				611E0CBF11FA8FA50077A41E /* ttdriver.h */,
+				611E0CC011FA8FA50077A41E /* tterrors.h */,
+				611E0CC111FA8FA50077A41E /* ttgload.c */,
+				611E0CC211FA8FA50077A41E /* ttgload.h */,
+				611E0CC311FA8FA50077A41E /* ttgxvar.c */,
+				611E0CC411FA8FA50077A41E /* ttgxvar.h */,
+				611E0CC511FA8FA50077A41E /* ttinterp.c */,
+				611E0CC611FA8FA50077A41E /* ttinterp.h */,
+				611E0CC711FA8FA50077A41E /* ttobjs.c */,
+				611E0CC811FA8FA50077A41E /* ttobjs.h */,
+				611E0CC911FA8FA50077A41E /* ttpic.c */,
+				611E0CCA11FA8FA50077A41E /* ttpic.h */,
+				611E0CCB11FA8FA50077A41E /* ttpload.c */,
+				611E0CCC11FA8FA50077A41E /* ttpload.h */,
+			);
+			name = truetype;
+			path = ../src/truetype;
+			sourceTree = SOURCE_ROOT;
+		};
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+		D2AAC07A0554694100DB518D /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				AA747D9F0F9514B9006C5449 /* freetype_Prefix.pch in Headers */,
+				611E0B1C11FA8F610077A41E /* ftconfig.h in Headers */,
+				611E0B1D11FA8F610077A41E /* ftheader.h in Headers */,
+				611E0B1E11FA8F610077A41E /* ftmodule.h in Headers */,
+				611E0B1F11FA8F610077A41E /* ftoption.h in Headers */,
+				611E0B2011FA8F610077A41E /* ftstdlib.h in Headers */,
+				611E0B2111FA8F610077A41E /* freetype.h in Headers */,
+				611E0B2211FA8F610077A41E /* ftadvanc.h in Headers */,
+				611E0B2311FA8F610077A41E /* ftbbox.h in Headers */,
+				611E0B2411FA8F610077A41E /* ftbdf.h in Headers */,
+				611E0B2511FA8F610077A41E /* ftbitmap.h in Headers */,
+				611E0B2611FA8F610077A41E /* ftcache.h in Headers */,
+				611E0B2711FA8F610077A41E /* ftchapters.h in Headers */,
+				611E0B2811FA8F610077A41E /* ftcid.h in Headers */,
+				611E0B2911FA8F610077A41E /* fterrdef.h in Headers */,
+				611E0B2A11FA8F610077A41E /* fterrors.h in Headers */,
+				611E0B2B11FA8F610077A41E /* ftgasp.h in Headers */,
+				611E0B2C11FA8F610077A41E /* ftglyph.h in Headers */,
+				611E0B2D11FA8F610077A41E /* ftgxval.h in Headers */,
+				611E0B2E11FA8F610077A41E /* ftgzip.h in Headers */,
+				611E0B2F11FA8F610077A41E /* ftimage.h in Headers */,
+				611E0B3011FA8F610077A41E /* ftincrem.h in Headers */,
+				611E0B3111FA8F610077A41E /* ftlcdfil.h in Headers */,
+				611E0B3211FA8F610077A41E /* ftlist.h in Headers */,
+				611E0B3311FA8F610077A41E /* ftlzw.h in Headers */,
+				611E0B3411FA8F610077A41E /* ftmac.h in Headers */,
+				611E0B3511FA8F610077A41E /* ftmm.h in Headers */,
+				611E0B3611FA8F610077A41E /* ftmodapi.h in Headers */,
+				611E0B3711FA8F610077A41E /* ftmoderr.h in Headers */,
+				611E0B3811FA8F610077A41E /* ftotval.h in Headers */,
+				611E0B3911FA8F610077A41E /* ftoutln.h in Headers */,
+				611E0B3A11FA8F610077A41E /* ftpfr.h in Headers */,
+				611E0B3B11FA8F610077A41E /* ftrender.h in Headers */,
+				611E0B3C11FA8F610077A41E /* ftsizes.h in Headers */,
+				611E0B3D11FA8F610077A41E /* ftsnames.h in Headers */,
+				611E0B3E11FA8F610077A41E /* ftstroke.h in Headers */,
+				611E0B3F11FA8F610077A41E /* ftsynth.h in Headers */,
+				611E0B4011FA8F610077A41E /* ftsystem.h in Headers */,
+				611E0B4111FA8F610077A41E /* fttrigon.h in Headers */,
+				611E0B4211FA8F610077A41E /* fttypes.h in Headers */,
+				611E0B4311FA8F610077A41E /* ftwinfnt.h in Headers */,
+				611E0B4411FA8F610077A41E /* ftxf86.h in Headers */,
+				611E0B4511FA8F610077A41E /* autohint.h in Headers */,
+				611E0B4611FA8F610077A41E /* ftcalc.h in Headers */,
+				611E0B4711FA8F610077A41E /* ftdebug.h in Headers */,
+				611E0B4811FA8F610077A41E /* ftdriver.h in Headers */,
+				611E0B4911FA8F610077A41E /* ftgloadr.h in Headers */,
+				611E0B4A11FA8F610077A41E /* ftmemory.h in Headers */,
+				611E0B4B11FA8F610077A41E /* ftobjs.h in Headers */,
+				611E0B4C11FA8F610077A41E /* ftpic.h in Headers */,
+				611E0B4D11FA8F610077A41E /* ftrfork.h in Headers */,
+				611E0B4E11FA8F610077A41E /* ftserv.h in Headers */,
+				611E0B4F11FA8F610077A41E /* ftstream.h in Headers */,
+				611E0B5011FA8F610077A41E /* fttrace.h in Headers */,
+				611E0B5111FA8F610077A41E /* ftvalid.h in Headers */,
+				611E0B5211FA8F610077A41E /* internal.h in Headers */,
+				611E0B5311FA8F610077A41E /* pcftypes.h in Headers */,
+				611E0B5411FA8F610077A41E /* psaux.h in Headers */,
+				611E0B5511FA8F610077A41E /* pshints.h in Headers */,
+				611E0B5611FA8F610077A41E /* svbdf.h in Headers */,
+				611E0B5711FA8F610077A41E /* svcid.h in Headers */,
+				611E0B5811FA8F610077A41E /* svgldict.h in Headers */,
+				611E0B5911FA8F610077A41E /* svgxval.h in Headers */,
+				611E0B5A11FA8F610077A41E /* svkern.h in Headers */,
+				611E0B5B11FA8F610077A41E /* svmm.h in Headers */,
+				611E0B5C11FA8F610077A41E /* svotval.h in Headers */,
+				611E0B5D11FA8F610077A41E /* svpfr.h in Headers */,
+				611E0B5E11FA8F610077A41E /* svpostnm.h in Headers */,
+				611E0B5F11FA8F610077A41E /* svpscmap.h in Headers */,
+				611E0B6011FA8F610077A41E /* svpsinfo.h in Headers */,
+				611E0B6111FA8F610077A41E /* svsfnt.h in Headers */,
+				611E0B6211FA8F610077A41E /* svttcmap.h in Headers */,
+				611E0B6311FA8F610077A41E /* svtteng.h in Headers */,
+				611E0B6411FA8F610077A41E /* svttglyf.h in Headers */,
+				611E0B6511FA8F610077A41E /* svwinfnt.h in Headers */,
+				611E0B6611FA8F610077A41E /* svxf86nm.h in Headers */,
+				611E0B6711FA8F610077A41E /* sfnt.h in Headers */,
+				611E0B6811FA8F610077A41E /* t1types.h in Headers */,
+				611E0B6911FA8F610077A41E /* tttypes.h in Headers */,
+				611E0B6A11FA8F610077A41E /* t1tables.h in Headers */,
+				611E0B6B11FA8F610077A41E /* ttnameid.h in Headers */,
+				611E0B6C11FA8F610077A41E /* tttables.h in Headers */,
+				611E0B6D11FA8F610077A41E /* tttags.h in Headers */,
+				611E0B6E11FA8F610077A41E /* ttunpat.h in Headers */,
+				611E0B6F11FA8F610077A41E /* ft2build.h in Headers */,
+				611E0D0711FA8FA50077A41E /* basepic.h in Headers */,
+				611E0D0B11FA8FA50077A41E /* ftbase.h in Headers */,
+				611E0D4611FA8FA50077A41E /* cffcmap.h in Headers */,
+				611E0D4811FA8FA50077A41E /* cffdrivr.h in Headers */,
+				611E0D4911FA8FA50077A41E /* cfferrs.h in Headers */,
+				611E0D4B11FA8FA50077A41E /* cffgload.h in Headers */,
+				611E0D4D11FA8FA50077A41E /* cffload.h in Headers */,
+				611E0D4F11FA8FA50077A41E /* cffobjs.h in Headers */,
+				611E0D5111FA8FA50077A41E /* cffparse.h in Headers */,
+				611E0D5311FA8FA50077A41E /* cffpic.h in Headers */,
+				611E0D5411FA8FA50077A41E /* cfftoken.h in Headers */,
+				611E0D5511FA8FA50077A41E /* cfftypes.h in Headers */,
+				611E0DCA11FA8FA50077A41E /* pshalgo.h in Headers */,
+				611E0DCC11FA8FA50077A41E /* pshglob.h in Headers */,
+				611E0DCF11FA8FA50077A41E /* pshmod.h in Headers */,
+				611E0DD011FA8FA50077A41E /* pshnterr.h in Headers */,
+				611E0DD211FA8FA50077A41E /* pshpic.h in Headers */,
+				611E0DD411FA8FA50077A41E /* pshrec.h in Headers */,
+				611E0DD611FA8FA50077A41E /* psmodule.h in Headers */,
+				611E0DD711FA8FA50077A41E /* psnamerr.h in Headers */,
+				611E0DDA11FA8FA50077A41E /* pspic.h in Headers */,
+				611E0DDB11FA8FA50077A41E /* pstables.h in Headers */,
+				611E0DDC11FA8FA50077A41E /* ftmisc.h in Headers */,
+				611E0DDE11FA8FA50077A41E /* ftraster.h in Headers */,
+				611E0DE011FA8FA50077A41E /* ftrend1.h in Headers */,
+				611E0DE211FA8FA50077A41E /* rasterrs.h in Headers */,
+				611E0DE411FA8FA50077A41E /* rastpic.h in Headers */,
+				611E0DE611FA8FA50077A41E /* sfdriver.h in Headers */,
+				611E0DE711FA8FA50077A41E /* sferrors.h in Headers */,
+				611E0DEA11FA8FA50077A41E /* sfntpic.h in Headers */,
+				611E0DEC11FA8FA50077A41E /* sfobjs.h in Headers */,
+				611E0DEE11FA8FA50077A41E /* ttbdf.h in Headers */,
+				611E0DF011FA8FA50077A41E /* ttcmap.h in Headers */,
+				611E0DF111FA8FA50077A41E /* ttcmapc.h in Headers */,
+				611E0DF311FA8FA50077A41E /* ttkern.h in Headers */,
+				611E0DF511FA8FA50077A41E /* ttload.h in Headers */,
+				611E0DF711FA8FA50077A41E /* ttmtx.h in Headers */,
+				611E0DF911FA8FA50077A41E /* ttpost.h in Headers */,
+				611E0DFB11FA8FA50077A41E /* ttsbit.h in Headers */,
+				611E0DFE11FA8FA50077A41E /* ftgrays.h in Headers */,
+				611E0DFF11FA8FA50077A41E /* ftsmerrs.h in Headers */,
+				611E0E0111FA8FA50077A41E /* ftsmooth.h in Headers */,
+				611E0E0311FA8FA50077A41E /* ftspic.h in Headers */,
+				611E0E0D11FA8FA50077A41E /* ttdriver.h in Headers */,
+				611E0E0E11FA8FA50077A41E /* tterrors.h in Headers */,
+				611E0E1011FA8FA50077A41E /* ttgload.h in Headers */,
+				611E0E1211FA8FA50077A41E /* ttgxvar.h in Headers */,
+				611E0E1411FA8FA50077A41E /* ttinterp.h in Headers */,
+				611E0E1611FA8FA50077A41E /* ttobjs.h in Headers */,
+				611E0E1811FA8FA50077A41E /* ttpic.h in Headers */,
+				611E0E1A11FA8FA50077A41E /* ttpload.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+		D2AAC07D0554694100DB518D /* libFreetype */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "libFreetype" */;
+			buildPhases = (
+				D2AAC07A0554694100DB518D /* Headers */,
+				D2AAC07B0554694100DB518D /* Sources */,
+				D2AAC07C0554694100DB518D /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = libFreetype;
+			productName = freetype;
+			productReference = D2AAC07E0554694100DB518D /* libFreetype.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 "Freetype" */;
+			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
+			hasScannedForEncodings = 1;
+			knownRegions = (
+				English,
+				Japanese,
+				French,
+				German,
+			);
+			mainGroup = 0867D691FE84028FC02AAC07 /* freetype */;
+			productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				D2AAC07D0554694100DB518D /* libFreetype */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		D2AAC07B0554694100DB518D /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				611E0D0611FA8FA50077A41E /* basepic.c in Sources */,
+				611E0D0811FA8FA50077A41E /* ftadvanc.c in Sources */,
+				611E0D0911FA8FA50077A41E /* ftapi.c in Sources */,
+				611E0D0A11FA8FA50077A41E /* ftbase.c in Sources */,
+				611E0D0C11FA8FA50077A41E /* ftbbox.c in Sources */,
+				611E0D0E11FA8FA50077A41E /* ftbitmap.c in Sources */,
+				611E0D0F11FA8FA50077A41E /* ftcalc.c in Sources */,
+				611E0D1111FA8FA50077A41E /* ftdbgmem.c in Sources */,
+				611E0D1211FA8FA50077A41E /* ftdebug.c in Sources */,
+				611E0D1511FA8FA50077A41E /* ftgloadr.c in Sources */,
+				611E0D1611FA8FA50077A41E /* ftglyph.c in Sources */,
+				611E0D1811FA8FA50077A41E /* ftinit.c in Sources */,
+				611E0D1C11FA8FA50077A41E /* ftobjs.c in Sources */,
+				611E0D1E11FA8FA50077A41E /* ftoutln.c in Sources */,
+				611E0D2111FA8FA50077A41E /* ftpic.c in Sources */,
+				611E0D2211FA8FA50077A41E /* ftrfork.c in Sources */,
+				611E0D2311FA8FA50077A41E /* ftsnames.c in Sources */,
+				611E0D2411FA8FA50077A41E /* ftstream.c in Sources */,
+				611E0D2511FA8FA50077A41E /* ftstroke.c in Sources */,
+				611E0D2611FA8FA50077A41E /* ftsynth.c in Sources */,
+				611E0D2711FA8FA50077A41E /* ftsystem.c in Sources */,
+				611E0D2811FA8FA50077A41E /* fttrigon.c in Sources */,
+				611E0D2A11FA8FA50077A41E /* ftutil.c in Sources */,
+				611E0D4411FA8FA50077A41E /* cff.c in Sources */,
+				611E0D4511FA8FA50077A41E /* cffcmap.c in Sources */,
+				611E0D4711FA8FA50077A41E /* cffdrivr.c in Sources */,
+				611E0D4A11FA8FA50077A41E /* cffgload.c in Sources */,
+				611E0D4C11FA8FA50077A41E /* cffload.c in Sources */,
+				611E0D4E11FA8FA50077A41E /* cffobjs.c in Sources */,
+				611E0D5011FA8FA50077A41E /* cffparse.c in Sources */,
+				611E0D5211FA8FA50077A41E /* cffpic.c in Sources */,
+				611E0DC911FA8FA50077A41E /* pshalgo.c in Sources */,
+				611E0DCB11FA8FA50077A41E /* pshglob.c in Sources */,
+				611E0DCD11FA8FA50077A41E /* pshinter.c in Sources */,
+				611E0DCE11FA8FA50077A41E /* pshmod.c in Sources */,
+				611E0DD111FA8FA50077A41E /* pshpic.c in Sources */,
+				611E0DD311FA8FA50077A41E /* pshrec.c in Sources */,
+				611E0DD511FA8FA50077A41E /* psmodule.c in Sources */,
+				611E0DD811FA8FA50077A41E /* psnames.c in Sources */,
+				611E0DD911FA8FA50077A41E /* pspic.c in Sources */,
+				611E0DDD11FA8FA50077A41E /* ftraster.c in Sources */,
+				611E0DDF11FA8FA50077A41E /* ftrend1.c in Sources */,
+				611E0DE111FA8FA50077A41E /* raster.c in Sources */,
+				611E0DE311FA8FA50077A41E /* rastpic.c in Sources */,
+				611E0DE511FA8FA50077A41E /* sfdriver.c in Sources */,
+				611E0DE811FA8FA50077A41E /* sfnt.c in Sources */,
+				611E0DE911FA8FA50077A41E /* sfntpic.c in Sources */,
+				611E0DEB11FA8FA50077A41E /* sfobjs.c in Sources */,
+				611E0DED11FA8FA50077A41E /* ttbdf.c in Sources */,
+				611E0DEF11FA8FA50077A41E /* ttcmap.c in Sources */,
+				611E0DF211FA8FA50077A41E /* ttkern.c in Sources */,
+				611E0DF411FA8FA50077A41E /* ttload.c in Sources */,
+				611E0DF611FA8FA50077A41E /* ttmtx.c in Sources */,
+				611E0DF811FA8FA50077A41E /* ttpost.c in Sources */,
+				611E0DFA11FA8FA50077A41E /* ttsbit.c in Sources */,
+				611E0DFC11FA8FA50077A41E /* ttsbit0.c in Sources */,
+				611E0DFD11FA8FA50077A41E /* ftgrays.c in Sources */,
+				611E0E0011FA8FA50077A41E /* ftsmooth.c in Sources */,
+				611E0E0211FA8FA50077A41E /* ftspic.c in Sources */,
+				611E0E0411FA8FA50077A41E /* smooth.c in Sources */,
+				611E0E0B11FA8FA50077A41E /* truetype.c in Sources */,
+				611E0E0C11FA8FA50077A41E /* ttdriver.c in Sources */,
+				611E0E0F11FA8FA50077A41E /* ttgload.c in Sources */,
+				611E0E1111FA8FA50077A41E /* ttgxvar.c in Sources */,
+				611E0E1311FA8FA50077A41E /* ttinterp.c in Sources */,
+				611E0E1511FA8FA50077A41E /* ttobjs.c in Sources */,
+				611E0E1711FA8FA50077A41E /* ttpic.c in Sources */,
+				611E0E1911FA8FA50077A41E /* ttpload.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/freetype.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 = freetype_Prefix.pch;
+				INSTALL_PATH = /usr/local/lib;
+				PRODUCT_NAME = Freetype;
+			};
+			name = Debug;
+		};
+		1DEB922008733DC00010E9CD /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				DSTROOT = /tmp/freetype.dst;
+				GCC_MODEL_TUNING = G5;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = freetype_Prefix.pch;
+				INSTALL_PATH = /usr/local/lib;
+				PRODUCT_NAME = Freetype;
+			};
+			name = Release;
+		};
+		1DEB922308733DC00010E9CD /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					DARWIN_NO_CARBON,
+					FT2_BUILD_LIBRARY,
+				);
+				GCC_THUMB_SUPPORT = YES;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include\"";
+				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_OPTIMIZATION_LEVEL = s;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					DARWIN_NO_CARBON,
+					FT2_BUILD_LIBRARY,
+				);
+				GCC_THUMB_SUPPORT = YES;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include\"";
+				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 "libFreetype" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				1DEB921F08733DC00010E9CD /* Debug */,
+				1DEB922008733DC00010E9CD /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Freetype" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				1DEB922308733DC00010E9CD /* Debug */,
+				1DEB922408733DC00010E9CD /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/libfreetype/Xcode-iOS/Freetype_Prefix.pch	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project.
+//
+
+#ifdef __OBJC__
+    #import <Foundation/Foundation.h>
+#endif
--- a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.mode1v3	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1369 +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>611E0B7211FA8F650077A41E</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>08FB77AEFE84172EC02AAC07</string>
-								<string>1C37FBAC04509CD000000102</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>586 569 788 504 0 0 1920 1178 </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>ftconfig.h</string>
-								<key>PBXSplitModuleInNavigatorKey</key>
-								<dict>
-									<key>Split0</key>
-									<dict>
-										<key>PBXProjectModuleGUID</key>
-										<string>1CE0B20406471E060097A5F4</string>
-										<key>PBXProjectModuleLabel</key>
-										<string>ftconfig.h</string>
-										<key>_historyCapacity</key>
-										<integer>0</integer>
-										<key>bookmark</key>
-										<string>619599D11364E6FE00B429B6</string>
-										<key>history</key>
-										<array>
-											<string>611E0E5811FA92660077A41E</string>
-											<string>619599AE1364E63300B429B6</string>
-											<string>619599C11364E6C400B429B6</string>
-										</array>
-									</dict>
-									<key>SplitCount</key>
-									<string>1</string>
-								</dict>
-								<key>StatusBarVisibility</key>
-								<true/>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 0}, {580, 211}}</string>
-								<key>RubberWindowFrame</key>
-								<string>586 569 788 504 0 0 1920 1178 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXNavigatorGroup</string>
-							<key>Proportion</key>
-							<string>211pt</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, 216}, {580, 247}}</string>
-								<key>RubberWindowFrame</key>
-								<string>586 569 788 504 0 0 1920 1178 </string>
-							</dict>
-							<key>Module</key>
-							<string>XCDetailModule</string>
-							<key>Proportion</key>
-							<string>247pt</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>619599D21364E6FE00B429B6</string>
-				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>619599D31364E6FE00B429B6</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>611E0B7311FA8F650077A41E</string>
-		<string>/Users/vittorio/hedgewars/trunk/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj</string>
-	</array>
-	<key>WindowString</key>
-	<string>586 569 788 504 0 0 1920 1178 </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}, {1145, 432}}</string>
-								<key>RubberWindowFrame</key>
-								<string>1167 248 1145 714 0 0 1920 1178 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXNavigatorGroup</string>
-							<key>Proportion</key>
-							<string>432pt</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, 437}, {1145, 236}}</string>
-								<key>RubberWindowFrame</key>
-								<string>1167 248 1145 714 0 0 1920 1178 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXBuildResultsModule</string>
-							<key>Proportion</key>
-							<string>236pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>673pt</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>611E0B7311FA8F650077A41E</string>
-				<string>619599D41364E6FE00B429B6</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>1167 248 1145 714 0 0 1920 1178 </string>
-			<key>WindowToolGUID</key>
-			<string>611E0B7311FA8F650077A41E</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>&lt;No Editor&gt;</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>&lt;No Editor&gt;</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>
--- a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.pbxuser	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-// !$*UTF8*$!
-{
-	0867D690FE84028FC02AAC07 /* Project object */ = {
-		activeBuildConfigurationName = Release;
-		activeSDKPreference = iphoneos4.2;
-		activeTarget = D2AAC07D0554694100DB518D /* libFreetype */;
-		addToTargets = (
-			D2AAC07D0554694100DB518D /* libFreetype */,
-		);
-		codeSenseManager = 611E0AC211FA8EB70077A41E /* 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,
-					43,
-					43,
-				);
-				PBXFileTableDataSourceColumnsKey = (
-					PBXFileDataSource_FiletypeID,
-					PBXFileDataSource_Filename_ColumnID,
-					PBXTargetDataSource_PrimaryAttribute,
-					PBXFileDataSource_Built_ColumnID,
-					PBXFileDataSource_ObjectSize_ColumnID,
-					PBXFileDataSource_Errors_ColumnID,
-					PBXFileDataSource_Warnings_ColumnID,
-				);
-			};
-			PBXPerProjectTemplateStateSaveDate = 325379832;
-			PBXWorkspaceStateSaveDate = 325379832;
-		};
-		perUserProjectItems = {
-			611E0E5811FA92660077A41E /* PBXTextBookmark */ = 611E0E5811FA92660077A41E /* PBXTextBookmark */;
-			619599AE1364E63300B429B6 /* PBXTextBookmark */ = 619599AE1364E63300B429B6 /* PBXTextBookmark */;
-			619599C11364E6C400B429B6 /* PBXTextBookmark */ = 619599C11364E6C400B429B6 /* PBXTextBookmark */;
-			619599D11364E6FE00B429B6 /* PBXTextBookmark */ = 619599D11364E6FE00B429B6 /* PBXTextBookmark */;
-		};
-		sourceControlManager = 611E0AC111FA8EB70077A41E /* Source Control */;
-		userBuildSettings = {
-		};
-	};
-	611E0AC111FA8EB70077A41E /* Source Control */ = {
-		isa = PBXSourceControlManager;
-		fallbackIsa = XCSourceControlManager;
-		isSCMEnabled = 0;
-		scmConfiguration = {
-			repositoryNamesForRoots = {
-				"" = "";
-			};
-		};
-	};
-	611E0AC211FA8EB70077A41E /* Code sense */ = {
-		isa = PBXCodeSenseManager;
-		indexTemplatePath = "";
-	};
-	611E0AC611FA8F610077A41E /* ftconfig.h */ = {
-		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {551, 8010}}";
-			sepNavSelRange = "{14485, 0}";
-			sepNavVisRange = "{14279, 398}";
-			sepNavWindowFrame = "{{1172, 58}, {1078, 737}}";
-		};
-	};
-	611E0AC811FA8F610077A41E /* ftmodule.h */ = {
-		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {530, 540}}";
-			sepNavSelRange = "{0, 0}";
-			sepNavVisRange = "{0, 593}";
-			sepNavWindowFrame = "{{846, 195}, {1078, 737}}";
-		};
-	};
-	611E0B9D11FA8FA50077A41E /* ftbase.c */ = {
-		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {1084, 540}}";
-			sepNavSelRange = "{0, 0}";
-			sepNavVisRange = "{0, 1416}";
-			sepNavWindowFrame = "{{130, 223}, {1081, 845}}";
-		};
-	};
-	611E0BB111FA8FA50077A41E /* ftoutln.c */ = {
-		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {551, 16755}}";
-			sepNavSelRange = "{4755, 0}";
-			sepNavVisRange = "{4575, 410}";
-		};
-	};
-	611E0CC111FA8FA50077A41E /* ttgload.c */ = {
-		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {829, 32040}}";
-			sepNavSelRange = "{52031, 0}";
-			sepNavVisRange = "{51255, 1537}";
-			sepNavWindowFrame = "{{130, 250}, {888, 818}}";
-		};
-	};
-	611E0E5811FA92660077A41E /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 611E0AC811FA8F610077A41E /* ftmodule.h */;
-		name = "ftmodule.h: 1";
-		rLen = 0;
-		rLoc = 0;
-		rType = 0;
-		vrLen = 593;
-		vrLoc = 0;
-	};
-	619599AE1364E63300B429B6 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 611E0BB111FA8FA50077A41E /* ftoutln.c */;
-		name = "ftoutln.c: 130";
-		rLen = 0;
-		rLoc = 4755;
-		rType = 0;
-		vrLen = 410;
-		vrLoc = 4575;
-	};
-	619599C11364E6C400B429B6 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 611E0AC611FA8F610077A41E /* ftconfig.h */;
-		name = "ftconfig.h: 351";
-		rLen = 0;
-		rLoc = 14485;
-		rType = 0;
-		vrLen = 398;
-		vrLoc = 14279;
-	};
-	619599D11364E6FE00B429B6 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 611E0AC611FA8F610077A41E /* ftconfig.h */;
-		name = "ftconfig.h: 351";
-		rLen = 0;
-		rLoc = 14485;
-		rType = 0;
-		vrLen = 398;
-		vrLoc = 14279;
-	};
-	D2AAC07D0554694100DB518D /* libFreetype */ = {
-		activeExec = 0;
-	};
-}
--- a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1161 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 45;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		611E0B1C11FA8F610077A41E /* ftconfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC611FA8F610077A41E /* ftconfig.h */; };
-		611E0B1D11FA8F610077A41E /* ftheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC711FA8F610077A41E /* ftheader.h */; };
-		611E0B1E11FA8F610077A41E /* ftmodule.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC811FA8F610077A41E /* ftmodule.h */; };
-		611E0B1F11FA8F610077A41E /* ftoption.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AC911FA8F610077A41E /* ftoption.h */; };
-		611E0B2011FA8F610077A41E /* ftstdlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACA11FA8F610077A41E /* ftstdlib.h */; };
-		611E0B2111FA8F610077A41E /* freetype.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACB11FA8F610077A41E /* freetype.h */; };
-		611E0B2211FA8F610077A41E /* ftadvanc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACC11FA8F610077A41E /* ftadvanc.h */; };
-		611E0B2311FA8F610077A41E /* ftbbox.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACD11FA8F610077A41E /* ftbbox.h */; };
-		611E0B2411FA8F610077A41E /* ftbdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACE11FA8F610077A41E /* ftbdf.h */; };
-		611E0B2511FA8F610077A41E /* ftbitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ACF11FA8F610077A41E /* ftbitmap.h */; };
-		611E0B2611FA8F610077A41E /* ftcache.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD011FA8F610077A41E /* ftcache.h */; };
-		611E0B2711FA8F610077A41E /* ftchapters.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD111FA8F610077A41E /* ftchapters.h */; };
-		611E0B2811FA8F610077A41E /* ftcid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD211FA8F610077A41E /* ftcid.h */; };
-		611E0B2911FA8F610077A41E /* fterrdef.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD311FA8F610077A41E /* fterrdef.h */; };
-		611E0B2A11FA8F610077A41E /* fterrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD411FA8F610077A41E /* fterrors.h */; };
-		611E0B2B11FA8F610077A41E /* ftgasp.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD511FA8F610077A41E /* ftgasp.h */; };
-		611E0B2C11FA8F610077A41E /* ftglyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD611FA8F610077A41E /* ftglyph.h */; };
-		611E0B2D11FA8F610077A41E /* ftgxval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD711FA8F610077A41E /* ftgxval.h */; };
-		611E0B2E11FA8F610077A41E /* ftgzip.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD811FA8F610077A41E /* ftgzip.h */; };
-		611E0B2F11FA8F610077A41E /* ftimage.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AD911FA8F610077A41E /* ftimage.h */; };
-		611E0B3011FA8F610077A41E /* ftincrem.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADA11FA8F610077A41E /* ftincrem.h */; };
-		611E0B3111FA8F610077A41E /* ftlcdfil.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADB11FA8F610077A41E /* ftlcdfil.h */; };
-		611E0B3211FA8F610077A41E /* ftlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADC11FA8F610077A41E /* ftlist.h */; };
-		611E0B3311FA8F610077A41E /* ftlzw.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADD11FA8F610077A41E /* ftlzw.h */; };
-		611E0B3411FA8F610077A41E /* ftmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADE11FA8F610077A41E /* ftmac.h */; };
-		611E0B3511FA8F610077A41E /* ftmm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0ADF11FA8F610077A41E /* ftmm.h */; };
-		611E0B3611FA8F610077A41E /* ftmodapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE011FA8F610077A41E /* ftmodapi.h */; };
-		611E0B3711FA8F610077A41E /* ftmoderr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE111FA8F610077A41E /* ftmoderr.h */; };
-		611E0B3811FA8F610077A41E /* ftotval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE211FA8F610077A41E /* ftotval.h */; };
-		611E0B3911FA8F610077A41E /* ftoutln.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE311FA8F610077A41E /* ftoutln.h */; };
-		611E0B3A11FA8F610077A41E /* ftpfr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE411FA8F610077A41E /* ftpfr.h */; };
-		611E0B3B11FA8F610077A41E /* ftrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE511FA8F610077A41E /* ftrender.h */; };
-		611E0B3C11FA8F610077A41E /* ftsizes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE611FA8F610077A41E /* ftsizes.h */; };
-		611E0B3D11FA8F610077A41E /* ftsnames.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE711FA8F610077A41E /* ftsnames.h */; };
-		611E0B3E11FA8F610077A41E /* ftstroke.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE811FA8F610077A41E /* ftstroke.h */; };
-		611E0B3F11FA8F610077A41E /* ftsynth.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AE911FA8F610077A41E /* ftsynth.h */; };
-		611E0B4011FA8F610077A41E /* ftsystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEA11FA8F610077A41E /* ftsystem.h */; };
-		611E0B4111FA8F610077A41E /* fttrigon.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEB11FA8F610077A41E /* fttrigon.h */; };
-		611E0B4211FA8F610077A41E /* fttypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEC11FA8F610077A41E /* fttypes.h */; };
-		611E0B4311FA8F610077A41E /* ftwinfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AED11FA8F610077A41E /* ftwinfnt.h */; };
-		611E0B4411FA8F610077A41E /* ftxf86.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AEE11FA8F610077A41E /* ftxf86.h */; };
-		611E0B4511FA8F610077A41E /* autohint.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF011FA8F610077A41E /* autohint.h */; };
-		611E0B4611FA8F610077A41E /* ftcalc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF111FA8F610077A41E /* ftcalc.h */; };
-		611E0B4711FA8F610077A41E /* ftdebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF211FA8F610077A41E /* ftdebug.h */; };
-		611E0B4811FA8F610077A41E /* ftdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF311FA8F610077A41E /* ftdriver.h */; };
-		611E0B4911FA8F610077A41E /* ftgloadr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF411FA8F610077A41E /* ftgloadr.h */; };
-		611E0B4A11FA8F610077A41E /* ftmemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF511FA8F610077A41E /* ftmemory.h */; };
-		611E0B4B11FA8F610077A41E /* ftobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF611FA8F610077A41E /* ftobjs.h */; };
-		611E0B4C11FA8F610077A41E /* ftpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF711FA8F610077A41E /* ftpic.h */; };
-		611E0B4D11FA8F610077A41E /* ftrfork.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF811FA8F610077A41E /* ftrfork.h */; };
-		611E0B4E11FA8F610077A41E /* ftserv.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AF911FA8F610077A41E /* ftserv.h */; };
-		611E0B4F11FA8F610077A41E /* ftstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFA11FA8F610077A41E /* ftstream.h */; };
-		611E0B5011FA8F610077A41E /* fttrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFB11FA8F610077A41E /* fttrace.h */; };
-		611E0B5111FA8F610077A41E /* ftvalid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFC11FA8F610077A41E /* ftvalid.h */; };
-		611E0B5211FA8F610077A41E /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFD11FA8F610077A41E /* internal.h */; };
-		611E0B5311FA8F610077A41E /* pcftypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFE11FA8F610077A41E /* pcftypes.h */; };
-		611E0B5411FA8F610077A41E /* psaux.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0AFF11FA8F610077A41E /* psaux.h */; };
-		611E0B5511FA8F610077A41E /* pshints.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0011FA8F610077A41E /* pshints.h */; };
-		611E0B5611FA8F610077A41E /* svbdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0211FA8F610077A41E /* svbdf.h */; };
-		611E0B5711FA8F610077A41E /* svcid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0311FA8F610077A41E /* svcid.h */; };
-		611E0B5811FA8F610077A41E /* svgldict.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0411FA8F610077A41E /* svgldict.h */; };
-		611E0B5911FA8F610077A41E /* svgxval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0511FA8F610077A41E /* svgxval.h */; };
-		611E0B5A11FA8F610077A41E /* svkern.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0611FA8F610077A41E /* svkern.h */; };
-		611E0B5B11FA8F610077A41E /* svmm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0711FA8F610077A41E /* svmm.h */; };
-		611E0B5C11FA8F610077A41E /* svotval.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0811FA8F610077A41E /* svotval.h */; };
-		611E0B5D11FA8F610077A41E /* svpfr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0911FA8F610077A41E /* svpfr.h */; };
-		611E0B5E11FA8F610077A41E /* svpostnm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0A11FA8F610077A41E /* svpostnm.h */; };
-		611E0B5F11FA8F610077A41E /* svpscmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0B11FA8F610077A41E /* svpscmap.h */; };
-		611E0B6011FA8F610077A41E /* svpsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0C11FA8F610077A41E /* svpsinfo.h */; };
-		611E0B6111FA8F610077A41E /* svsfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0D11FA8F610077A41E /* svsfnt.h */; };
-		611E0B6211FA8F610077A41E /* svttcmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0E11FA8F610077A41E /* svttcmap.h */; };
-		611E0B6311FA8F610077A41E /* svtteng.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B0F11FA8F610077A41E /* svtteng.h */; };
-		611E0B6411FA8F610077A41E /* svttglyf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1011FA8F610077A41E /* svttglyf.h */; };
-		611E0B6511FA8F610077A41E /* svwinfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1111FA8F610077A41E /* svwinfnt.h */; };
-		611E0B6611FA8F610077A41E /* svxf86nm.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1211FA8F610077A41E /* svxf86nm.h */; };
-		611E0B6711FA8F610077A41E /* sfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1311FA8F610077A41E /* sfnt.h */; };
-		611E0B6811FA8F610077A41E /* t1types.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1411FA8F610077A41E /* t1types.h */; };
-		611E0B6911FA8F610077A41E /* tttypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1511FA8F610077A41E /* tttypes.h */; };
-		611E0B6A11FA8F610077A41E /* t1tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1611FA8F610077A41E /* t1tables.h */; };
-		611E0B6B11FA8F610077A41E /* ttnameid.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1711FA8F610077A41E /* ttnameid.h */; };
-		611E0B6C11FA8F610077A41E /* tttables.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1811FA8F610077A41E /* tttables.h */; };
-		611E0B6D11FA8F610077A41E /* tttags.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1911FA8F610077A41E /* tttags.h */; };
-		611E0B6E11FA8F610077A41E /* ttunpat.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1A11FA8F610077A41E /* ttunpat.h */; };
-		611E0B6F11FA8F610077A41E /* ft2build.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B1B11FA8F610077A41E /* ft2build.h */; };
-		611E0D0611FA8FA50077A41E /* basepic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9911FA8FA50077A41E /* basepic.c */; };
-		611E0D0711FA8FA50077A41E /* basepic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B9A11FA8FA50077A41E /* basepic.h */; };
-		611E0D0811FA8FA50077A41E /* ftadvanc.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9B11FA8FA50077A41E /* ftadvanc.c */; };
-		611E0D0911FA8FA50077A41E /* ftapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9C11FA8FA50077A41E /* ftapi.c */; };
-		611E0D0A11FA8FA50077A41E /* ftbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9D11FA8FA50077A41E /* ftbase.c */; };
-		611E0D0B11FA8FA50077A41E /* ftbase.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0B9E11FA8FA50077A41E /* ftbase.h */; };
-		611E0D0C11FA8FA50077A41E /* ftbbox.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0B9F11FA8FA50077A41E /* ftbbox.c */; };
-		611E0D0E11FA8FA50077A41E /* ftbitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA111FA8FA50077A41E /* ftbitmap.c */; };
-		611E0D0F11FA8FA50077A41E /* ftcalc.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA211FA8FA50077A41E /* ftcalc.c */; };
-		611E0D1111FA8FA50077A41E /* ftdbgmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA411FA8FA50077A41E /* ftdbgmem.c */; };
-		611E0D1211FA8FA50077A41E /* ftdebug.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA511FA8FA50077A41E /* ftdebug.c */; };
-		611E0D1511FA8FA50077A41E /* ftgloadr.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA811FA8FA50077A41E /* ftgloadr.c */; };
-		611E0D1611FA8FA50077A41E /* ftglyph.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BA911FA8FA50077A41E /* ftglyph.c */; };
-		611E0D1811FA8FA50077A41E /* ftinit.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BAB11FA8FA50077A41E /* ftinit.c */; };
-		611E0D1C11FA8FA50077A41E /* ftobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BAF11FA8FA50077A41E /* ftobjs.c */; };
-		611E0D1E11FA8FA50077A41E /* ftoutln.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB111FA8FA50077A41E /* ftoutln.c */; };
-		611E0D2111FA8FA50077A41E /* ftpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB411FA8FA50077A41E /* ftpic.c */; };
-		611E0D2211FA8FA50077A41E /* ftrfork.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB511FA8FA50077A41E /* ftrfork.c */; };
-		611E0D2311FA8FA50077A41E /* ftsnames.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB611FA8FA50077A41E /* ftsnames.c */; };
-		611E0D2411FA8FA50077A41E /* ftstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB711FA8FA50077A41E /* ftstream.c */; };
-		611E0D2511FA8FA50077A41E /* ftstroke.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB811FA8FA50077A41E /* ftstroke.c */; };
-		611E0D2611FA8FA50077A41E /* ftsynth.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BB911FA8FA50077A41E /* ftsynth.c */; };
-		611E0D2711FA8FA50077A41E /* ftsystem.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BBA11FA8FA50077A41E /* ftsystem.c */; };
-		611E0D2811FA8FA50077A41E /* fttrigon.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BBB11FA8FA50077A41E /* fttrigon.c */; };
-		611E0D2A11FA8FA50077A41E /* ftutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BBD11FA8FA50077A41E /* ftutil.c */; };
-		611E0D4411FA8FA50077A41E /* cff.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BDA11FA8FA50077A41E /* cff.c */; };
-		611E0D4511FA8FA50077A41E /* cffcmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BDB11FA8FA50077A41E /* cffcmap.c */; };
-		611E0D4611FA8FA50077A41E /* cffcmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BDC11FA8FA50077A41E /* cffcmap.h */; };
-		611E0D4711FA8FA50077A41E /* cffdrivr.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BDD11FA8FA50077A41E /* cffdrivr.c */; };
-		611E0D4811FA8FA50077A41E /* cffdrivr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BDE11FA8FA50077A41E /* cffdrivr.h */; };
-		611E0D4911FA8FA50077A41E /* cfferrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BDF11FA8FA50077A41E /* cfferrs.h */; };
-		611E0D4A11FA8FA50077A41E /* cffgload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE011FA8FA50077A41E /* cffgload.c */; };
-		611E0D4B11FA8FA50077A41E /* cffgload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE111FA8FA50077A41E /* cffgload.h */; };
-		611E0D4C11FA8FA50077A41E /* cffload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE211FA8FA50077A41E /* cffload.c */; };
-		611E0D4D11FA8FA50077A41E /* cffload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE311FA8FA50077A41E /* cffload.h */; };
-		611E0D4E11FA8FA50077A41E /* cffobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE411FA8FA50077A41E /* cffobjs.c */; };
-		611E0D4F11FA8FA50077A41E /* cffobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE511FA8FA50077A41E /* cffobjs.h */; };
-		611E0D5011FA8FA50077A41E /* cffparse.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE611FA8FA50077A41E /* cffparse.c */; };
-		611E0D5111FA8FA50077A41E /* cffparse.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE711FA8FA50077A41E /* cffparse.h */; };
-		611E0D5211FA8FA50077A41E /* cffpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0BE811FA8FA50077A41E /* cffpic.c */; };
-		611E0D5311FA8FA50077A41E /* cffpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BE911FA8FA50077A41E /* cffpic.h */; };
-		611E0D5411FA8FA50077A41E /* cfftoken.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BEA11FA8FA50077A41E /* cfftoken.h */; };
-		611E0D5511FA8FA50077A41E /* cfftypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0BEB11FA8FA50077A41E /* cfftypes.h */; };
-		611E0DC911FA8FA50077A41E /* pshalgo.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6811FA8FA50077A41E /* pshalgo.c */; };
-		611E0DCA11FA8FA50077A41E /* pshalgo.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6911FA8FA50077A41E /* pshalgo.h */; };
-		611E0DCB11FA8FA50077A41E /* pshglob.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6A11FA8FA50077A41E /* pshglob.c */; };
-		611E0DCC11FA8FA50077A41E /* pshglob.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6B11FA8FA50077A41E /* pshglob.h */; };
-		611E0DCD11FA8FA50077A41E /* pshinter.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6C11FA8FA50077A41E /* pshinter.c */; };
-		611E0DCE11FA8FA50077A41E /* pshmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C6D11FA8FA50077A41E /* pshmod.c */; };
-		611E0DCF11FA8FA50077A41E /* pshmod.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6E11FA8FA50077A41E /* pshmod.h */; };
-		611E0DD011FA8FA50077A41E /* pshnterr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C6F11FA8FA50077A41E /* pshnterr.h */; };
-		611E0DD111FA8FA50077A41E /* pshpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7011FA8FA50077A41E /* pshpic.c */; };
-		611E0DD211FA8FA50077A41E /* pshpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7111FA8FA50077A41E /* pshpic.h */; };
-		611E0DD311FA8FA50077A41E /* pshrec.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7211FA8FA50077A41E /* pshrec.c */; };
-		611E0DD411FA8FA50077A41E /* pshrec.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7311FA8FA50077A41E /* pshrec.h */; };
-		611E0DD511FA8FA50077A41E /* psmodule.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7511FA8FA50077A41E /* psmodule.c */; };
-		611E0DD611FA8FA50077A41E /* psmodule.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7611FA8FA50077A41E /* psmodule.h */; };
-		611E0DD711FA8FA50077A41E /* psnamerr.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7711FA8FA50077A41E /* psnamerr.h */; };
-		611E0DD811FA8FA50077A41E /* psnames.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7811FA8FA50077A41E /* psnames.c */; };
-		611E0DD911FA8FA50077A41E /* pspic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7911FA8FA50077A41E /* pspic.c */; };
-		611E0DDA11FA8FA50077A41E /* pspic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7A11FA8FA50077A41E /* pspic.h */; };
-		611E0DDB11FA8FA50077A41E /* pstables.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7B11FA8FA50077A41E /* pstables.h */; };
-		611E0DDC11FA8FA50077A41E /* ftmisc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7D11FA8FA50077A41E /* ftmisc.h */; };
-		611E0DDD11FA8FA50077A41E /* ftraster.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C7E11FA8FA50077A41E /* ftraster.c */; };
-		611E0DDE11FA8FA50077A41E /* ftraster.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C7F11FA8FA50077A41E /* ftraster.h */; };
-		611E0DDF11FA8FA50077A41E /* ftrend1.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8011FA8FA50077A41E /* ftrend1.c */; };
-		611E0DE011FA8FA50077A41E /* ftrend1.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8111FA8FA50077A41E /* ftrend1.h */; };
-		611E0DE111FA8FA50077A41E /* raster.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8211FA8FA50077A41E /* raster.c */; };
-		611E0DE211FA8FA50077A41E /* rasterrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8311FA8FA50077A41E /* rasterrs.h */; };
-		611E0DE311FA8FA50077A41E /* rastpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8411FA8FA50077A41E /* rastpic.c */; };
-		611E0DE411FA8FA50077A41E /* rastpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8511FA8FA50077A41E /* rastpic.h */; };
-		611E0DE511FA8FA50077A41E /* sfdriver.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8711FA8FA50077A41E /* sfdriver.c */; };
-		611E0DE611FA8FA50077A41E /* sfdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8811FA8FA50077A41E /* sfdriver.h */; };
-		611E0DE711FA8FA50077A41E /* sferrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8911FA8FA50077A41E /* sferrors.h */; };
-		611E0DE811FA8FA50077A41E /* sfnt.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8A11FA8FA50077A41E /* sfnt.c */; };
-		611E0DE911FA8FA50077A41E /* sfntpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8B11FA8FA50077A41E /* sfntpic.c */; };
-		611E0DEA11FA8FA50077A41E /* sfntpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8C11FA8FA50077A41E /* sfntpic.h */; };
-		611E0DEB11FA8FA50077A41E /* sfobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8D11FA8FA50077A41E /* sfobjs.c */; };
-		611E0DEC11FA8FA50077A41E /* sfobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C8E11FA8FA50077A41E /* sfobjs.h */; };
-		611E0DED11FA8FA50077A41E /* ttbdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C8F11FA8FA50077A41E /* ttbdf.c */; };
-		611E0DEE11FA8FA50077A41E /* ttbdf.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9011FA8FA50077A41E /* ttbdf.h */; };
-		611E0DEF11FA8FA50077A41E /* ttcmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9111FA8FA50077A41E /* ttcmap.c */; };
-		611E0DF011FA8FA50077A41E /* ttcmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9211FA8FA50077A41E /* ttcmap.h */; };
-		611E0DF111FA8FA50077A41E /* ttcmapc.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9311FA8FA50077A41E /* ttcmapc.h */; };
-		611E0DF211FA8FA50077A41E /* ttkern.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9411FA8FA50077A41E /* ttkern.c */; };
-		611E0DF311FA8FA50077A41E /* ttkern.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9511FA8FA50077A41E /* ttkern.h */; };
-		611E0DF411FA8FA50077A41E /* ttload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9611FA8FA50077A41E /* ttload.c */; };
-		611E0DF511FA8FA50077A41E /* ttload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9711FA8FA50077A41E /* ttload.h */; };
-		611E0DF611FA8FA50077A41E /* ttmtx.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9811FA8FA50077A41E /* ttmtx.c */; };
-		611E0DF711FA8FA50077A41E /* ttmtx.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9911FA8FA50077A41E /* ttmtx.h */; };
-		611E0DF811FA8FA50077A41E /* ttpost.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9A11FA8FA50077A41E /* ttpost.c */; };
-		611E0DF911FA8FA50077A41E /* ttpost.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9B11FA8FA50077A41E /* ttpost.h */; };
-		611E0DFA11FA8FA50077A41E /* ttsbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9C11FA8FA50077A41E /* ttsbit.c */; };
-		611E0DFB11FA8FA50077A41E /* ttsbit.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0C9D11FA8FA50077A41E /* ttsbit.h */; };
-		611E0DFC11FA8FA50077A41E /* ttsbit0.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0C9E11FA8FA50077A41E /* ttsbit0.c */; };
-		611E0DFD11FA8FA50077A41E /* ftgrays.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA011FA8FA50077A41E /* ftgrays.c */; };
-		611E0DFE11FA8FA50077A41E /* ftgrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA111FA8FA50077A41E /* ftgrays.h */; };
-		611E0DFF11FA8FA50077A41E /* ftsmerrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA211FA8FA50077A41E /* ftsmerrs.h */; };
-		611E0E0011FA8FA50077A41E /* ftsmooth.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA311FA8FA50077A41E /* ftsmooth.c */; };
-		611E0E0111FA8FA50077A41E /* ftsmooth.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA411FA8FA50077A41E /* ftsmooth.h */; };
-		611E0E0211FA8FA50077A41E /* ftspic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA511FA8FA50077A41E /* ftspic.c */; };
-		611E0E0311FA8FA50077A41E /* ftspic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CA611FA8FA50077A41E /* ftspic.h */; };
-		611E0E0411FA8FA50077A41E /* smooth.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CA711FA8FA50077A41E /* smooth.c */; };
-		611E0E0B11FA8FA50077A41E /* truetype.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CBD11FA8FA50077A41E /* truetype.c */; };
-		611E0E0C11FA8FA50077A41E /* ttdriver.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CBE11FA8FA50077A41E /* ttdriver.c */; };
-		611E0E0D11FA8FA50077A41E /* ttdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CBF11FA8FA50077A41E /* ttdriver.h */; };
-		611E0E0E11FA8FA50077A41E /* tterrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC011FA8FA50077A41E /* tterrors.h */; };
-		611E0E0F11FA8FA50077A41E /* ttgload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC111FA8FA50077A41E /* ttgload.c */; };
-		611E0E1011FA8FA50077A41E /* ttgload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC211FA8FA50077A41E /* ttgload.h */; };
-		611E0E1111FA8FA50077A41E /* ttgxvar.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC311FA8FA50077A41E /* ttgxvar.c */; };
-		611E0E1211FA8FA50077A41E /* ttgxvar.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC411FA8FA50077A41E /* ttgxvar.h */; };
-		611E0E1311FA8FA50077A41E /* ttinterp.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC511FA8FA50077A41E /* ttinterp.c */; };
-		611E0E1411FA8FA50077A41E /* ttinterp.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC611FA8FA50077A41E /* ttinterp.h */; };
-		611E0E1511FA8FA50077A41E /* ttobjs.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC711FA8FA50077A41E /* ttobjs.c */; };
-		611E0E1611FA8FA50077A41E /* ttobjs.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CC811FA8FA50077A41E /* ttobjs.h */; };
-		611E0E1711FA8FA50077A41E /* ttpic.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CC911FA8FA50077A41E /* ttpic.c */; };
-		611E0E1811FA8FA50077A41E /* ttpic.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CCA11FA8FA50077A41E /* ttpic.h */; };
-		611E0E1911FA8FA50077A41E /* ttpload.c in Sources */ = {isa = PBXBuildFile; fileRef = 611E0CCB11FA8FA50077A41E /* ttpload.c */; };
-		611E0E1A11FA8FA50077A41E /* ttpload.h in Headers */ = {isa = PBXBuildFile; fileRef = 611E0CCC11FA8FA50077A41E /* ttpload.h */; };
-		AA747D9F0F9514B9006C5449 /* freetype_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* freetype_Prefix.pch */; };
-		AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		611E0AC611FA8F610077A41E /* ftconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftconfig.h; sourceTree = "<group>"; };
-		611E0AC711FA8F610077A41E /* ftheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftheader.h; sourceTree = "<group>"; };
-		611E0AC811FA8F610077A41E /* ftmodule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmodule.h; sourceTree = "<group>"; };
-		611E0AC911FA8F610077A41E /* ftoption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftoption.h; sourceTree = "<group>"; };
-		611E0ACA11FA8F610077A41E /* ftstdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftstdlib.h; sourceTree = "<group>"; };
-		611E0ACB11FA8F610077A41E /* freetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = freetype.h; sourceTree = "<group>"; };
-		611E0ACC11FA8F610077A41E /* ftadvanc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftadvanc.h; sourceTree = "<group>"; };
-		611E0ACD11FA8F610077A41E /* ftbbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbbox.h; sourceTree = "<group>"; };
-		611E0ACE11FA8F610077A41E /* ftbdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbdf.h; sourceTree = "<group>"; };
-		611E0ACF11FA8F610077A41E /* ftbitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbitmap.h; sourceTree = "<group>"; };
-		611E0AD011FA8F610077A41E /* ftcache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftcache.h; sourceTree = "<group>"; };
-		611E0AD111FA8F610077A41E /* ftchapters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftchapters.h; sourceTree = "<group>"; };
-		611E0AD211FA8F610077A41E /* ftcid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftcid.h; sourceTree = "<group>"; };
-		611E0AD311FA8F610077A41E /* fterrdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fterrdef.h; sourceTree = "<group>"; };
-		611E0AD411FA8F610077A41E /* fterrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fterrors.h; sourceTree = "<group>"; };
-		611E0AD511FA8F610077A41E /* ftgasp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgasp.h; sourceTree = "<group>"; };
-		611E0AD611FA8F610077A41E /* ftglyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftglyph.h; sourceTree = "<group>"; };
-		611E0AD711FA8F610077A41E /* ftgxval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgxval.h; sourceTree = "<group>"; };
-		611E0AD811FA8F610077A41E /* ftgzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgzip.h; sourceTree = "<group>"; };
-		611E0AD911FA8F610077A41E /* ftimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftimage.h; sourceTree = "<group>"; };
-		611E0ADA11FA8F610077A41E /* ftincrem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftincrem.h; sourceTree = "<group>"; };
-		611E0ADB11FA8F610077A41E /* ftlcdfil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftlcdfil.h; sourceTree = "<group>"; };
-		611E0ADC11FA8F610077A41E /* ftlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftlist.h; sourceTree = "<group>"; };
-		611E0ADD11FA8F610077A41E /* ftlzw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftlzw.h; sourceTree = "<group>"; };
-		611E0ADE11FA8F610077A41E /* ftmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmac.h; sourceTree = "<group>"; };
-		611E0ADF11FA8F610077A41E /* ftmm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmm.h; sourceTree = "<group>"; };
-		611E0AE011FA8F610077A41E /* ftmodapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmodapi.h; sourceTree = "<group>"; };
-		611E0AE111FA8F610077A41E /* ftmoderr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmoderr.h; sourceTree = "<group>"; };
-		611E0AE211FA8F610077A41E /* ftotval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftotval.h; sourceTree = "<group>"; };
-		611E0AE311FA8F610077A41E /* ftoutln.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftoutln.h; sourceTree = "<group>"; };
-		611E0AE411FA8F610077A41E /* ftpfr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftpfr.h; sourceTree = "<group>"; };
-		611E0AE511FA8F610077A41E /* ftrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftrender.h; sourceTree = "<group>"; };
-		611E0AE611FA8F610077A41E /* ftsizes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsizes.h; sourceTree = "<group>"; };
-		611E0AE711FA8F610077A41E /* ftsnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsnames.h; sourceTree = "<group>"; };
-		611E0AE811FA8F610077A41E /* ftstroke.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftstroke.h; sourceTree = "<group>"; };
-		611E0AE911FA8F610077A41E /* ftsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsynth.h; sourceTree = "<group>"; };
-		611E0AEA11FA8F610077A41E /* ftsystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsystem.h; sourceTree = "<group>"; };
-		611E0AEB11FA8F610077A41E /* fttrigon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fttrigon.h; sourceTree = "<group>"; };
-		611E0AEC11FA8F610077A41E /* fttypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fttypes.h; sourceTree = "<group>"; };
-		611E0AED11FA8F610077A41E /* ftwinfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftwinfnt.h; sourceTree = "<group>"; };
-		611E0AEE11FA8F610077A41E /* ftxf86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftxf86.h; sourceTree = "<group>"; };
-		611E0AF011FA8F610077A41E /* autohint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autohint.h; sourceTree = "<group>"; };
-		611E0AF111FA8F610077A41E /* ftcalc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftcalc.h; sourceTree = "<group>"; };
-		611E0AF211FA8F610077A41E /* ftdebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftdebug.h; sourceTree = "<group>"; };
-		611E0AF311FA8F610077A41E /* ftdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftdriver.h; sourceTree = "<group>"; };
-		611E0AF411FA8F610077A41E /* ftgloadr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgloadr.h; sourceTree = "<group>"; };
-		611E0AF511FA8F610077A41E /* ftmemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmemory.h; sourceTree = "<group>"; };
-		611E0AF611FA8F610077A41E /* ftobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftobjs.h; sourceTree = "<group>"; };
-		611E0AF711FA8F610077A41E /* ftpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftpic.h; sourceTree = "<group>"; };
-		611E0AF811FA8F610077A41E /* ftrfork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftrfork.h; sourceTree = "<group>"; };
-		611E0AF911FA8F610077A41E /* ftserv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftserv.h; sourceTree = "<group>"; };
-		611E0AFA11FA8F610077A41E /* ftstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftstream.h; sourceTree = "<group>"; };
-		611E0AFB11FA8F610077A41E /* fttrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fttrace.h; sourceTree = "<group>"; };
-		611E0AFC11FA8F610077A41E /* ftvalid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftvalid.h; sourceTree = "<group>"; };
-		611E0AFD11FA8F610077A41E /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
-		611E0AFE11FA8F610077A41E /* pcftypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pcftypes.h; sourceTree = "<group>"; };
-		611E0AFF11FA8F610077A41E /* psaux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psaux.h; sourceTree = "<group>"; };
-		611E0B0011FA8F610077A41E /* pshints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshints.h; sourceTree = "<group>"; };
-		611E0B0211FA8F610077A41E /* svbdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svbdf.h; sourceTree = "<group>"; };
-		611E0B0311FA8F610077A41E /* svcid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svcid.h; sourceTree = "<group>"; };
-		611E0B0411FA8F610077A41E /* svgldict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svgldict.h; sourceTree = "<group>"; };
-		611E0B0511FA8F610077A41E /* svgxval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svgxval.h; sourceTree = "<group>"; };
-		611E0B0611FA8F610077A41E /* svkern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svkern.h; sourceTree = "<group>"; };
-		611E0B0711FA8F610077A41E /* svmm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svmm.h; sourceTree = "<group>"; };
-		611E0B0811FA8F610077A41E /* svotval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svotval.h; sourceTree = "<group>"; };
-		611E0B0911FA8F610077A41E /* svpfr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpfr.h; sourceTree = "<group>"; };
-		611E0B0A11FA8F610077A41E /* svpostnm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpostnm.h; sourceTree = "<group>"; };
-		611E0B0B11FA8F610077A41E /* svpscmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpscmap.h; sourceTree = "<group>"; };
-		611E0B0C11FA8F610077A41E /* svpsinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svpsinfo.h; sourceTree = "<group>"; };
-		611E0B0D11FA8F610077A41E /* svsfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svsfnt.h; sourceTree = "<group>"; };
-		611E0B0E11FA8F610077A41E /* svttcmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svttcmap.h; sourceTree = "<group>"; };
-		611E0B0F11FA8F610077A41E /* svtteng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svtteng.h; sourceTree = "<group>"; };
-		611E0B1011FA8F610077A41E /* svttglyf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svttglyf.h; sourceTree = "<group>"; };
-		611E0B1111FA8F610077A41E /* svwinfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svwinfnt.h; sourceTree = "<group>"; };
-		611E0B1211FA8F610077A41E /* svxf86nm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svxf86nm.h; sourceTree = "<group>"; };
-		611E0B1311FA8F610077A41E /* sfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfnt.h; sourceTree = "<group>"; };
-		611E0B1411FA8F610077A41E /* t1types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = t1types.h; sourceTree = "<group>"; };
-		611E0B1511FA8F610077A41E /* tttypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tttypes.h; sourceTree = "<group>"; };
-		611E0B1611FA8F610077A41E /* t1tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = t1tables.h; sourceTree = "<group>"; };
-		611E0B1711FA8F610077A41E /* ttnameid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttnameid.h; sourceTree = "<group>"; };
-		611E0B1811FA8F610077A41E /* tttables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tttables.h; sourceTree = "<group>"; };
-		611E0B1911FA8F610077A41E /* tttags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tttags.h; sourceTree = "<group>"; };
-		611E0B1A11FA8F610077A41E /* ttunpat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttunpat.h; sourceTree = "<group>"; };
-		611E0B1B11FA8F610077A41E /* ft2build.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ft2build.h; path = ../include/ft2build.h; sourceTree = SOURCE_ROOT; };
-		611E0B9911FA8FA50077A41E /* basepic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = basepic.c; sourceTree = "<group>"; };
-		611E0B9A11FA8FA50077A41E /* basepic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basepic.h; sourceTree = "<group>"; };
-		611E0B9B11FA8FA50077A41E /* ftadvanc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftadvanc.c; sourceTree = "<group>"; };
-		611E0B9C11FA8FA50077A41E /* ftapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftapi.c; sourceTree = "<group>"; };
-		611E0B9D11FA8FA50077A41E /* ftbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftbase.c; sourceTree = "<group>"; };
-		611E0B9E11FA8FA50077A41E /* ftbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftbase.h; sourceTree = "<group>"; };
-		611E0B9F11FA8FA50077A41E /* ftbbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftbbox.c; sourceTree = "<group>"; };
-		611E0BA111FA8FA50077A41E /* ftbitmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftbitmap.c; sourceTree = "<group>"; };
-		611E0BA211FA8FA50077A41E /* ftcalc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftcalc.c; sourceTree = "<group>"; };
-		611E0BA411FA8FA50077A41E /* ftdbgmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftdbgmem.c; sourceTree = "<group>"; };
-		611E0BA511FA8FA50077A41E /* ftdebug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftdebug.c; sourceTree = "<group>"; };
-		611E0BA811FA8FA50077A41E /* ftgloadr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftgloadr.c; sourceTree = "<group>"; };
-		611E0BA911FA8FA50077A41E /* ftglyph.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftglyph.c; sourceTree = "<group>"; };
-		611E0BAB11FA8FA50077A41E /* ftinit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftinit.c; sourceTree = "<group>"; };
-		611E0BAF11FA8FA50077A41E /* ftobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftobjs.c; sourceTree = "<group>"; };
-		611E0BB111FA8FA50077A41E /* ftoutln.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftoutln.c; sourceTree = "<group>"; };
-		611E0BB411FA8FA50077A41E /* ftpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftpic.c; sourceTree = "<group>"; };
-		611E0BB511FA8FA50077A41E /* ftrfork.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftrfork.c; sourceTree = "<group>"; };
-		611E0BB611FA8FA50077A41E /* ftsnames.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsnames.c; sourceTree = "<group>"; };
-		611E0BB711FA8FA50077A41E /* ftstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftstream.c; sourceTree = "<group>"; };
-		611E0BB811FA8FA50077A41E /* ftstroke.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftstroke.c; sourceTree = "<group>"; };
-		611E0BB911FA8FA50077A41E /* ftsynth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsynth.c; sourceTree = "<group>"; };
-		611E0BBA11FA8FA50077A41E /* ftsystem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsystem.c; sourceTree = "<group>"; };
-		611E0BBB11FA8FA50077A41E /* fttrigon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fttrigon.c; sourceTree = "<group>"; };
-		611E0BBD11FA8FA50077A41E /* ftutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftutil.c; sourceTree = "<group>"; };
-		611E0BDA11FA8FA50077A41E /* cff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cff.c; sourceTree = "<group>"; };
-		611E0BDB11FA8FA50077A41E /* cffcmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffcmap.c; sourceTree = "<group>"; };
-		611E0BDC11FA8FA50077A41E /* cffcmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffcmap.h; sourceTree = "<group>"; };
-		611E0BDD11FA8FA50077A41E /* cffdrivr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffdrivr.c; sourceTree = "<group>"; };
-		611E0BDE11FA8FA50077A41E /* cffdrivr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffdrivr.h; sourceTree = "<group>"; };
-		611E0BDF11FA8FA50077A41E /* cfferrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfferrs.h; sourceTree = "<group>"; };
-		611E0BE011FA8FA50077A41E /* cffgload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffgload.c; sourceTree = "<group>"; };
-		611E0BE111FA8FA50077A41E /* cffgload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffgload.h; sourceTree = "<group>"; };
-		611E0BE211FA8FA50077A41E /* cffload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffload.c; sourceTree = "<group>"; };
-		611E0BE311FA8FA50077A41E /* cffload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffload.h; sourceTree = "<group>"; };
-		611E0BE411FA8FA50077A41E /* cffobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffobjs.c; sourceTree = "<group>"; };
-		611E0BE511FA8FA50077A41E /* cffobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffobjs.h; sourceTree = "<group>"; };
-		611E0BE611FA8FA50077A41E /* cffparse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffparse.c; sourceTree = "<group>"; };
-		611E0BE711FA8FA50077A41E /* cffparse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffparse.h; sourceTree = "<group>"; };
-		611E0BE811FA8FA50077A41E /* cffpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cffpic.c; sourceTree = "<group>"; };
-		611E0BE911FA8FA50077A41E /* cffpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cffpic.h; sourceTree = "<group>"; };
-		611E0BEA11FA8FA50077A41E /* cfftoken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfftoken.h; sourceTree = "<group>"; };
-		611E0BEB11FA8FA50077A41E /* cfftypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfftypes.h; sourceTree = "<group>"; };
-		611E0C6811FA8FA50077A41E /* pshalgo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshalgo.c; sourceTree = "<group>"; };
-		611E0C6911FA8FA50077A41E /* pshalgo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshalgo.h; sourceTree = "<group>"; };
-		611E0C6A11FA8FA50077A41E /* pshglob.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshglob.c; sourceTree = "<group>"; };
-		611E0C6B11FA8FA50077A41E /* pshglob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshglob.h; sourceTree = "<group>"; };
-		611E0C6C11FA8FA50077A41E /* pshinter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshinter.c; sourceTree = "<group>"; };
-		611E0C6D11FA8FA50077A41E /* pshmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshmod.c; sourceTree = "<group>"; };
-		611E0C6E11FA8FA50077A41E /* pshmod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshmod.h; sourceTree = "<group>"; };
-		611E0C6F11FA8FA50077A41E /* pshnterr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshnterr.h; sourceTree = "<group>"; };
-		611E0C7011FA8FA50077A41E /* pshpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshpic.c; sourceTree = "<group>"; };
-		611E0C7111FA8FA50077A41E /* pshpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshpic.h; sourceTree = "<group>"; };
-		611E0C7211FA8FA50077A41E /* pshrec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pshrec.c; sourceTree = "<group>"; };
-		611E0C7311FA8FA50077A41E /* pshrec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pshrec.h; sourceTree = "<group>"; };
-		611E0C7511FA8FA50077A41E /* psmodule.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psmodule.c; sourceTree = "<group>"; };
-		611E0C7611FA8FA50077A41E /* psmodule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psmodule.h; sourceTree = "<group>"; };
-		611E0C7711FA8FA50077A41E /* psnamerr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psnamerr.h; sourceTree = "<group>"; };
-		611E0C7811FA8FA50077A41E /* psnames.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psnames.c; sourceTree = "<group>"; };
-		611E0C7911FA8FA50077A41E /* pspic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pspic.c; sourceTree = "<group>"; };
-		611E0C7A11FA8FA50077A41E /* pspic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pspic.h; sourceTree = "<group>"; };
-		611E0C7B11FA8FA50077A41E /* pstables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pstables.h; sourceTree = "<group>"; };
-		611E0C7D11FA8FA50077A41E /* ftmisc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftmisc.h; sourceTree = "<group>"; };
-		611E0C7E11FA8FA50077A41E /* ftraster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftraster.c; sourceTree = "<group>"; };
-		611E0C7F11FA8FA50077A41E /* ftraster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftraster.h; sourceTree = "<group>"; };
-		611E0C8011FA8FA50077A41E /* ftrend1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftrend1.c; sourceTree = "<group>"; };
-		611E0C8111FA8FA50077A41E /* ftrend1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftrend1.h; sourceTree = "<group>"; };
-		611E0C8211FA8FA50077A41E /* raster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raster.c; sourceTree = "<group>"; };
-		611E0C8311FA8FA50077A41E /* rasterrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rasterrs.h; sourceTree = "<group>"; };
-		611E0C8411FA8FA50077A41E /* rastpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rastpic.c; sourceTree = "<group>"; };
-		611E0C8511FA8FA50077A41E /* rastpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rastpic.h; sourceTree = "<group>"; };
-		611E0C8711FA8FA50077A41E /* sfdriver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfdriver.c; sourceTree = "<group>"; };
-		611E0C8811FA8FA50077A41E /* sfdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfdriver.h; sourceTree = "<group>"; };
-		611E0C8911FA8FA50077A41E /* sferrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sferrors.h; sourceTree = "<group>"; };
-		611E0C8A11FA8FA50077A41E /* sfnt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfnt.c; sourceTree = "<group>"; };
-		611E0C8B11FA8FA50077A41E /* sfntpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfntpic.c; sourceTree = "<group>"; };
-		611E0C8C11FA8FA50077A41E /* sfntpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfntpic.h; sourceTree = "<group>"; };
-		611E0C8D11FA8FA50077A41E /* sfobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sfobjs.c; sourceTree = "<group>"; };
-		611E0C8E11FA8FA50077A41E /* sfobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sfobjs.h; sourceTree = "<group>"; };
-		611E0C8F11FA8FA50077A41E /* ttbdf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttbdf.c; sourceTree = "<group>"; };
-		611E0C9011FA8FA50077A41E /* ttbdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttbdf.h; sourceTree = "<group>"; };
-		611E0C9111FA8FA50077A41E /* ttcmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttcmap.c; sourceTree = "<group>"; };
-		611E0C9211FA8FA50077A41E /* ttcmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttcmap.h; sourceTree = "<group>"; };
-		611E0C9311FA8FA50077A41E /* ttcmapc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttcmapc.h; sourceTree = "<group>"; };
-		611E0C9411FA8FA50077A41E /* ttkern.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkern.c; sourceTree = "<group>"; };
-		611E0C9511FA8FA50077A41E /* ttkern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkern.h; sourceTree = "<group>"; };
-		611E0C9611FA8FA50077A41E /* ttload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttload.c; sourceTree = "<group>"; };
-		611E0C9711FA8FA50077A41E /* ttload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttload.h; sourceTree = "<group>"; };
-		611E0C9811FA8FA50077A41E /* ttmtx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttmtx.c; sourceTree = "<group>"; };
-		611E0C9911FA8FA50077A41E /* ttmtx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttmtx.h; sourceTree = "<group>"; };
-		611E0C9A11FA8FA50077A41E /* ttpost.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttpost.c; sourceTree = "<group>"; };
-		611E0C9B11FA8FA50077A41E /* ttpost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttpost.h; sourceTree = "<group>"; };
-		611E0C9C11FA8FA50077A41E /* ttsbit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttsbit.c; sourceTree = "<group>"; };
-		611E0C9D11FA8FA50077A41E /* ttsbit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttsbit.h; sourceTree = "<group>"; };
-		611E0C9E11FA8FA50077A41E /* ttsbit0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttsbit0.c; sourceTree = "<group>"; };
-		611E0CA011FA8FA50077A41E /* ftgrays.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftgrays.c; sourceTree = "<group>"; };
-		611E0CA111FA8FA50077A41E /* ftgrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftgrays.h; sourceTree = "<group>"; };
-		611E0CA211FA8FA50077A41E /* ftsmerrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsmerrs.h; sourceTree = "<group>"; };
-		611E0CA311FA8FA50077A41E /* ftsmooth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftsmooth.c; sourceTree = "<group>"; };
-		611E0CA411FA8FA50077A41E /* ftsmooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftsmooth.h; sourceTree = "<group>"; };
-		611E0CA511FA8FA50077A41E /* ftspic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftspic.c; sourceTree = "<group>"; };
-		611E0CA611FA8FA50077A41E /* ftspic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftspic.h; sourceTree = "<group>"; };
-		611E0CA711FA8FA50077A41E /* smooth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smooth.c; sourceTree = "<group>"; };
-		611E0CBD11FA8FA50077A41E /* truetype.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = truetype.c; sourceTree = "<group>"; };
-		611E0CBE11FA8FA50077A41E /* ttdriver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttdriver.c; sourceTree = "<group>"; };
-		611E0CBF11FA8FA50077A41E /* ttdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttdriver.h; sourceTree = "<group>"; };
-		611E0CC011FA8FA50077A41E /* tterrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tterrors.h; sourceTree = "<group>"; };
-		611E0CC111FA8FA50077A41E /* ttgload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttgload.c; sourceTree = "<group>"; };
-		611E0CC211FA8FA50077A41E /* ttgload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttgload.h; sourceTree = "<group>"; };
-		611E0CC311FA8FA50077A41E /* ttgxvar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttgxvar.c; sourceTree = "<group>"; };
-		611E0CC411FA8FA50077A41E /* ttgxvar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttgxvar.h; sourceTree = "<group>"; };
-		611E0CC511FA8FA50077A41E /* ttinterp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttinterp.c; sourceTree = "<group>"; };
-		611E0CC611FA8FA50077A41E /* ttinterp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttinterp.h; sourceTree = "<group>"; };
-		611E0CC711FA8FA50077A41E /* ttobjs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttobjs.c; sourceTree = "<group>"; };
-		611E0CC811FA8FA50077A41E /* ttobjs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttobjs.h; sourceTree = "<group>"; };
-		611E0CC911FA8FA50077A41E /* ttpic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttpic.c; sourceTree = "<group>"; };
-		611E0CCA11FA8FA50077A41E /* ttpic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttpic.h; sourceTree = "<group>"; };
-		611E0CCB11FA8FA50077A41E /* ttpload.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttpload.c; sourceTree = "<group>"; };
-		611E0CCC11FA8FA50077A41E /* ttpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttpload.h; sourceTree = "<group>"; };
-		AA747D9E0F9514B9006C5449 /* freetype_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = freetype_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 /* libFreetype.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFreetype.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 /* libFreetype.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		0867D691FE84028FC02AAC07 /* freetype */ = {
-			isa = PBXGroup;
-			children = (
-				08FB77AEFE84172EC02AAC07 /* Source */,
-				32C88DFF0371C24200C91783 /* Public Headers */,
-				0867D69AFE84028FC02AAC07 /* Frameworks */,
-				034768DFFF38A50411DB9C8B /* Products */,
-			);
-			name = freetype;
-			sourceTree = "<group>";
-		};
-		0867D69AFE84028FC02AAC07 /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				AACBBE490F95108600F1A2B1 /* Foundation.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-		08FB77AEFE84172EC02AAC07 /* Source */ = {
-			isa = PBXGroup;
-			children = (
-				611E0B9811FA8FA50077A41E /* base */,
-				611E0BD911FA8FA50077A41E /* cff */,
-				611E0C6711FA8FA50077A41E /* pshinter */,
-				611E0C7411FA8FA50077A41E /* psnames */,
-				611E0C7C11FA8FA50077A41E /* raster */,
-				611E0C8611FA8FA50077A41E /* sfnt */,
-				611E0C9F11FA8FA50077A41E /* smooth */,
-				611E0CBC11FA8FA50077A41E /* truetype */,
-			);
-			name = Source;
-			sourceTree = "<group>";
-		};
-		32C88DFF0371C24200C91783 /* Public Headers */ = {
-			isa = PBXGroup;
-			children = (
-				611E0AC411FA8F610077A41E /* freetype */,
-				611E0B1B11FA8F610077A41E /* ft2build.h */,
-				AA747D9E0F9514B9006C5449 /* freetype_Prefix.pch */,
-			);
-			name = "Public Headers";
-			sourceTree = "<group>";
-		};
-		611E0AC411FA8F610077A41E /* freetype */ = {
-			isa = PBXGroup;
-			children = (
-				611E0AC511FA8F610077A41E /* config */,
-				611E0ACB11FA8F610077A41E /* freetype.h */,
-				611E0ACC11FA8F610077A41E /* ftadvanc.h */,
-				611E0ACD11FA8F610077A41E /* ftbbox.h */,
-				611E0ACE11FA8F610077A41E /* ftbdf.h */,
-				611E0ACF11FA8F610077A41E /* ftbitmap.h */,
-				611E0AD011FA8F610077A41E /* ftcache.h */,
-				611E0AD111FA8F610077A41E /* ftchapters.h */,
-				611E0AD211FA8F610077A41E /* ftcid.h */,
-				611E0AD311FA8F610077A41E /* fterrdef.h */,
-				611E0AD411FA8F610077A41E /* fterrors.h */,
-				611E0AD511FA8F610077A41E /* ftgasp.h */,
-				611E0AD611FA8F610077A41E /* ftglyph.h */,
-				611E0AD711FA8F610077A41E /* ftgxval.h */,
-				611E0AD811FA8F610077A41E /* ftgzip.h */,
-				611E0AD911FA8F610077A41E /* ftimage.h */,
-				611E0ADA11FA8F610077A41E /* ftincrem.h */,
-				611E0ADB11FA8F610077A41E /* ftlcdfil.h */,
-				611E0ADC11FA8F610077A41E /* ftlist.h */,
-				611E0ADD11FA8F610077A41E /* ftlzw.h */,
-				611E0ADE11FA8F610077A41E /* ftmac.h */,
-				611E0ADF11FA8F610077A41E /* ftmm.h */,
-				611E0AE011FA8F610077A41E /* ftmodapi.h */,
-				611E0AE111FA8F610077A41E /* ftmoderr.h */,
-				611E0AE211FA8F610077A41E /* ftotval.h */,
-				611E0AE311FA8F610077A41E /* ftoutln.h */,
-				611E0AE411FA8F610077A41E /* ftpfr.h */,
-				611E0AE511FA8F610077A41E /* ftrender.h */,
-				611E0AE611FA8F610077A41E /* ftsizes.h */,
-				611E0AE711FA8F610077A41E /* ftsnames.h */,
-				611E0AE811FA8F610077A41E /* ftstroke.h */,
-				611E0AE911FA8F610077A41E /* ftsynth.h */,
-				611E0AEA11FA8F610077A41E /* ftsystem.h */,
-				611E0AEB11FA8F610077A41E /* fttrigon.h */,
-				611E0AEC11FA8F610077A41E /* fttypes.h */,
-				611E0AED11FA8F610077A41E /* ftwinfnt.h */,
-				611E0AEE11FA8F610077A41E /* ftxf86.h */,
-				611E0AEF11FA8F610077A41E /* internal */,
-				611E0B1611FA8F610077A41E /* t1tables.h */,
-				611E0B1711FA8F610077A41E /* ttnameid.h */,
-				611E0B1811FA8F610077A41E /* tttables.h */,
-				611E0B1911FA8F610077A41E /* tttags.h */,
-				611E0B1A11FA8F610077A41E /* ttunpat.h */,
-			);
-			name = freetype;
-			path = ../include/freetype;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0AC511FA8F610077A41E /* config */ = {
-			isa = PBXGroup;
-			children = (
-				611E0AC611FA8F610077A41E /* ftconfig.h */,
-				611E0AC711FA8F610077A41E /* ftheader.h */,
-				611E0AC811FA8F610077A41E /* ftmodule.h */,
-				611E0AC911FA8F610077A41E /* ftoption.h */,
-				611E0ACA11FA8F610077A41E /* ftstdlib.h */,
-			);
-			path = config;
-			sourceTree = "<group>";
-		};
-		611E0AEF11FA8F610077A41E /* internal */ = {
-			isa = PBXGroup;
-			children = (
-				611E0AF011FA8F610077A41E /* autohint.h */,
-				611E0AF111FA8F610077A41E /* ftcalc.h */,
-				611E0AF211FA8F610077A41E /* ftdebug.h */,
-				611E0AF311FA8F610077A41E /* ftdriver.h */,
-				611E0AF411FA8F610077A41E /* ftgloadr.h */,
-				611E0AF511FA8F610077A41E /* ftmemory.h */,
-				611E0AF611FA8F610077A41E /* ftobjs.h */,
-				611E0AF711FA8F610077A41E /* ftpic.h */,
-				611E0AF811FA8F610077A41E /* ftrfork.h */,
-				611E0AF911FA8F610077A41E /* ftserv.h */,
-				611E0AFA11FA8F610077A41E /* ftstream.h */,
-				611E0AFB11FA8F610077A41E /* fttrace.h */,
-				611E0AFC11FA8F610077A41E /* ftvalid.h */,
-				611E0AFD11FA8F610077A41E /* internal.h */,
-				611E0AFE11FA8F610077A41E /* pcftypes.h */,
-				611E0AFF11FA8F610077A41E /* psaux.h */,
-				611E0B0011FA8F610077A41E /* pshints.h */,
-				611E0B0111FA8F610077A41E /* services */,
-				611E0B1311FA8F610077A41E /* sfnt.h */,
-				611E0B1411FA8F610077A41E /* t1types.h */,
-				611E0B1511FA8F610077A41E /* tttypes.h */,
-			);
-			path = internal;
-			sourceTree = "<group>";
-		};
-		611E0B0111FA8F610077A41E /* services */ = {
-			isa = PBXGroup;
-			children = (
-				611E0B0211FA8F610077A41E /* svbdf.h */,
-				611E0B0311FA8F610077A41E /* svcid.h */,
-				611E0B0411FA8F610077A41E /* svgldict.h */,
-				611E0B0511FA8F610077A41E /* svgxval.h */,
-				611E0B0611FA8F610077A41E /* svkern.h */,
-				611E0B0711FA8F610077A41E /* svmm.h */,
-				611E0B0811FA8F610077A41E /* svotval.h */,
-				611E0B0911FA8F610077A41E /* svpfr.h */,
-				611E0B0A11FA8F610077A41E /* svpostnm.h */,
-				611E0B0B11FA8F610077A41E /* svpscmap.h */,
-				611E0B0C11FA8F610077A41E /* svpsinfo.h */,
-				611E0B0D11FA8F610077A41E /* svsfnt.h */,
-				611E0B0E11FA8F610077A41E /* svttcmap.h */,
-				611E0B0F11FA8F610077A41E /* svtteng.h */,
-				611E0B1011FA8F610077A41E /* svttglyf.h */,
-				611E0B1111FA8F610077A41E /* svwinfnt.h */,
-				611E0B1211FA8F610077A41E /* svxf86nm.h */,
-			);
-			path = services;
-			sourceTree = "<group>";
-		};
-		611E0B9811FA8FA50077A41E /* base */ = {
-			isa = PBXGroup;
-			children = (
-				611E0B9911FA8FA50077A41E /* basepic.c */,
-				611E0B9A11FA8FA50077A41E /* basepic.h */,
-				611E0B9B11FA8FA50077A41E /* ftadvanc.c */,
-				611E0B9C11FA8FA50077A41E /* ftapi.c */,
-				611E0B9D11FA8FA50077A41E /* ftbase.c */,
-				611E0B9E11FA8FA50077A41E /* ftbase.h */,
-				611E0B9F11FA8FA50077A41E /* ftbbox.c */,
-				611E0BA111FA8FA50077A41E /* ftbitmap.c */,
-				611E0BA211FA8FA50077A41E /* ftcalc.c */,
-				611E0BA411FA8FA50077A41E /* ftdbgmem.c */,
-				611E0BA511FA8FA50077A41E /* ftdebug.c */,
-				611E0BA811FA8FA50077A41E /* ftgloadr.c */,
-				611E0BA911FA8FA50077A41E /* ftglyph.c */,
-				611E0BAB11FA8FA50077A41E /* ftinit.c */,
-				611E0BAF11FA8FA50077A41E /* ftobjs.c */,
-				611E0BB111FA8FA50077A41E /* ftoutln.c */,
-				611E0BB411FA8FA50077A41E /* ftpic.c */,
-				611E0BB511FA8FA50077A41E /* ftrfork.c */,
-				611E0BB611FA8FA50077A41E /* ftsnames.c */,
-				611E0BB711FA8FA50077A41E /* ftstream.c */,
-				611E0BB811FA8FA50077A41E /* ftstroke.c */,
-				611E0BB911FA8FA50077A41E /* ftsynth.c */,
-				611E0BBA11FA8FA50077A41E /* ftsystem.c */,
-				611E0BBB11FA8FA50077A41E /* fttrigon.c */,
-				611E0BBD11FA8FA50077A41E /* ftutil.c */,
-			);
-			name = base;
-			path = ../src/base;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0BD911FA8FA50077A41E /* cff */ = {
-			isa = PBXGroup;
-			children = (
-				611E0BDA11FA8FA50077A41E /* cff.c */,
-				611E0BDB11FA8FA50077A41E /* cffcmap.c */,
-				611E0BDC11FA8FA50077A41E /* cffcmap.h */,
-				611E0BDD11FA8FA50077A41E /* cffdrivr.c */,
-				611E0BDE11FA8FA50077A41E /* cffdrivr.h */,
-				611E0BDF11FA8FA50077A41E /* cfferrs.h */,
-				611E0BE011FA8FA50077A41E /* cffgload.c */,
-				611E0BE111FA8FA50077A41E /* cffgload.h */,
-				611E0BE211FA8FA50077A41E /* cffload.c */,
-				611E0BE311FA8FA50077A41E /* cffload.h */,
-				611E0BE411FA8FA50077A41E /* cffobjs.c */,
-				611E0BE511FA8FA50077A41E /* cffobjs.h */,
-				611E0BE611FA8FA50077A41E /* cffparse.c */,
-				611E0BE711FA8FA50077A41E /* cffparse.h */,
-				611E0BE811FA8FA50077A41E /* cffpic.c */,
-				611E0BE911FA8FA50077A41E /* cffpic.h */,
-				611E0BEA11FA8FA50077A41E /* cfftoken.h */,
-				611E0BEB11FA8FA50077A41E /* cfftypes.h */,
-			);
-			name = cff;
-			path = ../src/cff;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0C6711FA8FA50077A41E /* pshinter */ = {
-			isa = PBXGroup;
-			children = (
-				611E0C6811FA8FA50077A41E /* pshalgo.c */,
-				611E0C6911FA8FA50077A41E /* pshalgo.h */,
-				611E0C6A11FA8FA50077A41E /* pshglob.c */,
-				611E0C6B11FA8FA50077A41E /* pshglob.h */,
-				611E0C6C11FA8FA50077A41E /* pshinter.c */,
-				611E0C6D11FA8FA50077A41E /* pshmod.c */,
-				611E0C6E11FA8FA50077A41E /* pshmod.h */,
-				611E0C6F11FA8FA50077A41E /* pshnterr.h */,
-				611E0C7011FA8FA50077A41E /* pshpic.c */,
-				611E0C7111FA8FA50077A41E /* pshpic.h */,
-				611E0C7211FA8FA50077A41E /* pshrec.c */,
-				611E0C7311FA8FA50077A41E /* pshrec.h */,
-			);
-			name = pshinter;
-			path = ../src/pshinter;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0C7411FA8FA50077A41E /* psnames */ = {
-			isa = PBXGroup;
-			children = (
-				611E0C7511FA8FA50077A41E /* psmodule.c */,
-				611E0C7611FA8FA50077A41E /* psmodule.h */,
-				611E0C7711FA8FA50077A41E /* psnamerr.h */,
-				611E0C7811FA8FA50077A41E /* psnames.c */,
-				611E0C7911FA8FA50077A41E /* pspic.c */,
-				611E0C7A11FA8FA50077A41E /* pspic.h */,
-				611E0C7B11FA8FA50077A41E /* pstables.h */,
-			);
-			name = psnames;
-			path = ../src/psnames;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0C7C11FA8FA50077A41E /* raster */ = {
-			isa = PBXGroup;
-			children = (
-				611E0C7D11FA8FA50077A41E /* ftmisc.h */,
-				611E0C7E11FA8FA50077A41E /* ftraster.c */,
-				611E0C7F11FA8FA50077A41E /* ftraster.h */,
-				611E0C8011FA8FA50077A41E /* ftrend1.c */,
-				611E0C8111FA8FA50077A41E /* ftrend1.h */,
-				611E0C8211FA8FA50077A41E /* raster.c */,
-				611E0C8311FA8FA50077A41E /* rasterrs.h */,
-				611E0C8411FA8FA50077A41E /* rastpic.c */,
-				611E0C8511FA8FA50077A41E /* rastpic.h */,
-			);
-			name = raster;
-			path = ../src/raster;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0C8611FA8FA50077A41E /* sfnt */ = {
-			isa = PBXGroup;
-			children = (
-				611E0C8711FA8FA50077A41E /* sfdriver.c */,
-				611E0C8811FA8FA50077A41E /* sfdriver.h */,
-				611E0C8911FA8FA50077A41E /* sferrors.h */,
-				611E0C8A11FA8FA50077A41E /* sfnt.c */,
-				611E0C8B11FA8FA50077A41E /* sfntpic.c */,
-				611E0C8C11FA8FA50077A41E /* sfntpic.h */,
-				611E0C8D11FA8FA50077A41E /* sfobjs.c */,
-				611E0C8E11FA8FA50077A41E /* sfobjs.h */,
-				611E0C8F11FA8FA50077A41E /* ttbdf.c */,
-				611E0C9011FA8FA50077A41E /* ttbdf.h */,
-				611E0C9111FA8FA50077A41E /* ttcmap.c */,
-				611E0C9211FA8FA50077A41E /* ttcmap.h */,
-				611E0C9311FA8FA50077A41E /* ttcmapc.h */,
-				611E0C9411FA8FA50077A41E /* ttkern.c */,
-				611E0C9511FA8FA50077A41E /* ttkern.h */,
-				611E0C9611FA8FA50077A41E /* ttload.c */,
-				611E0C9711FA8FA50077A41E /* ttload.h */,
-				611E0C9811FA8FA50077A41E /* ttmtx.c */,
-				611E0C9911FA8FA50077A41E /* ttmtx.h */,
-				611E0C9A11FA8FA50077A41E /* ttpost.c */,
-				611E0C9B11FA8FA50077A41E /* ttpost.h */,
-				611E0C9C11FA8FA50077A41E /* ttsbit.c */,
-				611E0C9D11FA8FA50077A41E /* ttsbit.h */,
-				611E0C9E11FA8FA50077A41E /* ttsbit0.c */,
-			);
-			name = sfnt;
-			path = ../src/sfnt;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0C9F11FA8FA50077A41E /* smooth */ = {
-			isa = PBXGroup;
-			children = (
-				611E0CA011FA8FA50077A41E /* ftgrays.c */,
-				611E0CA111FA8FA50077A41E /* ftgrays.h */,
-				611E0CA211FA8FA50077A41E /* ftsmerrs.h */,
-				611E0CA311FA8FA50077A41E /* ftsmooth.c */,
-				611E0CA411FA8FA50077A41E /* ftsmooth.h */,
-				611E0CA511FA8FA50077A41E /* ftspic.c */,
-				611E0CA611FA8FA50077A41E /* ftspic.h */,
-				611E0CA711FA8FA50077A41E /* smooth.c */,
-			);
-			name = smooth;
-			path = ../src/smooth;
-			sourceTree = SOURCE_ROOT;
-		};
-		611E0CBC11FA8FA50077A41E /* truetype */ = {
-			isa = PBXGroup;
-			children = (
-				611E0CBD11FA8FA50077A41E /* truetype.c */,
-				611E0CBE11FA8FA50077A41E /* ttdriver.c */,
-				611E0CBF11FA8FA50077A41E /* ttdriver.h */,
-				611E0CC011FA8FA50077A41E /* tterrors.h */,
-				611E0CC111FA8FA50077A41E /* ttgload.c */,
-				611E0CC211FA8FA50077A41E /* ttgload.h */,
-				611E0CC311FA8FA50077A41E /* ttgxvar.c */,
-				611E0CC411FA8FA50077A41E /* ttgxvar.h */,
-				611E0CC511FA8FA50077A41E /* ttinterp.c */,
-				611E0CC611FA8FA50077A41E /* ttinterp.h */,
-				611E0CC711FA8FA50077A41E /* ttobjs.c */,
-				611E0CC811FA8FA50077A41E /* ttobjs.h */,
-				611E0CC911FA8FA50077A41E /* ttpic.c */,
-				611E0CCA11FA8FA50077A41E /* ttpic.h */,
-				611E0CCB11FA8FA50077A41E /* ttpload.c */,
-				611E0CCC11FA8FA50077A41E /* ttpload.h */,
-			);
-			name = truetype;
-			path = ../src/truetype;
-			sourceTree = SOURCE_ROOT;
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		D2AAC07A0554694100DB518D /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA747D9F0F9514B9006C5449 /* freetype_Prefix.pch in Headers */,
-				611E0B1C11FA8F610077A41E /* ftconfig.h in Headers */,
-				611E0B1D11FA8F610077A41E /* ftheader.h in Headers */,
-				611E0B1E11FA8F610077A41E /* ftmodule.h in Headers */,
-				611E0B1F11FA8F610077A41E /* ftoption.h in Headers */,
-				611E0B2011FA8F610077A41E /* ftstdlib.h in Headers */,
-				611E0B2111FA8F610077A41E /* freetype.h in Headers */,
-				611E0B2211FA8F610077A41E /* ftadvanc.h in Headers */,
-				611E0B2311FA8F610077A41E /* ftbbox.h in Headers */,
-				611E0B2411FA8F610077A41E /* ftbdf.h in Headers */,
-				611E0B2511FA8F610077A41E /* ftbitmap.h in Headers */,
-				611E0B2611FA8F610077A41E /* ftcache.h in Headers */,
-				611E0B2711FA8F610077A41E /* ftchapters.h in Headers */,
-				611E0B2811FA8F610077A41E /* ftcid.h in Headers */,
-				611E0B2911FA8F610077A41E /* fterrdef.h in Headers */,
-				611E0B2A11FA8F610077A41E /* fterrors.h in Headers */,
-				611E0B2B11FA8F610077A41E /* ftgasp.h in Headers */,
-				611E0B2C11FA8F610077A41E /* ftglyph.h in Headers */,
-				611E0B2D11FA8F610077A41E /* ftgxval.h in Headers */,
-				611E0B2E11FA8F610077A41E /* ftgzip.h in Headers */,
-				611E0B2F11FA8F610077A41E /* ftimage.h in Headers */,
-				611E0B3011FA8F610077A41E /* ftincrem.h in Headers */,
-				611E0B3111FA8F610077A41E /* ftlcdfil.h in Headers */,
-				611E0B3211FA8F610077A41E /* ftlist.h in Headers */,
-				611E0B3311FA8F610077A41E /* ftlzw.h in Headers */,
-				611E0B3411FA8F610077A41E /* ftmac.h in Headers */,
-				611E0B3511FA8F610077A41E /* ftmm.h in Headers */,
-				611E0B3611FA8F610077A41E /* ftmodapi.h in Headers */,
-				611E0B3711FA8F610077A41E /* ftmoderr.h in Headers */,
-				611E0B3811FA8F610077A41E /* ftotval.h in Headers */,
-				611E0B3911FA8F610077A41E /* ftoutln.h in Headers */,
-				611E0B3A11FA8F610077A41E /* ftpfr.h in Headers */,
-				611E0B3B11FA8F610077A41E /* ftrender.h in Headers */,
-				611E0B3C11FA8F610077A41E /* ftsizes.h in Headers */,
-				611E0B3D11FA8F610077A41E /* ftsnames.h in Headers */,
-				611E0B3E11FA8F610077A41E /* ftstroke.h in Headers */,
-				611E0B3F11FA8F610077A41E /* ftsynth.h in Headers */,
-				611E0B4011FA8F610077A41E /* ftsystem.h in Headers */,
-				611E0B4111FA8F610077A41E /* fttrigon.h in Headers */,
-				611E0B4211FA8F610077A41E /* fttypes.h in Headers */,
-				611E0B4311FA8F610077A41E /* ftwinfnt.h in Headers */,
-				611E0B4411FA8F610077A41E /* ftxf86.h in Headers */,
-				611E0B4511FA8F610077A41E /* autohint.h in Headers */,
-				611E0B4611FA8F610077A41E /* ftcalc.h in Headers */,
-				611E0B4711FA8F610077A41E /* ftdebug.h in Headers */,
-				611E0B4811FA8F610077A41E /* ftdriver.h in Headers */,
-				611E0B4911FA8F610077A41E /* ftgloadr.h in Headers */,
-				611E0B4A11FA8F610077A41E /* ftmemory.h in Headers */,
-				611E0B4B11FA8F610077A41E /* ftobjs.h in Headers */,
-				611E0B4C11FA8F610077A41E /* ftpic.h in Headers */,
-				611E0B4D11FA8F610077A41E /* ftrfork.h in Headers */,
-				611E0B4E11FA8F610077A41E /* ftserv.h in Headers */,
-				611E0B4F11FA8F610077A41E /* ftstream.h in Headers */,
-				611E0B5011FA8F610077A41E /* fttrace.h in Headers */,
-				611E0B5111FA8F610077A41E /* ftvalid.h in Headers */,
-				611E0B5211FA8F610077A41E /* internal.h in Headers */,
-				611E0B5311FA8F610077A41E /* pcftypes.h in Headers */,
-				611E0B5411FA8F610077A41E /* psaux.h in Headers */,
-				611E0B5511FA8F610077A41E /* pshints.h in Headers */,
-				611E0B5611FA8F610077A41E /* svbdf.h in Headers */,
-				611E0B5711FA8F610077A41E /* svcid.h in Headers */,
-				611E0B5811FA8F610077A41E /* svgldict.h in Headers */,
-				611E0B5911FA8F610077A41E /* svgxval.h in Headers */,
-				611E0B5A11FA8F610077A41E /* svkern.h in Headers */,
-				611E0B5B11FA8F610077A41E /* svmm.h in Headers */,
-				611E0B5C11FA8F610077A41E /* svotval.h in Headers */,
-				611E0B5D11FA8F610077A41E /* svpfr.h in Headers */,
-				611E0B5E11FA8F610077A41E /* svpostnm.h in Headers */,
-				611E0B5F11FA8F610077A41E /* svpscmap.h in Headers */,
-				611E0B6011FA8F610077A41E /* svpsinfo.h in Headers */,
-				611E0B6111FA8F610077A41E /* svsfnt.h in Headers */,
-				611E0B6211FA8F610077A41E /* svttcmap.h in Headers */,
-				611E0B6311FA8F610077A41E /* svtteng.h in Headers */,
-				611E0B6411FA8F610077A41E /* svttglyf.h in Headers */,
-				611E0B6511FA8F610077A41E /* svwinfnt.h in Headers */,
-				611E0B6611FA8F610077A41E /* svxf86nm.h in Headers */,
-				611E0B6711FA8F610077A41E /* sfnt.h in Headers */,
-				611E0B6811FA8F610077A41E /* t1types.h in Headers */,
-				611E0B6911FA8F610077A41E /* tttypes.h in Headers */,
-				611E0B6A11FA8F610077A41E /* t1tables.h in Headers */,
-				611E0B6B11FA8F610077A41E /* ttnameid.h in Headers */,
-				611E0B6C11FA8F610077A41E /* tttables.h in Headers */,
-				611E0B6D11FA8F610077A41E /* tttags.h in Headers */,
-				611E0B6E11FA8F610077A41E /* ttunpat.h in Headers */,
-				611E0B6F11FA8F610077A41E /* ft2build.h in Headers */,
-				611E0D0711FA8FA50077A41E /* basepic.h in Headers */,
-				611E0D0B11FA8FA50077A41E /* ftbase.h in Headers */,
-				611E0D4611FA8FA50077A41E /* cffcmap.h in Headers */,
-				611E0D4811FA8FA50077A41E /* cffdrivr.h in Headers */,
-				611E0D4911FA8FA50077A41E /* cfferrs.h in Headers */,
-				611E0D4B11FA8FA50077A41E /* cffgload.h in Headers */,
-				611E0D4D11FA8FA50077A41E /* cffload.h in Headers */,
-				611E0D4F11FA8FA50077A41E /* cffobjs.h in Headers */,
-				611E0D5111FA8FA50077A41E /* cffparse.h in Headers */,
-				611E0D5311FA8FA50077A41E /* cffpic.h in Headers */,
-				611E0D5411FA8FA50077A41E /* cfftoken.h in Headers */,
-				611E0D5511FA8FA50077A41E /* cfftypes.h in Headers */,
-				611E0DCA11FA8FA50077A41E /* pshalgo.h in Headers */,
-				611E0DCC11FA8FA50077A41E /* pshglob.h in Headers */,
-				611E0DCF11FA8FA50077A41E /* pshmod.h in Headers */,
-				611E0DD011FA8FA50077A41E /* pshnterr.h in Headers */,
-				611E0DD211FA8FA50077A41E /* pshpic.h in Headers */,
-				611E0DD411FA8FA50077A41E /* pshrec.h in Headers */,
-				611E0DD611FA8FA50077A41E /* psmodule.h in Headers */,
-				611E0DD711FA8FA50077A41E /* psnamerr.h in Headers */,
-				611E0DDA11FA8FA50077A41E /* pspic.h in Headers */,
-				611E0DDB11FA8FA50077A41E /* pstables.h in Headers */,
-				611E0DDC11FA8FA50077A41E /* ftmisc.h in Headers */,
-				611E0DDE11FA8FA50077A41E /* ftraster.h in Headers */,
-				611E0DE011FA8FA50077A41E /* ftrend1.h in Headers */,
-				611E0DE211FA8FA50077A41E /* rasterrs.h in Headers */,
-				611E0DE411FA8FA50077A41E /* rastpic.h in Headers */,
-				611E0DE611FA8FA50077A41E /* sfdriver.h in Headers */,
-				611E0DE711FA8FA50077A41E /* sferrors.h in Headers */,
-				611E0DEA11FA8FA50077A41E /* sfntpic.h in Headers */,
-				611E0DEC11FA8FA50077A41E /* sfobjs.h in Headers */,
-				611E0DEE11FA8FA50077A41E /* ttbdf.h in Headers */,
-				611E0DF011FA8FA50077A41E /* ttcmap.h in Headers */,
-				611E0DF111FA8FA50077A41E /* ttcmapc.h in Headers */,
-				611E0DF311FA8FA50077A41E /* ttkern.h in Headers */,
-				611E0DF511FA8FA50077A41E /* ttload.h in Headers */,
-				611E0DF711FA8FA50077A41E /* ttmtx.h in Headers */,
-				611E0DF911FA8FA50077A41E /* ttpost.h in Headers */,
-				611E0DFB11FA8FA50077A41E /* ttsbit.h in Headers */,
-				611E0DFE11FA8FA50077A41E /* ftgrays.h in Headers */,
-				611E0DFF11FA8FA50077A41E /* ftsmerrs.h in Headers */,
-				611E0E0111FA8FA50077A41E /* ftsmooth.h in Headers */,
-				611E0E0311FA8FA50077A41E /* ftspic.h in Headers */,
-				611E0E0D11FA8FA50077A41E /* ttdriver.h in Headers */,
-				611E0E0E11FA8FA50077A41E /* tterrors.h in Headers */,
-				611E0E1011FA8FA50077A41E /* ttgload.h in Headers */,
-				611E0E1211FA8FA50077A41E /* ttgxvar.h in Headers */,
-				611E0E1411FA8FA50077A41E /* ttinterp.h in Headers */,
-				611E0E1611FA8FA50077A41E /* ttobjs.h in Headers */,
-				611E0E1811FA8FA50077A41E /* ttpic.h in Headers */,
-				611E0E1A11FA8FA50077A41E /* ttpload.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		D2AAC07D0554694100DB518D /* libFreetype */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "libFreetype" */;
-			buildPhases = (
-				D2AAC07A0554694100DB518D /* Headers */,
-				D2AAC07B0554694100DB518D /* Sources */,
-				D2AAC07C0554694100DB518D /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = libFreetype;
-			productName = freetype;
-			productReference = D2AAC07E0554694100DB518D /* libFreetype.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 "Freetype" */;
-			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 0867D691FE84028FC02AAC07 /* freetype */;
-			productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				D2AAC07D0554694100DB518D /* libFreetype */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
-		D2AAC07B0554694100DB518D /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				611E0D0611FA8FA50077A41E /* basepic.c in Sources */,
-				611E0D0811FA8FA50077A41E /* ftadvanc.c in Sources */,
-				611E0D0911FA8FA50077A41E /* ftapi.c in Sources */,
-				611E0D0A11FA8FA50077A41E /* ftbase.c in Sources */,
-				611E0D0C11FA8FA50077A41E /* ftbbox.c in Sources */,
-				611E0D0E11FA8FA50077A41E /* ftbitmap.c in Sources */,
-				611E0D0F11FA8FA50077A41E /* ftcalc.c in Sources */,
-				611E0D1111FA8FA50077A41E /* ftdbgmem.c in Sources */,
-				611E0D1211FA8FA50077A41E /* ftdebug.c in Sources */,
-				611E0D1511FA8FA50077A41E /* ftgloadr.c in Sources */,
-				611E0D1611FA8FA50077A41E /* ftglyph.c in Sources */,
-				611E0D1811FA8FA50077A41E /* ftinit.c in Sources */,
-				611E0D1C11FA8FA50077A41E /* ftobjs.c in Sources */,
-				611E0D1E11FA8FA50077A41E /* ftoutln.c in Sources */,
-				611E0D2111FA8FA50077A41E /* ftpic.c in Sources */,
-				611E0D2211FA8FA50077A41E /* ftrfork.c in Sources */,
-				611E0D2311FA8FA50077A41E /* ftsnames.c in Sources */,
-				611E0D2411FA8FA50077A41E /* ftstream.c in Sources */,
-				611E0D2511FA8FA50077A41E /* ftstroke.c in Sources */,
-				611E0D2611FA8FA50077A41E /* ftsynth.c in Sources */,
-				611E0D2711FA8FA50077A41E /* ftsystem.c in Sources */,
-				611E0D2811FA8FA50077A41E /* fttrigon.c in Sources */,
-				611E0D2A11FA8FA50077A41E /* ftutil.c in Sources */,
-				611E0D4411FA8FA50077A41E /* cff.c in Sources */,
-				611E0D4511FA8FA50077A41E /* cffcmap.c in Sources */,
-				611E0D4711FA8FA50077A41E /* cffdrivr.c in Sources */,
-				611E0D4A11FA8FA50077A41E /* cffgload.c in Sources */,
-				611E0D4C11FA8FA50077A41E /* cffload.c in Sources */,
-				611E0D4E11FA8FA50077A41E /* cffobjs.c in Sources */,
-				611E0D5011FA8FA50077A41E /* cffparse.c in Sources */,
-				611E0D5211FA8FA50077A41E /* cffpic.c in Sources */,
-				611E0DC911FA8FA50077A41E /* pshalgo.c in Sources */,
-				611E0DCB11FA8FA50077A41E /* pshglob.c in Sources */,
-				611E0DCD11FA8FA50077A41E /* pshinter.c in Sources */,
-				611E0DCE11FA8FA50077A41E /* pshmod.c in Sources */,
-				611E0DD111FA8FA50077A41E /* pshpic.c in Sources */,
-				611E0DD311FA8FA50077A41E /* pshrec.c in Sources */,
-				611E0DD511FA8FA50077A41E /* psmodule.c in Sources */,
-				611E0DD811FA8FA50077A41E /* psnames.c in Sources */,
-				611E0DD911FA8FA50077A41E /* pspic.c in Sources */,
-				611E0DDD11FA8FA50077A41E /* ftraster.c in Sources */,
-				611E0DDF11FA8FA50077A41E /* ftrend1.c in Sources */,
-				611E0DE111FA8FA50077A41E /* raster.c in Sources */,
-				611E0DE311FA8FA50077A41E /* rastpic.c in Sources */,
-				611E0DE511FA8FA50077A41E /* sfdriver.c in Sources */,
-				611E0DE811FA8FA50077A41E /* sfnt.c in Sources */,
-				611E0DE911FA8FA50077A41E /* sfntpic.c in Sources */,
-				611E0DEB11FA8FA50077A41E /* sfobjs.c in Sources */,
-				611E0DED11FA8FA50077A41E /* ttbdf.c in Sources */,
-				611E0DEF11FA8FA50077A41E /* ttcmap.c in Sources */,
-				611E0DF211FA8FA50077A41E /* ttkern.c in Sources */,
-				611E0DF411FA8FA50077A41E /* ttload.c in Sources */,
-				611E0DF611FA8FA50077A41E /* ttmtx.c in Sources */,
-				611E0DF811FA8FA50077A41E /* ttpost.c in Sources */,
-				611E0DFA11FA8FA50077A41E /* ttsbit.c in Sources */,
-				611E0DFC11FA8FA50077A41E /* ttsbit0.c in Sources */,
-				611E0DFD11FA8FA50077A41E /* ftgrays.c in Sources */,
-				611E0E0011FA8FA50077A41E /* ftsmooth.c in Sources */,
-				611E0E0211FA8FA50077A41E /* ftspic.c in Sources */,
-				611E0E0411FA8FA50077A41E /* smooth.c in Sources */,
-				611E0E0B11FA8FA50077A41E /* truetype.c in Sources */,
-				611E0E0C11FA8FA50077A41E /* ttdriver.c in Sources */,
-				611E0E0F11FA8FA50077A41E /* ttgload.c in Sources */,
-				611E0E1111FA8FA50077A41E /* ttgxvar.c in Sources */,
-				611E0E1311FA8FA50077A41E /* ttinterp.c in Sources */,
-				611E0E1511FA8FA50077A41E /* ttobjs.c in Sources */,
-				611E0E1711FA8FA50077A41E /* ttpic.c in Sources */,
-				611E0E1911FA8FA50077A41E /* ttpload.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/freetype.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 = freetype_Prefix.pch;
-				INSTALL_PATH = /usr/local/lib;
-				PRODUCT_NAME = Freetype;
-			};
-			name = Debug;
-		};
-		1DEB922008733DC00010E9CD /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				DSTROOT = /tmp/freetype.dst;
-				GCC_MODEL_TUNING = G5;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = freetype_Prefix.pch;
-				INSTALL_PATH = /usr/local/lib;
-				PRODUCT_NAME = Freetype;
-			};
-			name = Release;
-		};
-		1DEB922308733DC00010E9CD /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					DARWIN_NO_CARBON,
-					FT2_BUILD_LIBRARY,
-				);
-				GCC_THUMB_SUPPORT = YES;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include\"";
-				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_OPTIMIZATION_LEVEL = s;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					DARWIN_NO_CARBON,
-					FT2_BUILD_LIBRARY,
-				);
-				GCC_THUMB_SUPPORT = YES;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include\"";
-				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 "libFreetype" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1DEB921F08733DC00010E9CD /* Debug */,
-				1DEB922008733DC00010E9CD /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Freetype" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1DEB922308733DC00010E9CD /* Debug */,
-				1DEB922408733DC00010E9CD /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
--- a/misc/libfreetype/Xcode-iPhoneOS/Freetype_Prefix.pch	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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
--- a/misc/liblua/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/misc/liblua/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,19 +1,19 @@
+#this file is included only when system Lua library is not found
+
 file(GLOB lua_src *.c *.h)
-set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
+
+if(WIN32)
+    add_definitions(-DLUA_BUILD_AS_DLL)
+    add_library(lua SHARED ${lua_src})
 
-IF(APPLE)
-	set(build_type STATIC)
-	add_definitions(-DLUA_USE_LINUX)
-	add_library (lua ${build_type} ${lua_src})
-ENDIF(APPLE)
+    set(LUA_LIBRARY lua.dll)
 
-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})
+    set_target_properties(lua PROPERTIES PREFIX "")
+    install(TARGETS lua RUNTIME DESTINATION ${target_dir})
+else(WIN32)
+    add_definitions(-DLUA_USE_LINUX)
+    add_library(lua STATIC ${lua_src})
+    set(LUA_LIBRARY lua)
 endif(WIN32)
 
 
--- a/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj	Thu Nov 24 13:44:30 2011 +0100
+++ b/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj	Sun Oct 28 13:28:23 2012 +0100
@@ -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;
 		};
--- a/misc/libtremor/tremor/Version_script.in	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#
-# Export file for libvorbisidec
-#
-# Only the symbols listed in the global section will be callable from
-# applications linking to libvorbisidec.
-#
-
-@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:
-		*;
-};
--- a/misc/libtremor/tremor/backends.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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
-
-
-
-
-
--- a/misc/libtremor/tremor/block.c	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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);
-}
-
--- a/misc/libtremor/tremor/block.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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
--- a/misc/libtremor/tremor/registry.c	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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,
-};
-
-
-
--- a/misc/libtremor/tremor/registry.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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
--- a/misc/libtremor/tremor/sharedbook.c	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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);
-}
-
--- a/misc/libtremor/tremor/synthesis.c	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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]);
-}
-
-
--- a/misc/libtremor/tremor/vorbisfile.c	Thu Nov 24 13:44:30 2011 +0100
+++ b/misc/libtremor/tremor/vorbisfile.c	Sun Oct 28 13:28:23 2012 +0100
@@ -739,7 +739,8 @@
     if(vf->offsets)_ogg_free(vf->offsets);
     ogg_sync_destroy(vf->oy);
 
-    if(vf->datasource)(vf->callbacks.close_func)(vf->datasource);
+    if(vf->datasource && vf->callbacks.close_func)
+      (vf->callbacks.close_func)(vf->datasource);
     memset(vf,0,sizeof(*vf));
   }
 #ifdef DEBUG_LEAKS
--- a/misc/libtremor/tremor/window.c	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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;
-}
--- a/misc/libtremor/tremor/window.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/loc_gen.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/misc/quazip/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/misc/quazip/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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")
Binary file misc/winutils/Hedgewars.lnk has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_active.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_audio.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_byteorder.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@libsdl.org
+*/
+
+/**
+ *  @file SDL_byteorder.h
+ *  @deprecated Use SDL_endian.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_endian.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_cdrom.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_config.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_config_win32.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_copying.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@libsdl.org
+*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_cpuinfo.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_endian.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_error.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_events.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_getenv.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@libsdl.org
+*/
+
+/** @file SDL_getenv.h
+ *  @deprecated Use SDL_stdinc.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_joystick.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_keyboard.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_keysym.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_loadso.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_main.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_mixer.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,634 @@
+/*
+  SDL_mixer:  An audio mixer library based on the SDL library
+  Copyright (C) 1997-2012 Sam Lantinga <slouken@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@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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_mouse.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_mutex.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_name.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_opengl.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
+/*@}*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_platform.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_quit.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_rwops.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_stdinc.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_syswm.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_thread.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_timer.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_types.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@libsdl.org
+*/
+
+/** @file SDL_types.h
+ *  @deprecated Use SDL_stdinc.h instead.
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_version.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/SDL_video.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/begin_code.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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@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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/close_code.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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 */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/avcodec.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/avfft.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/dxva2.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/old_codec_ids.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/vaapi.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/vda.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/vdpau.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/version.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavcodec/xvmc.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavformat/avformat.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavformat/avio.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavformat/version.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/adler32.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/aes.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * copyright (c) 2007 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/attributes.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,122 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/audio_fifo.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,146 @@
+/*
+ * Audio FIFO
+ * Copyright (c) 2012 Justin Ruggles <justin.ruggles@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/audioconvert.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/avassert.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * copyright (c) 2010 Michael Niedermayer <michaelni@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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/avconfig.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/avstring.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/avutil.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,274 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/base64.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2006 Ryan Martell. (rdm4@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/blowfish.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/bswap.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,109 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/common.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,405 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/cpu.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/crc.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/dict.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/error.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/eval.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2002 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/fifo.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/file.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/imgutils.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/intfloat.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/intfloat_readwrite.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/intreadwrite.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/lfg.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/log.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,172 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/lzo.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/mathematics.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,111 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/md5.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/mem.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,171 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/old_pix_fmts.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/opt.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,592 @@
+/*
+ * AVOptions
+ * copyright (c) 2005 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/parseutils.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/pixdesc.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,206 @@
+/*
+ * pixel format descriptor
+ * Copyright (c) 2009 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/pixfmt.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,240 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/random_seed.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/rational.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,155 @@
+/*
+ * rational numbers
+ * Copyright (c) 2003 Michael Niedermayer <michaelni@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@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/samplefmt.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/sha.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2007 Michael Niedermayer <michaelni@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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/time.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/version.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/libavutil/xtea.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/png.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/pngconf.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/zconf.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/include/zlib.h	Sun Oct 28 13:28:23 2012 +0100
@@ -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@gzip.org          madler@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 */
Binary file misc/winutils/lib/libSDL.dll.a has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/winutils/lib/libSDL.la	Sun Oct 28 13:28:23 2012 +0100
@@ -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'
Binary file misc/winutils/lib/libSDL_mixer.dll.a has changed
Binary file misc/winutils/lib/libSDLmain.a has changed
Binary file misc/winutils/lib/libavcodec.dll.a has changed
Binary file misc/winutils/lib/libavformat.dll.a has changed
Binary file misc/winutils/lib/libavutil.dll.a has changed
--- a/project_files/Android-build/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -16,7 +16,10 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 ###################################################################################
 
-find_program(ANT ant)
+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)
@@ -28,8 +31,22 @@
     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_path(ANDROID_SDK adb ) #assume they've added platform-tools to their path
+    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()
@@ -41,9 +58,11 @@
 endif()
 
 if( NOT FPC_DIR)
-    find_path(FPC_DIR ppcrossarm)
+    find_program(FPC_DIR ppcrossarm)
     get_filename_component(FPC_DIR "${FPC_DIR}" PATH)
-    set(FPC_DIR "${FPC_DIR}" CACHE PATH "Path to fpc dir used in the android port" FORCE)
+    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}")
@@ -55,48 +74,44 @@
 set(SDL_DIR /home/richard/Downloads/android-project)
 
 
-set(ANDROID_SDK_API_LVL 8)
+set(ANDROID_SDK_API_LVL 14)
 set(ANDROID_NDK_API_LVL 5)
 
-MESSAGE(STATUS "Creating android scripts and configuration files")
+MESSAGE(STATUS "Creating Makefile.android...")
+
+configure_file(Templates/Makefile.android .)
 
-configure_file(Templates/complete_build.sh .)
-configure_file(Templates/default.properties SDL-android-project/)
-configure_file(Templates/local.properties SDL-android-project/)
-configure_file(Templates/Makefile.android .)
-configure_file(Templates/pushToDevice.sh .)
+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()
 
-if(SDL_DIR_TEMP_DISABLE)
-    MESSAGE("Moving Android port of SDL to the proper directories")
-    set(DirsToCopy
-        SDL
-        SDL_image
-        SDL_mixer
-        SDL_ttf
-	jpeg
-	png
-         mikmod
-        ) 
-    foreach(DIR ${DirsToCopy})
-        exec_program( 
-            ${CMAKE_COMMAND} 
-            ARGS -E copy_directory 
-            ${SDL_DIR}/jni/${DIR}
-            ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/${DIR}
-        )
-        MESSAGE(STATUS "Moved ${DIR}")
-    endforeach(DIR)
-    exec_program(${HGCOMMAND}
-        ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp
-	)
-    exec_program(${HGCOMMAND}
-        ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp
-	)
-    exec_program(${HGCOMMAND}
-        ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.c
-        )
+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
+)
 
-    exec_program(${HGCOMMAND}
-        ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.h
-	)
-endif(SDL_DIR_TEMP_DISABLE)
--- a/project_files/Android-build/SDL-android-project/AndroidManifest.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/AndroidManifest.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,16 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="org.hedgewars.hedgeroid"
-      android:versionCode="4"
-      android:installLocation="preferExternal" android:versionName="0.1.11">
-    <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="7"></uses-sdk>
+      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"
- 		  		  android:launchMode="singleTask">
+ 		  		  android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
@@ -30,8 +29,8 @@
         <activity android:name=".Downloader.DownloadListActivity"
                   android:label="@string/app_name"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-				  android:screenOrientation='landscape'>
-        </activity>
+				  android:screenOrientation='landscape'
+				  android:launchMode="singleTop"/>
         
         <service android:name=".Downloader.DownloadService"/>
         
@@ -48,7 +47,8 @@
         <activity android:name="TeamCreatorActivity"
                   android:label="@string/app_name"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-				  android:screenOrientation='landscape'>
+				  android:screenOrientation='landscape'
+				  android:windowSoftInputMode="stateUnchanged">
         </activity>
     </application>
 </manifest> 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/ant.properties	Sun Oct 28 13:28:23 2012 +0100
@@ -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.
+
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowdown.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowleft.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowright.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowup.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/backjump.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/firebutton.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/forwardjump.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/pause.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/TARDIS.png has changed
Binary file project_files/Android-build/SDL-android-project/assets/Data/Graphics/slider.png has changed
--- a/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -53,9 +53,10 @@
 00:50=Drill Strike
 00:51=Mudball
 00:52=No weapon selected
-00:53=TARDIS
+00:53=TimeBox
 00:54=Structure
 00:55=Land Spray
+00:56=Freezer
 
 01:00=Let's fight!
 01:01=Round draw
@@ -448,6 +449,7 @@
 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
@@ -491,7 +493,7 @@
 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!|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
@@ -500,6 +502,12 @@
 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
--- a/project_files/Android-build/SDL-android-project/build.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/build.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,67 +1,85 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project name="Hedgewars" default="help">
+<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 in in Version
-         Control Systems. -->
-    <property file="local.properties" />
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <loadproperties srcFile="local.properties" />
 
-    <!-- The build.properties file can be created by you and is never touched
-         by the 'android' tool. This is the place to change some of the default property values
-         used by the Ant rules.
+    <!-- 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:
 
-         application.package
-             the name of your application package as defined in the manifest. Used by the
-             'uninstall' rule.
          source.dir
-             the name of the source directory. Default is 'src'.
+             The name of the source directory. Default is 'src'.
          out.dir
-             the name of the output directory. Default is 'bin'.
+             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.
+         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 in in Version Control Systems.
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
 
          -->
-    <property file="build.properties" />
+    <property file="ant.properties" />
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
 
-    <!-- The default.properties file is created and updated by the 'android' tool, as well
-         as ADT.
-         This file is an integral part of the build system for your application and
-         should be checked in in Version Control Systems. -->
-    <property file="default.properties" />
+         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" />
 
-    <!-- Custom Android task to deal with the project target, and import the proper rules.
-         This requires ant 1.6.0 or above. -->
-    <path id="android.antlibs">
-        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
-    </path>
+    <!-- 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>
 
-    <taskdef name="setup"
-        classname="com.android.ant.SetupTask"
-        classpathref="android.antlibs" />
+    /* 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>
+-->
 
-    <!-- Execute the Android Setup task that will setup some properties specific to the target,
-         and import the build rules files.
-
-         The rules file is imported from
-            <SDK>/platforms/<target_platform>/templates/android_rules.xml
+    <!-- Import the actual build file.
 
-         To customize some build steps for your project:
-         - copy the content of the main node <project> from android_rules.xml
-         - paste it in this build.xml below the <setup /> task.
-         - disable the import by changing the setup task below to <setup import="false" />
+         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.
 
-         This will ensure that the properties are setup correctly but that your customized
-         build steps are used.
+         ***********************
+         ****** 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"
     -->
-    <setup />
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
 
 </project>
--- a/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp	Sun Oct 28 13:28:23 2012 +0100
@@ -1,30 +1,28 @@
 /*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2011 Sam Lantinga
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
 
-    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 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.
 
-    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.
+  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:
 
-    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@libsdl.org
+  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.
 */
-
-#define org_hedgewars_hedgeroid org_hedgewars_hedgeroid
-
 #include "SDL_config.h"
 #include "SDL_stdinc.h"
 
+#ifdef __ANDROID__
+
 #include "SDL_android.h"
 
 extern "C" {
@@ -33,7 +31,15 @@
 #include "../../video/android/SDL_androidtouch.h"
 #include "../../video/android/SDL_androidvideo.h"
 
-/* Impelemented in audio/android/SDL_androidaudio.c */
+#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
 
@@ -49,6 +55,7 @@
 *******************************************************************************/
 static JNIEnv* mEnv = NULL;
 static JNIEnv* mAudioEnv = NULL;
+static JavaVM* mJavaVM;
 
 // Main activity
 static jclass mActivityClass;
@@ -63,7 +70,7 @@
 
 // Accelerometer data storage
 static float fLastAccelerometer[3];
-
+static bool bHasNewData;
 
 /*******************************************************************************
                  Functions called by JNI
@@ -72,6 +79,14 @@
 // 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;
 }
 
@@ -81,7 +96,7 @@
     __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
 
     mEnv = env;
-    mActivityClass = cls;
+    mActivityClass = (jclass)env->NewGlobalRef(cls);
 
     midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
                                 "createGLContext","(II)Z");
@@ -96,10 +111,13 @@
     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
@@ -140,7 +158,8 @@
 {
     fLastAccelerometer[0] = x;
     fLastAccelerometer[1] = y;
-    fLastAccelerometer[2] = z;   
+    fLastAccelerometer[2] = z;
+    bHasNewData = true;
 }
 
 // Quit
@@ -151,6 +170,26 @@
     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)
 {
@@ -188,12 +227,20 @@
     }
 }
 
-extern "C" void Android_JNI_GetAccelerometerValues(float values[3])
+extern "C" SDL_bool Android_JNI_GetAccelerometerValues(float values[3])
 {
     int i;
-    for (i = 0; i < 3; ++i) {
-        values[i] = fLastAccelerometer[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;
 }
 
 //
@@ -208,29 +255,48 @@
 {
     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 = mEnv->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
+    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 = mEnv->NewGlobalRef(audioBuffer);
+    audioBuffer = env->NewGlobalRef(audioBuffer);
 
     jboolean isCopy = JNI_FALSE;
     if (audioBuffer16Bit) {
-        audioBufferPinned = mEnv->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
-        audioBufferFrames = mEnv->GetArrayLength((jshortArray)audioBuffer);
+        audioBufferPinned = env->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
+        audioBufferFrames = env->GetArrayLength((jshortArray)audioBuffer);
     } else {
-        audioBufferPinned = mEnv->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
-        audioBufferFrames = mEnv->GetArrayLength((jbyteArray)audioBuffer);
+        audioBufferPinned = env->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
+        audioBufferFrames = env->GetArrayLength((jbyteArray)audioBuffer);
     }
     if (audioBufferStereo) {
         audioBufferFrames /= 2;
     }
+ 
+    if (isAttached) {
+        mJavaVM->DetachCurrentThread();
+    }
 
     return audioBufferFrames;
 }
@@ -255,13 +321,334 @@
 
 extern "C" void Android_JNI_CloseAudioDevice()
 {
-    mEnv->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
+    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) {
-        mEnv->DeleteGlobalRef(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: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,678 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken@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: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/video/android/SDL_androidkeyboard.c	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,185 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken@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: */
--- a/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk	Sun Oct 28 13:28:23 2012 +0100
@@ -5,14 +5,14 @@
 LOCAL_MODULE := SDL_mixer
 
 LOCAL_C_INCLUDES := \
-	$(LOCAL_PATH)/../../../../../misc/libtremor \
-        $(LOCAL_PATH)/.. \
+        $(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 %/fluidsynth.c, $(wildcard $(LOCAL_PATH)/*.c)))
+LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c)))
 
 LOCAL_SHARED_LIBRARIES := SDL mikmod
 LOCAL_STATIC_LIBRARIES := tremor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL_ttf/Android.mk	Sun Oct 28 13:28:23 2012 +0100
@@ -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)
Binary file project_files/Android-build/SDL-android-project/libs/android-support-v13.jar has changed
--- a/project_files/Android-build/SDL-android-project/res/layout/background.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/layout/background.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,6 +3,6 @@
 <ImageView
 	android:layout_width="fill_parent"
 	android:layout_height="fill_parent"
-	android:scaleType="center"
+	android:scaleType="centerCrop"
 	android:src="@drawable/background"/>
 </merge>
\ No newline at end of file
--- a/project_files/Android-build/SDL-android-project/res/layout/download_confirmdialog.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_confirmdialog.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -2,7 +2,7 @@
 <RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
-    android:layout_height="match_parent"
+    android:layout_height="fill_parent"
     android:padding="5dip">
   	<TextView 
       	android:id="@+id/text"
@@ -13,7 +13,7 @@
        	android:maxWidth="200dip"/>
 
 	<LinearLayout
-	    android:layout_width="match_parent"
+	    android:layout_width="fill_parent"
 	    android:layout_height="wrap_content"
 	    android:layout_below="@+id/text"
 	    android:layout_alignLeft="@id/text"
@@ -23,17 +23,17 @@
 
 	    <Button
 	        android:id="@+id/yes"
-	        android:layout_width="match_parent"
-	        android:layout_height="match_parent"
+	        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="match_parent"
-	        android:layout_height="match_parent"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
 	        android:layout_weight="1"
 	        android:text="@android:string/no" />
 	</LinearLayout>
    	
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
--- a/project_files/Android-build/SDL-android-project/res/layout/download_info.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_info.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    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="match_parent"
+        android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_weight="8"
         android:src="@drawable/arrow"
@@ -14,8 +14,8 @@
     
     <RelativeLayout
         android:id="@+id/container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
         android:layout_weight="1"
         android:gravity="center"
         android:background="@drawable/box_dark">        
@@ -43,4 +43,4 @@
     </RelativeLayout>
     
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
--- a/project_files/Android-build/SDL-android-project/res/layout/download_listactivity.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_listactivity.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,39 +1,39 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
     
    <include layout="@layout/background"/>
     
 	<LinearLayout 
-	    android:layout_width="match_parent"
-	    android:layout_height="match_parent"
+	    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="match_parent"
-	        android:layout_height="match_parent"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
 	        android:layout_weight="1"/>
 	    
 	    <FrameLayout 
 	        android:id="@+id/downloadFrameLayout"
-	        android:layout_width="match_parent"
-	        android:layout_height="match_parent"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
 	        android:layout_weight="1"
 	        android:background="@android:color/transparent">
 	        
 	        <ScrollView
-	            android:layout_width="match_parent"
-	        	android:layout_height="match_parent">
+	            android:layout_width="fill_parent"
+	        	android:layout_height="fill_parent">
 	            
 	            <LinearLayout
 	                android:id="@+id/downloadQueueContainer"
-	                android:layout_width="match_parent"
-	        		android:layout_height="match_parent"
+	                android:layout_width="fill_parent"
+	        		android:layout_height="fill_parent"
 	        		android:orientation="vertical"/>	        		
 	        </ScrollView>
 	    </FrameLayout>
 	
 	</LinearLayout>
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>
--- a/project_files/Android-build/SDL-android-project/res/layout/download_progress.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_progress.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,14 +3,15 @@
 	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_alignLeft="@+id/background"
-    	android:layout_alignRight="@+id/cancelDownload"
+    	android:layout_alignParentLeft="true"
+    	android:layout_alignParentRight="true"
     	android:progressDrawable="@android:drawable/progress_horizontal"
 		android:indeterminate="false" 
 		android:indeterminateOnly="false"/>
@@ -19,25 +20,27 @@
     	android:layout_width="wrap_content"
     	android:layout_height="wrap_content"
     	android:layout_below="@id/progressbar"
-    	android:layout_alignLeft="@+id/background"
-    	android:layout_alignRight="@+id/cancelDownload"
+    	android:layout_alignParentLeft="true"
+    	android:layout_alignParentRight="true"
     	android:text="@string/download_queued"
     	android:textColor="#FFF"
     	android:textSize="14dp"
     	android:gravity="center"/> 	
-    <Button
+    <!--  <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"/>
+    	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_toRightOf="@id/background"
+    	
+    	android:layout_centerHorizontal="true"
     	android:text="@string/download_cancel"/>
+    <!-- android:layout_toRightOf="@id/background"-->
     	
 </RelativeLayout>
 
--- a/project_files/Android-build/SDL-android-project/res/layout/main.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/layout/main.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,15 +1,14 @@
 <?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"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:text="Press download on first every launch, then startGame"
-    />
-    
+    >    
     <Button
     	android:id="@+id/downloader"
     	android:layout_width="wrap_content"
@@ -23,4 +22,4 @@
     	android:text="startgame"/>
     	
 </LinearLayout>
-
+</FrameLayout>
\ No newline at end of file
--- a/project_files/Android-build/SDL-android-project/res/raw/basicflags.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/basicflags.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,22 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <basicflags>
-    <tflag>
-        <default>
-            <integer>100</integer>
-        </default>
-        <image>
-            <string>Health</string>
-        </image>
-        <max>
-            <integer>200</integer>
-        </max>
-        <min>
-            <integer>50</integer>
-        </min>
-        <title>
-            <string>Initial Health</string>
-        </title>
-    </tflag>
     <flag>
         <checkOverMax>
             <boolean>false</boolean>
@@ -70,6 +53,29 @@
         </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>
@@ -103,6 +109,188 @@
             <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>
@@ -181,188 +369,6 @@
             <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>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>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$getawaytime</string>
         </command>
         <default>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_barrelmayhem.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_barrelmayhem.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Barrel Mayhem</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>30</integer>
 		<integer>100</integer>
-		<integer>30</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>0</integer>
-		<integer>35</integer>
-		<integer>25</integer>
-		<integer>0</integer>
-		<integer>0</integer>
-		<integer>0</integer>
-		<integer>40</integer>
+		<integer>100</integer>
 	</basicflags>
 	<gamemod>
 		<false/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_cleanslate.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_cleanslate.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Clean Slate</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>45</integer>
 		<integer>100</integer>
-		<integer>45</integer>
 		<integer>15</integer>
-		<integer>47</integer>
 		<integer>5</integer>
-		<integer>100</integer>
-		<integer>5</integer>
-		<integer>35</integer>
-		<integer>25</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_default_scheme.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_default_scheme.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Default</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>45</integer>
 		<integer>100</integer>
-		<integer>45</integer>
 		<integer>15</integer>
-		<integer>47</integer>
 		<integer>5</integer>
-		<integer>100</integer>
-		<integer>5</integer>
-		<integer>35</integer>
-		<integer>25</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_fortmode.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_fortmode.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Fort Mode</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>45</integer>
 		<integer>100</integer>
-		<integer>45</integer>
 		<integer>15</integer>
-		<integer>47</integer>
 		<integer>5</integer>
-		<integer>100</integer>
-		<integer>5</integer>
-		<integer>35</integer>
-		<integer>25</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_kingmode.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_kingmode.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>King Mode</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>45</integer>
 		<integer>100</integer>
-		<integer>45</integer>
 		<integer>15</integer>
-		<integer>47</integer>
 		<integer>5</integer>
-		<integer>100</integer>
-		<integer>5</integer>
-		<integer>35</integer>
-		<integer>25</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_minefield.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_minefield.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -2,20 +2,21 @@
 <scheme>
 	<name>Minefield</name>
 	<basicflags>
+		<integer>100</integer>
+		<integer>30</integer>
 		<integer>50</integer>
-		<integer>150</integer>
-		<integer>30</integer>
 		<integer>15</integer>
-		<integer>47</integer>
-		<integer>5</integer>
-		<integer>100</integer>
 		<integer>0</integer>
-		<integer>35</integer>
-		<integer>25</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_promode.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_promode.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Pro Mode</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>15</integer>
 		<integer>100</integer>
 		<integer>15</integer>
-		<integer>15</integer>
-		<integer>47</integer>
-		<integer>5</integer>
-		<integer>100</integer>
 		<integer>0</integer>
-		<integer>35</integer>
-		<integer>25</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_shoppa.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_shoppa.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Shoppa</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>30</integer>
 		<integer>100</integer>
-		<integer>300</integer>
 		<integer>50</integer>
-		<integer>47</integer>
-		<integer>5</integer>
-		<integer>100</integer>
 		<integer>1</integer>
-		<integer>0</integer>
-		<integer>35</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/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_thinkingwithportals.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_thinkingwithportals.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Thinking with Portals</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>45</integer>
 		<integer>100</integer>
-		<integer>45</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>2</integer>
-		<integer>25</integer>
-		<integer>25</integer>
-		<integer>4</integer>
-		<integer>5</integer>
-		<integer>0</integer>
-		<integer>5</integer>
+		<integer>100</integer>
 	</basicflags>
 	<gamemod>
 		<false/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_timeless.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_timeless.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<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>
-		<integer>47</integer>
-		<integer>5</integer>
-		<integer>100</integer>
-		<integer>5</integer>
-		<integer>35</integer>
-		<integer>30</integer>
-		<integer>5</integer>
-		<integer>3</integer>
-		<integer>10</integer>
-		<integer>2</integer>
 	</basicflags>
 	<gamemod>
 		<false/>
--- a/project_files/Android-build/SDL-android-project/res/raw/scheme_tunnelhogs.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_tunnelhogs.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -3,19 +3,20 @@
 	<name>Tunnelhogs</name>
 	<basicflags>
 		<integer>100</integer>
+		<integer>30</integer>
 		<integer>100</integer>
-		<integer>30</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>5</integer>
-		<integer>35</integer>
-		<integer>3</integer>
-		<integer>25</integer>
-		<integer>10</integer>
-		<integer>10</integer>
-		<integer>10</integer>
+		<integer>100</integer>
 	</basicflags>
 	<gamemod>
 		<false/>
--- a/project_files/Android-build/SDL-android-project/res/raw/team_two.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_two.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
 <team>
   <name>Team 2</name>
-  <flag>hedgewars</flag>
+  <flag>cm_binary</flag>
   <fort>Lego</fort>
   <grave>Bone</grave>
   <voice>Classic</voice>
@@ -9,41 +9,41 @@
   <hog>
     <name>Paris</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Knut</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Ash</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Woad</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Bob</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Corky</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Bea</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
   <hog>
     <name>Silvia</name>
     <hat>NoHat</hat>
-    <level>0</level>
+    <level>2</level>
   </hog>
 </team>
\ No newline at end of file
--- a/project_files/Android-build/SDL-android-project/res/values/strings.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/res/values/strings.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -8,7 +8,8 @@
     <string name="saved">Saved succesfully</string>
     
     <!-- SDCARD -->
-    <string name="sdcard_not_mounted">There\'s been an error when accessing the sdcard, is it connected to another computer?</string>
+    <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>
@@ -20,7 +21,7 @@
     <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, check the internet connectivity and please 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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;
+	}
+	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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];
+		}
+		
+	};
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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
+	 */
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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);
+	}
+	
+	
+}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java	Sun Oct 28 13:28:23 2012 +0100
@@ -9,7 +9,11 @@
 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;
@@ -25,8 +29,6 @@
 		act = _act;
 	}
 	
-	
-	
 	public static Long copyFileOrDir(Context c, String path) {
 	    AssetManager assetManager = c.getAssets();
 	    String assets[] = null;
@@ -84,6 +86,9 @@
 	}
 
 	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");
 	}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAsyncTask.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAsyncTask.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -41,12 +41,19 @@
  * @author Xeli
  *
  */
-public class DownloadAsyncTask extends AsyncTask<DownloadPackage, Object, Long> {
+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;
 
@@ -58,22 +65,22 @@
 	 * 
 	 * @param params - A {@link}DownloadTask which gives information about where to download from and store the files to 
 	 */
-	protected Long doInBackground(DownloadPackage...packages) {
+	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.mkdir();
+		rootDest.mkdirs();
 
 		try {
 			URL url = new URL(pack.getURL() + URL_ZIP_SUFFIX);
 			conn = (HttpURLConnection)url.openConnection();
 		} catch (IOException e) {
 			e.printStackTrace();
-			return -1l;
+			return EXIT_URLFAIL;
 		}
 
 		String contentType = conn.getContentType();
@@ -82,6 +89,7 @@
 			int bytesDecompressed = 0;
 			ZipEntry entry = null;
 			ZipInputStream input = null;
+			FileOutputStream output = null;
 			int kbytesToProcess = conn.getContentLength()/1024;
 
 			byte[] buffer = new byte[1024];
@@ -100,25 +108,26 @@
 			}catch(IOException e){
 				e.printStackTrace();
 				if(conn != null) conn.disconnect();
-				return -2l;
+				return EXIT_CONNERROR;
 			}
 
+
+
 			while(entry != null){
+
 				if(isCancelled()) break;
 
-				String fileName = entry.getName();
-				File f = new File(rootZipDest + fileName);
-				bytesDecompressed += entry.getCompressedSize();
+				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();
-					}
-
-					FileOutputStream output = null;
-					try {
+					if(entry.isDirectory()){
+						f.mkdir();
+					}else{
+						if(f.exists()){
+							f.delete();
+						}
 						f.createNewFile();
 						output = new FileOutputStream(f);
 
@@ -133,49 +142,49 @@
 						}
 						output.flush();
 						input.closeEntry();
-					} catch (FileNotFoundException e) {
-						e.printStackTrace();
-						if(conn != null) conn.disconnect();
-						return -3l;
-					} catch (IOException e) {
-						e.printStackTrace();
-						if(conn != null) conn.disconnect();
-						return -4l;
-					}finally{
-						try {
-							if( output != null) output.close();
-						} catch (IOException e) {}
-					}
-				}
-				try{
+					}//if isDir 
 					entry = input.getNextEntry();
-				}catch(IOException e){
+				} catch (FileNotFoundException e) {
+					e.printStackTrace();
+					if(conn != null) conn.disconnect();
+					return EXIT_FNF;
+				} catch (IOException e) {
 					e.printStackTrace();
 					if(conn != null) conn.disconnect();
-					return -1l;
+					return EXIT_CONNERROR;
+				}finally{
+					try {
+						if( output != null) output.close();
+
+					} catch (IOException e) {}
 				}
 			}//end while(entry != null)
-
-			try {
-				input.close();
-			} catch (IOException e) {}
-		}//end if contentType == "zip"
-
+			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 0l;
-		else return -1l;
+		if(checkMD5(digester, pack))return EXIT_SUCCESS;
+		else return EXIT_MD5;
 	}
 
 	//TODO proper result handling
-	protected void onPostExecute(Long result){
-		task.done(result > -1l);
+	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();
@@ -187,26 +196,26 @@
 				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){
-					String 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());
+					hash = new String(buffer, 0, bytesRead);
 				}
-				return false;
+				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 false;
+				return true;
 			}
 		}else{
-			return false;	
+			return true;	
 		}
 
 	}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java	Sun Oct 28 13:28:23 2012 +0100
@@ -60,7 +60,7 @@
 
 		public void onClick(DialogInterface dialog, int which) {
 			if(which == Dialog.BUTTON_POSITIVE){
-				Intent i = new Intent(getActivity(), DownloadFragment.class);
+				Intent i = new Intent(getActivity(), DownloadListActivity.class);
 				i.putExtra(DownloadFragment.EXTRA_TASK, task);
 				getActivity().startActivity(i);
 			}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -52,7 +52,7 @@
 
 	private TextView progress_sub;
 	private ProgressBar progress;
-	private Button positive, negative;
+	private Button /*positive,*/ negative;
 
 	private DownloadPackage pack;
 
@@ -63,30 +63,30 @@
 		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(), DownloadService.class);
-         getActivity().startService(i);
-         getActivity().bindService(new Intent(getActivity(), DownloadService.class), connection, Context.BIND_AUTO_CREATE);
+		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);
+		//positive = (Button) v.findViewById(R.id.background);
 		negative = (Button) v.findViewById(R.id.cancelDownload);
-		positive.setOnClickListener(backgroundClicker);
+		//positive.setOnClickListener(backgroundClicker);
 		negative.setOnClickListener(cancelClicker);
 
 		pack = getArguments().getParcelable(DownloadFragment.EXTRA_TASK);
@@ -101,13 +101,13 @@
 	};
 	private OnClickListener cancelClicker = new OnClickListener(){
 		public void onClick(View v){
-			if(messenger != null){
+			if(messengerService != null){
 				Message message = Message.obtain(messageHandler, DownloadService.MSG_CANCEL, pack);
 				try {
 					messengerService.send(message);
 				} catch (RemoteException e) {}
 			}
-			getActivity().finish();
+			//getActivity().finish();
 		}
 	};
 	private OnClickListener doneClicker = new OnClickListener(){
@@ -118,7 +118,7 @@
 
 	private OnClickListener tryAgainClicker = new OnClickListener(){
 		public void onClick(View v){
-			if(messenger != null){
+			if(messengerService != null){
 				Message message = Message.obtain(messageHandler, DownloadService.MSG_ADDTASK, pack);
 				message.replyTo = messenger;
 				try {
@@ -130,9 +130,9 @@
 		}
 	};
 
-	public void onStop(){
-		super.onStop();
+	public void onDestroy(){
 		unBindFromService();
+		super.onDestroy();
 	}
 
 	private ServiceConnection connection = new ServiceConnection(){
@@ -142,7 +142,7 @@
 
 			try{
 				//give the service a task
-				if(messenger != null){
+				if(messengerService != null){
 					Message message = Message.obtain(messageHandler, DownloadService.MSG_ADDTASK, pack);
 					message.replyTo = messenger;
 					messengerService.send(message);
@@ -157,21 +157,18 @@
 
 	};
 
-	private void unBindFromService(){
-		if(boundToService){
-			if(messenger != null){
-				try {
-					Message message = Message.obtain(messageHandler, DownloadService.MSG_UNREGISTER_CLIENT, pack);
-					message.replyTo = messenger;
-					messengerService.send(message);
-				} catch (RemoteException e) {
-					e.printStackTrace();
-				}
+	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();
 			}
-			
-			boundToService = false;
-			getActivity().unbindService(connection);
-		}	
+		}
+
+		getActivity().unbindService(connection);
 	}
 
 	private Handler.Callback messageCallback = new Handler.Callback() {
@@ -181,8 +178,8 @@
 			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);
+				//positive.setText(R.string.download_background);
+				//positive.setOnClickListener(backgroundClicker);
 				negative.setText(R.string.download_cancel);
 				negative.setOnClickListener(cancelClicker);
 				break;
@@ -194,17 +191,21 @@
 				progress.setProgress(progress.getMax());
 				progress_sub.setText(R.string.download_done);
 
-				positive.setText(R.string.download_back);
-				positive.setOnClickListener(doneClicker);
+				//	positive.setText(R.string.download_back);
+				//	positive.setOnClickListener(doneClicker);
 
 				negative.setVisibility(View.INVISIBLE);
 				break;
 			case MSG_FAILED:
 				progress.setProgress(progress.getMax());
-				progress_sub.setText(R.string.download_failed);
-				positive.setText(R.string.download_back);
-				positive.setOnClickListener(doneClicker);
-
+				
+				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;
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListActivity.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListActivity.java	Sun Oct 28 13:28:23 2012 +0100
@@ -6,6 +6,7 @@
 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;
@@ -36,7 +37,7 @@
 		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
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListFragment.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListFragment.java	Sun Oct 28 13:28:23 2012 +0100
@@ -13,9 +13,6 @@
 
 import android.graphics.Color;
 import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
 import android.support.v4.app.ListFragment;
 import android.util.Log;
 import android.view.View;
@@ -79,22 +76,32 @@
 						});
 					}
 				}
-				eventType = xmlPuller.nextTag();
+				eventType = getEventType(xmlPuller);
 			}
 			
 			
 		} catch (XmlPullParserException e) {
-			// TODO Auto-generated catch block
 			e.printStackTrace();
 		} catch (IOException e) {
-			// TODO Auto-generated catch block
 			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");
 
@@ -103,12 +110,12 @@
 		ft.addToBackStack(null);
 
 		//create a new dialog based on this task
-		DownloadPackage task = (DownloadPackage)arg0.getAdapter().getItem(position);
+		
 		DialogFragment newFragment = DownloadDialogFragment.newInstance(task);
 
 		//show it
-		//newFragment.show(ft, "dialog");
-
+		newFragment.show(ft, "dialog");
+		 */
 		targetView = arg1;
 
 		//determine state
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadPackage.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadPackage.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -19,12 +19,9 @@
 
 package org.hedgewars.hedgeroid.Downloader;
 
-import java.util.ArrayList;
-import java.util.Deque;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.hedgewars.hedgeroid.MainActivity;
 import org.hedgewars.hedgeroid.R;
 
 import android.app.Notification;
@@ -32,7 +29,6 @@
 import android.app.PendingIntent;
 import android.app.Service;
 import android.content.Intent;
-import android.os.AsyncTask;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Message;
@@ -60,7 +56,8 @@
 	private NotificationManager nM;
 	private RemoteViews contentView;
 
-	private Deque<DownloadTask> downloadTasks = new LinkedList<DownloadTask>();
+	private LinkedList<DownloadTask> downloadTasks = new LinkedList<DownloadTask>();
+	private DownloadTask currentTask = null;
 
 	public class DownloadHandler extends Handler{
 
@@ -87,7 +84,10 @@
 					runNextTask();
 					return;
 				case MSG_CANCEL:
-					if(task != null && task.getPackage().equals(pack) && task.getStatus() == TASK_STATE.RUNNING){
+					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;
@@ -111,10 +111,10 @@
 
 	private void runNextTask(){
 		if(asyncExecutor == null){//if (task isnt running right now) ...
-			DownloadTask task = downloadTasks.pollFirst();
-			if(task != null){
-				asyncExecutor = new DownloadAsyncTask(task);
-				asyncExecutor.execute(task.getPackage());
+			currentTask = downloadTasks.poll();
+			if(currentTask != null){
+				asyncExecutor = new DownloadAsyncTask(currentTask);
+				asyncExecutor.execute(currentTask.getPackage());
 			}
 		}
 	}
@@ -175,10 +175,10 @@
 			contentView.setProgressBar(R.id.notification_progress, 100, 34, false);
 			progressNotification.contentView = contentView;
 
-			PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, new Intent(DownloadService.this, DownloadFragment.class), Intent.FLAG_ACTIVITY_NEW_TASK);
+			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);//TODO werkt het?
+			startForeground(NOTIFICATION_PROCESSING, progressNotification);
 
 			Message msg = Message.obtain(null, DownloadFragment.MSG_START, max, 0);
 			sendMessageToClients(msg);
@@ -196,10 +196,16 @@
 		}
 
 		//Call back from the ASync task when the task has either run into an error or finished otherwise
-		public void done(boolean succesful){
-			if(succesful){
-				sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_DONE));
-			}else sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED));
+		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);
 
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/EngineProtocolNetwork.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/EngineProtocolNetwork.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/FrontendDataUtils.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-
-import org.hedgewars.hedgeroid.R;
-import org.hedgewars.hedgeroid.Utils;
-import org.hedgewars.hedgeroid.EngineProtocol.Map.MapType;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-
-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 String[] getGameplay(Context c){
-		String[] files = Utils.getFileNamesFromRelativeDir(c, "Scripts/Multiplayer");
-		int retCounter = 0;
-
-		for(int i = 0; i < files.length; i++){
-			if(files[i].endsWith(".lua")){
-				files[i] = files[i].replace('_', ' ').substring(0, files[i].length()-4); //replace _ by a space and removed the last four characters (.lua)
-				retCounter++;
-			}else files[i] = null;
-		}
-		String[] ret = new String[retCounter];
-		retCounter = 0;
-		for(String s : files){
-			if(s != null) ret[retCounter++] = s;
-		}
-		Arrays.sort(ret);
-
-		return ret;	
-	}
-
-	public static String[] getThemes(Context c){
-		return Utils.getDirsWithFileSuffix(c, "Themes", "icon.png");
-	}
-
-	public static ArrayList<Scheme> getSchemes(Context c){
-		return Scheme.getSchemes(c);
-	}
-
-	public static ArrayList<Weapon> getWeapons(Context c){
-		return Weapon.getWeapons(c);
-	}
-
-	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(b, 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 ArrayList<HashMap<String, Object>> getTeams(Context c){
-		ArrayList<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){
-					ret.add(teamToHashMap(t));
-				}
-			}
-		}
-		return ret;
-	}
-
-	public static HashMap<String, Object> teamToHashMap(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;
-	}
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameConfig.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameConfig.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -22,6 +22,12 @@
 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;
@@ -34,7 +40,8 @@
 	public Scheme scheme = null;
 	public Weapon weapon = null;
 	
-	public String mission = null;
+	public String style = null;
+	public String training = null;
 	public String seed = null;
 	
 	public ArrayList<Team> teams = new ArrayList<Team>();
@@ -53,7 +60,8 @@
 		Log.d("HW_Frontend", "Sending Gameconfig...");
 		int teamCount = 4;
 		epn.sendToEngine("TL"); //Write game mode
-		if(mission != null) epn.sendToEngine(mission);
+		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()));
@@ -71,7 +79,7 @@
 		weapon.sendToEngine(epn, teamCount);
 		
 		for(Team t : teams){
-			if(t != null)t.sendToEngine(epn, teamCount, 50);
+			if(t != null)t.sendToEngine(epn, teamCount, scheme.health);
 		}
 	}
 	
@@ -85,7 +93,8 @@
 		dest.writeString(theme);
 		dest.writeParcelable(scheme, flags);
 		dest.writeParcelable(weapon, flags);
-		dest.writeString(mission);
+		dest.writeString(style);
+		dest.writeString(training);
 		dest.writeString(seed);
 		dest.writeParcelableArray((Team[])teams.toArray(new Team[1]), 0);
 	}
@@ -96,7 +105,8 @@
 		theme = src.readString();
 		scheme = src.readParcelable(Scheme.class.getClassLoader());
 		weapon = src.readParcelable(Weapon.class.getClassLoader());
-		mission = src.readString();
+		style = src.readString();
+		training = src.readString();
 		seed = src.readString();
 		Parcelable[] parcelables = src.readParcelableArray(Team[].class.getClassLoader());
 		for(Parcelable team : parcelables){
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameMode.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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 enum GameMode {
-		MODE_LOCAL, MODE_DEMO, MODE_NET, MODE_SAVE
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Grave.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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 Grave{
-
-	public final String name;
-	public final String path;
-	
-	public Grave(String _name, String _path) {
-		name = _name;
-		path = _path;
-	}
-
-	public String toString(){
-		return name;
-	}
-	
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Map.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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.File;
-import java.io.IOException;
-
-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];
-		}
-		
-	};
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Scheme.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,358 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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.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.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{
-
-	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, ?>>();
-	
-	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);
-			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 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() {
-		// TODO Auto-generated method stub
-		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];
-		}
-		
-	};
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Team.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,345 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-import org.xmlpull.v1.XmlSerializer;
-
-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 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]));
-		}
-	}
-
-	/*
-	 * 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);
-	}
-
-
-	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();
-	}
-
-	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
-	 */
-
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/Weapon.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-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{
-
-	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[]{};
-		Arrays.sort(files);
-		
-		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];
-		}
-		
-	};
-}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -19,12 +19,15 @@
 package org.hedgewars.hedgeroid;
 
 import org.hedgewars.hedgeroid.Downloader.DownloadAssets;
-import org.hedgewars.hedgeroid.Downloader.DownloadFragment;
 import org.hedgewars.hedgeroid.Downloader.DownloadListActivity;
-import org.hedgewars.hedgeroid.Downloader.DownloadService;
 
+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;
@@ -48,18 +51,47 @@
 		downloader.setOnClickListener(downloadClicker);
 		startGame.setOnClickListener(startGameClicker);
 
-		boolean assetsCopied = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("assetscopied", false);
+
+		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);
+			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){
-			PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("assetscopied", true).commit();
+			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);
 		}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java	Sun Oct 28 13:28:23 2012 +0100
@@ -9,7 +9,6 @@
 import org.hedgewars.hedgeroid.EngineProtocol.EngineProtocolNetwork;
 import org.hedgewars.hedgeroid.EngineProtocol.GameConfig;
 import org.hedgewars.hedgeroid.EngineProtocol.PascalExports;
-import org.hedgewars.hedgeroid.TouchInterface.TouchInterface;
 
 import android.app.Activity;
 import android.content.Context;
@@ -25,41 +24,50 @@
 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
+    SDL Activity
  */
 public class SDLActivity extends Activity {
 
 	// Main components
 	public static SDLActivity mSingleton;
-	public static SDLSurface mSurface;
+	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("mikmod");
-		System.loadLibrary("SDL_net");
-		System.loadLibrary("SDL_mixer");
-		System.loadLibrary("SDL_ttf");
-		System.loadLibrary("lua5.1");
-		System.loadLibrary("hwengine");
+		//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()");
+		//Log.v("SDL", "onCreate()");
 		super.onCreate(savedInstanceState);
 
 		// So we can call stuff from static callbacks
@@ -67,27 +75,49 @@
 
 		// Set up the surface
 		GameConfig config = getIntent().getParcelableExtra("config");
+
 		mSurface = new SDLSurface(getApplication(), config);
 		setContentView(mSurface);
 		SurfaceHolder holder = mSurface.getHolder();
-		holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
 	}
 
 	// Events
 	protected void onPause() {
-		// Log.v("SDL", "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()");
+		Log.v("SDL", "onResume()");
 		super.onResume();
 	}
-	
-	public void onBackPressed(){
-		nativeQuit();
-		super.onBackPressed();
+
+	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
@@ -97,7 +127,7 @@
 	Handler commandHandler = new Handler() {
 		public void handleMessage(Message msg) {
 			if (msg.arg1 == COMMAND_CHANGE_TITLE) {
-				setTitle((String) msg.obj);
+				setTitle((String)msg.obj);
 			}
 		}
 	};
@@ -111,31 +141,28 @@
 	}
 
 	// C functions we call
-	public static native void nativeInit(String[] argv);
-
+	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();
 
-	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 mSurface.initEGL(majorVersion, minorVersion);
+		return initEGL(majorVersion, minorVersion);
 	}
 
 	public static void flipBuffers() {
-		mSurface.flipEGL();
+		flipEGL();
 	}
 
 	public static void setActivityTitle(String title) {
@@ -143,51 +170,168 @@
 		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;
+	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");
+		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);
+		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);
+				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");
+		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)];
+			buf = new byte[desiredFrames * (isStereo ? 2 : 1)]; 
 		}
 		return buf;
 	}
@@ -206,14 +350,14 @@
 	}
 
 	public static void audioWriteShortBuffer(short[] buffer) {
-		for (int i = 0; i < buffer.length;) {
+		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) {
+				} catch(InterruptedException e) {
 					// Nom nom
 				}
 			} else {
@@ -224,14 +368,14 @@
 	}
 
 	public static void audioWriteByteBuffer(byte[] buffer) {
-		for (int i = 0; i < buffer.length;) {
+		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) {
+				} catch(InterruptedException e) {
 					// Nom nom
 				}
 			} else {
@@ -245,12 +389,12 @@
 		if (mAudioThread != null) {
 			try {
 				mAudioThread.join();
-			} catch (Exception e) {
+			} catch(Exception e) {
 				Log.v("SDL", "Problem stopping audio thread: " + e);
 			}
 			mAudioThread = null;
 
-			// Log.v("SDL", "Finished waiting for audio thread");
+			//Log.v("SDL", "Finished waiting for audio thread");
 		}
 
 		if (mAudioTrack != null) {
@@ -258,12 +402,18 @@
 			mAudioTrack = null;
 		}
 	}
+	
+	public static int getDensity(){
+		DisplayMetrics dm = SDLActivity.getContext().getResources().getDisplayMetrics();
+		return dm.densityDpi;
+	}
 }
 
 /**
- * Simple nativeInit() runnable
+    Simple nativeInit() runnable
  */
 class SDLMain implements Runnable {
+
 	private int surfaceWidth, surfaceHeight;
 	private GameConfig config;
 
@@ -280,11 +430,11 @@
 		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", "null", "xeli", "1", "1", "1", path, ""  });
+				"0", "en.txt", "xeli", "1", "1", "1", path, ""  });
 
 		try {
 			ipc.quitIPC();
@@ -292,83 +442,60 @@
 		} catch (InterruptedException e) {
 			e.printStackTrace();
 		}
+		Log.v("SDL", "SDL thread terminated");
 		//Log.v("SDL", "SDL thread terminated");
-		SDLActivity.mSingleton.finish();
 	}
 }
 
+
 /**
- * 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
+    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, SensorEventListener {
+class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, 
+View.OnKeyListener, View.OnTouchListener, SensorEventListener  {
 
-	// This is what SDL runs in. It invokes SDL_main(), eventually
-	private Thread mSDLThread;
-
-	// EGL private objects
-	private EGLContext mEGLContext;
-	private EGLSurface mEGLSurface;
-	private EGLDisplay mEGLDisplay;
+	private GameConfig config;
 
 	// Sensors
 	private static SensorManager mSensorManager;
 
-	private GameConfig config;
-
-	// Startup
+	// Startup    
 	public SDLSurface(Context context, GameConfig _config) {
 		super(context);
-		getHolder().addCallback(this);
+		getHolder().addCallback(this); 
 
 		setFocusable(true);
 		setFocusableInTouchMode(true);
 		requestFocus();
-		setOnKeyListener(this);
-		setOnTouchListener(TouchInterface.getTouchInterface());
+		setOnKeyListener(this); 
+		setOnTouchListener(this);   
 
-		mSensorManager = (SensorManager) context.getSystemService("sensor");
-
+		mSensorManager = (SensorManager)context.getSystemService("sensor");
 		config = _config;
 	}
 
 	// Called when we have a valid drawing surface
 	public void surfaceCreated(SurfaceHolder holder) {
 		Log.v("SDL", "surfaceCreated()");
-
-		//enableSensor(Sensor.TYPE_ACCELEROMETER, true);
+		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()");
-
-		// Send a quit message to the application
-		//SDLActivity.nativeQuit();
-                PascalExports.HWterminate(true);
-
-		// 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");
-		}
-
-		//enableSensor(Sensor.TYPE_ACCELEROMETER, false);
+		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.d("SDL", "surfaceChanged()" + width + " + " + height);
+	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) {
@@ -415,122 +542,35 @@
 			break;
 		}
 		SDLActivity.onNativeResize(width, height, sdlFormat);
+		Log.v("SDL", "Window size:" + width + "x"+height);
 
-		// Now start up the C app thread
-		if (mSDLThread == null) {
-			mSDLThread = new Thread(new SDLMain(width, height, config),
-					"SDLThread");
-			mSDLThread.start();
-		}
+		SDLActivity.startApp(width, height, config);
 	}
 
 	// unused
-	public void onDraw(Canvas canvas) {
-	}
-
-	// EGL functions
-	public boolean initEGL(int majorVersion, int minorVersion) {
-		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];
-
-			EGLContext ctx = egl.eglCreateContext(dpy, config,
-					EGL10.EGL_NO_CONTEXT, null);
-			if (ctx == EGL10.EGL_NO_CONTEXT) {
-				Log.e("SDL", "Couldn't create context");
-				return false;
-			}
+	public void onDraw(Canvas canvas) {}
 
-			EGLSurface surface = egl.eglCreateWindowSurface(dpy, config, this,
-					null);
-			if (surface == EGL10.EGL_NO_SURFACE) {
-				Log.e("SDL", "Couldn't create surface");
-				return false;
-			}
-
-			if (!egl.eglMakeCurrent(dpy, surface, surface, ctx)) {
-				Log.e("SDL", "Couldn't make context current");
-				return false;
-			}
-
-			mEGLContext = ctx;
-			mEGLDisplay = dpy;
-			mEGLSurface = surface;
-
-		} catch (Exception e) {
-			Log.v("SDL", e + "");
-			for (StackTraceElement s : e.getStackTrace()) {
-				Log.v("SDL", s.toString());
-			}
-		}
 
-		return true;
-	}
 
-	// EGL buffer flip
-	public void flipEGL() {
-		try {
-			EGL10 egl = (EGL10) EGLContext.getEGL();
-
-			egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
-
-			// drawing here
-
-			egl.eglWaitGL();
-
-			egl.eglSwapBuffers(mEGLDisplay, mEGLSurface);
-
-		} catch (Exception e) {
-			Log.v("SDL", "flipEGL(): " + e);
-			for (StackTraceElement s : e.getStackTrace()) {
-				Log.v("SDL", s.toString());
-			}
-			
-		}
-	}
 
 	// Key events
-	public boolean onKey(View v, int keyCode, KeyEvent event) {
-                if(keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) return false;
+	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);
-			if(keyCode == KeyEvent.KEYCODE_BACK){//TODO ask user to quit or not
-				PascalExports.HWterminate(true);
-				//SDLActivity.mSingleton.finish();
-			}else{
-				SDLActivity.onNativeKeyDown(keyCode);	
-			}
-			
+			//Log.v("SDL", "key down: " + keyCode);
+			SDLActivity.onNativeKeyDown(keyCode);
 			return true;
-		} else if (event.getAction() == KeyEvent.ACTION_UP) {
-			Log.v("SDL", "key up: " + keyCode);
+		}
+		else if (event.getAction() == KeyEvent.ACTION_UP) {
+			//Log.v("SDL", "key up: " + keyCode);
 			SDLActivity.onNativeKeyUp(keyCode);
 			return true;
 		}
@@ -538,15 +578,46 @@
 		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),
+			mSensorManager.registerListener(this, 
+					mSensorManager.getDefaultSensor(sensortype), 
 					SensorManager.SENSOR_DELAY_GAME, null);
 		} else {
-			mSensorManager.unregisterListener(this,
+			mSensorManager.unregisterListener(this, 
 					mSensorManager.getDefaultSensor(sensortype));
 		}
 	}
@@ -557,9 +628,11 @@
 
 	public void onSensorChanged(SensorEvent event) {
 		if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
-			SDLActivity.onNativeAccel(event.values[0], event.values[1],
-					event.values[2]);
+			SDLActivity.onNativeAccel(event.values[0] / SensorManager.GRAVITY_EARTH,
+					event.values[1] / SensorManager.GRAVITY_EARTH,
+					event.values[2] / SensorManager.GRAVITY_EARTH);
 		}
 	}
 
 }
+
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -19,12 +19,13 @@
 
 package org.hedgewars.hedgeroid;
 
-import org.hedgewars.hedgeroid.EngineProtocol.FrontendDataUtils;
+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 org.hedgewars.hedgeroid.EngineProtocol.Map;
-import org.hedgewars.hedgeroid.EngineProtocol.Scheme;
-import org.hedgewars.hedgeroid.EngineProtocol.Team;
-import org.hedgewars.hedgeroid.EngineProtocol.Weapon;
 
 import android.app.Activity;
 import android.content.Intent;
@@ -55,17 +56,6 @@
 	public void onCreate(Bundle savedInstanceState){
 		super.onCreate(savedInstanceState);
 
-		SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
-		boolean firstTime = sharedPref.getBoolean("firstTime", true);
-		//Copy all the xml files to the device TODO only do first time launch of the app...
-		if(firstTime){
-			sharedPref.edit().putBoolean("firstTime", false).commit();
-			
-			Utils.resRawToFilesDir(this,R.array.schemes, Scheme.DIRECTORY_SCHEME);
-			Utils.resRawToFilesDir(this, R.array.weapons, Weapon.DIRECTORY_WEAPON);
-			Utils.resRawToFilesDir(this, R.array.teams, Team.DIRECTORY_TEAMS);
-		}
-
 		Scheme.parseBasicFlags(this);
 		config = new GameConfig();
 
@@ -93,27 +83,53 @@
 		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(){
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -25,9 +25,10 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 
-import org.hedgewars.hedgeroid.EngineProtocol.FrontendDataUtils;
-import org.hedgewars.hedgeroid.EngineProtocol.Team;
+import org.hedgewars.hedgeroid.Datastructures.FrontendDataUtils;
+import org.hedgewars.hedgeroid.Datastructures.Team;
 
 import android.app.Activity;
 import android.graphics.Bitmap;
@@ -51,7 +52,7 @@
 import android.widget.TextView;
 import android.widget.Toast;
 
-public class TeamCreatorActivity extends Activity {
+public class TeamCreatorActivity extends Activity implements Runnable{
 
 	private TextView name;
 	private Spinner difficulty, grave, flag, voice, fort;
@@ -64,6 +65,14 @@
 	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);
@@ -89,8 +98,7 @@
 
 		LinearLayout ll = (LinearLayout) findViewById(R.id.HogsContainer);
 		for (int i = 0; i < ll.getChildCount(); i++) {
-			RelativeLayout team_creation_entry = (RelativeLayout) ll
-					.getChildAt(i);
+			RelativeLayout team_creation_entry = (RelativeLayout) ll.getChildAt(i);
 
 			hogHat.add((Spinner) team_creation_entry
 					.findViewById(R.id.spinTeam1));
@@ -99,7 +107,7 @@
 			hogName.add((EditText) team_creation_entry
 					.findViewById(R.id.txtTeam1));
 		}
-		ArrayList<HashMap<String, ?>> gravesData = FrontendDataUtils.getGraves(this);
+
 		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 });
@@ -108,96 +116,97 @@
 		grave.setAdapter(sa);
 		grave.setOnFocusChangeListener(focusser);
 
-		ArrayList<HashMap<String, ?>> flagsData = FrontendDataUtils
-				.getFlags(this);
 		sa = new SimpleAdapter(this, flagsData, R.layout.spinner_textimg_entry,
 				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
-						R.id.spinner_img });
+				R.id.spinner_img });
 		sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry);
 		sa.setViewBinder(viewBinder);
 		flag.setAdapter(sa);
 		flag.setOnFocusChangeListener(focusser);
 
-		ArrayList<HashMap<String, ?>> typesData = FrontendDataUtils
-				.getTypes(this);
 		sa = new SimpleAdapter(this, typesData, R.layout.spinner_textimg_entry,
 				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
-						R.id.spinner_img });
+				R.id.spinner_img });
 		sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry);
 		difficulty.setAdapter(sa);
 		difficulty.setOnFocusChangeListener(focusser);
 
-		ArrayList<HashMap<String, ?>> hatsData = FrontendDataUtils
-				.getHats(this);
 		sa = new SimpleAdapter(this, hatsData, R.layout.spinner_textimg_entry,
 				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
-						R.id.spinner_img });
+				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, FrontendDataUtils.getVoices(this));
+		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,
-				FrontendDataUtils.getForts(this));
+		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);
 
-		Team t = this.getIntent().getParcelableExtra("team");
-		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;
-				}
-			}
+		new Thread(this).start();
+	}
 
-			position = 0;
-			for (HashMap<String, ?> hashmap : gravesData) {
-				if (hashmap.get("txt").equals(t.grave)) {
-					grave.setSelection(position);
-					break;
-				}
+	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();
 			}
-
-			position = 0;
-			for (HashMap<String, ?> hashmap : typesData) {
-				if (hashmap.get("txt").equals(t.flag)) {
-					flag.setSelection(position);
-					break;
-				}
+		});
+		
+		final ArrayList<HashMap<String, ?>> hatsDataNew = FrontendDataUtils.getHats(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(hatsData, hatsDataNew);
+				((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged();
 			}
-
-			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]);
+		});
+		
+		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() {
@@ -242,8 +251,7 @@
 			saved = true;
 			Team team = new Team();
 			team.name = name.getText().toString();
-			HashMap<String, Object> hashmap = (HashMap<String, Object>) flag
-					.getSelectedItem();
+			HashMap<String, Object> hashmap = (HashMap<String, Object>) flag.getSelectedItem();
 
 			team.flag = (String) hashmap.get("txt");
 			team.fort = fort.getSelectedItem().toString();
@@ -251,6 +259,7 @@
 			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();
@@ -271,18 +280,17 @@
 
 			for (int i = 0; i < hogName.size(); i++) {
 				team.hogNames[i] = hogName.get(i).getText().toString();
-				hashmap = (HashMap<String, Object>) hogHat.get(i)
-						.getSelectedItem();
+				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();
-				FileOutputStream fos = new FileOutputStream(String.format(
-						"%s/%s.xml", teamsDir.getAbsolutePath(), team.name));
+				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();
@@ -292,7 +300,6 @@
 	};
 
 	private OnItemSelectedListener fortSelector = new OnItemSelectedListener() {
-		@SuppressWarnings("unchecked")
 		public void onItemSelected(AdapterView<?> arg0, View arg1,
 				int position, long arg3) {
 			settingsChanged = true;
@@ -303,10 +310,10 @@
 					+ 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)
+			// to the bottom, work
+			// around for scollview
+			// invalidation (scrolls
+			// back to top)
 		}
 
 		public void onNothingSelected(AdapterView<?> arg0) {
@@ -343,6 +350,55 @@
 		}
 	};
 
+	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,
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamSelectionActivity.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamSelectionActivity.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -22,9 +22,10 @@
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 
-import org.hedgewars.hedgeroid.EngineProtocol.FrontendDataUtils;
-import org.hedgewars.hedgeroid.EngineProtocol.Team;
+import org.hedgewars.hedgeroid.Datastructures.FrontendDataUtils;
+import org.hedgewars.hedgeroid.Datastructures.Team;
 
 import android.app.Activity;
 import android.content.Intent;
@@ -45,13 +46,13 @@
 import android.widget.SimpleAdapter.ViewBinder;
 import android.widget.TextView;
 
-public class TeamSelectionActivity extends Activity{
+public class TeamSelectionActivity extends Activity implements Runnable{
 
 	private static final int ACTIVITY_TEAMCREATION = 0;
 
 	private ImageButton addTeam, back;
 	private ListView availableTeams, selectedTeams;
-	private ArrayList<HashMap<String, Object>> availableTeamsList, selectedTeamsList;
+	private List<HashMap<String, Object>> availableTeamsList, selectedTeamsList;
 	private TextView txtInfo;
 
 	public void onCreate(Bundle savedInstanceState){
@@ -62,37 +63,50 @@
 		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);
 
-		availableTeams = (ListView) findViewById(R.id.availableTeams);
-		availableTeamsList = FrontendDataUtils.getTeams(this);
+		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);
-		availableTeams.setOnItemClickListener(availableClicker);
 
-		selectedTeams = (ListView) findViewById(R.id.selectedTeams);
 		selectedTeamsList = new ArrayList<HashMap<String, Object>>();
-		ArrayList<HashMap<String, ?>> toBeRemoved = new ArrayList<HashMap<String, ?>>();
-		ArrayList<Team> teamsStartGame = getIntent().getParcelableArrayListExtra("teams");
-		for(HashMap<String, Object> hashmap : availableTeamsList){
-			for(Team t : teamsStartGame){
-				if(((Team)hashmap.get("team")).equals(t)){
-					toBeRemoved.add(hashmap);
-					selectedTeamsList.add(FrontendDataUtils.teamToHashMap(t));//create a new hashmap to ensure all variables are entered into the map
-				}
-			}
-		}
-		for(HashMap<String, ?> hashmap : toBeRemoved) availableTeamsList.remove(hashmap);
-
 		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(){
@@ -120,6 +134,9 @@
 		}
 	}
 
+	/*
+	 * Updates the list view when TeamCreationActivity is shutdown and the user returns to this point
+	 */
 	private void updateListViews(){
 		unregisterForContextMenu(availableTeams);
 		availableTeamsList = FrontendDataUtils.getTeams(this);
@@ -241,7 +258,8 @@
 			selectAvailableTeamsItem(position);
 			return true;
 		case 1://delete
-			File f = new File(String.format("%s/%s/%s.xml", TeamSelectionActivity.this.getFilesDir(), Team.DIRECTORY_TEAMS, availableTeamsList.get(position).get("txt")));
+			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();
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TextImageAdapter.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TextImageAdapter.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TouchInterface/TouchInterface.java	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@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.TouchInterface;
-
-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;
-	}
-
-
-
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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;
+	}
+
+
+
+}
+
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Utils.java	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Utils.java	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@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
@@ -25,18 +25,18 @@
 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;
-import android.widget.Toast;
 
 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 
@@ -49,34 +49,32 @@
 			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{
-				Toast.makeText(c, R.string.sdcard_not_mounted, Toast.LENGTH_LONG).show();
 				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/";				
 			}
-			Toast.makeText(c, R.string.sdcard_not_mounted, Toast.LENGTH_LONG).show();
 			return null;
 		}
 	}
-	
+
 	/**
 	 * Get files from dirName, dir name is relative to {@link getDownloadPath}
 	 * @param dirName
@@ -86,15 +84,15 @@
 	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
@@ -104,14 +102,14 @@
 	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
@@ -127,7 +125,7 @@
 			return false;
 		}
 	}
-	
+
 	/**
 	 * Gives back all dirs which contain a file with suffix fileSuffix
 	 * @param c
@@ -135,19 +133,16 @@
 	 * @param fileSuffix
 	 * @return
 	 */
-	public static String[] getDirsWithFileSuffix(Context c, String path, String fileSuffix){
+	public static List<String> getDirsWithFileSuffix(Context c, String path, String fileSuffix){
 		File[] files = getFilesFromRelativeDir(c,path);
-		String[] validFiles = new String[files.length];
-		int validCounter = 0;
-		
+		ArrayList<String> ret = new ArrayList<String>();
+
 		for(File f : files){
-			if(hasFileWithSuffix(f, fileSuffix)) validFiles[validCounter++] = f.getName();
+			if(hasFileWithSuffix(f, fileSuffix)) ret.add(f.getName());
 		}
-		String[] ret = new String[validCounter];
-		System.arraycopy(validFiles, 0, ret, 0, validCounter);
 		return ret;
 	}
-	
+
 	/**
 	 * Get all files from directory dir which have the given suffix
 	 * @param c
@@ -167,13 +162,13 @@
 		}
 		return ret;
 	}
-	
-    /**
-     * Moves resources pointed to by sourceResId (from @res/raw/) to the app's private data directory
-     * @param c
-     * @param sourceResId
-     * @param directory
-     */
+
+	/**
+	 * 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;
@@ -214,12 +209,12 @@
 					} catch (IOException e) {
 						e.printStackTrace();
 					}
-				if(bos != null)
-					try {
-						bos.close();
-					} catch (IOException e) {
-						e.printStackTrace();
-					}
+					if(bos != null)
+						try {
+							bos.close();
+						} catch (IOException e) {
+							e.printStackTrace();
+						}
 			}
 		}
 	}
--- a/project_files/Android-build/Templates/Makefile.android	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/Templates/Makefile.android	Sun Oct 28 13:28:23 2012 +0100
@@ -1,27 +1,41 @@
-SDL_ANDROID_DIR=./SDL-android-project
+SDL_ANDROID_DIR=${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project
 
-PPCROSSARM=${FPC_DIR}/compiler/ppcrossarm
-PPCROSSARM_FLAGS= -Xd -O- -Tlinux -XParm-linux-androideabi- -vwnh -XS -a- -B
+PPCROSSARM=${FPC_DIR}/ppcrossarm
+PPCROSSARM_FLAGS= -Xd -O2 -g -Tlinux -XParm-linux-androideabi- -B -vwnh -n
 PPCROSSARM_INCLUDES= \
-	-FD${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin \
-	-Fu${FPC_DIR}/rtl/units/arm-linux \
+	-FD${ANDROID_NDK_TOOLCHAINDIR}/bin \
+	-Fu${FPC_DIR}/../rtl/units/arm-linux \
+        -Fu${CMAKE_CURRENT_SOURCE_DIR} \
+        -Fi../../hedgewars \
 	-Fl${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_LVL}/arch-arm/usr/lib \
 	-Fl$(SDL_ANDROID_DIR)/libs/armeabi \
-	-Fl${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \
+	-Fl${ANDROID_NDK_TOOLCHAINDIR}/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \
+
 #LINKERFLAGS= -k"--static"
 FPC_DEFINES=-dandroid -darm
 
-
-all:
-	-${CMAKE_COMMAND} -E make_directory out
+all: install/debug
+build:
+	-${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/out
 
 	${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8
 
-	$(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -oout/libhwengine.so ../../hedgewars/hwLibrary.pas
-	${CMAKE_COMMAND} -E copy out/libhwengine.so SDL-android-project/libs/armeabi/
+	$(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -o${CMAKE_CURRENT_SOURCE_DIR}/out/libhwengine.so ${CMAKE_CURRENT_SOURCE_DIR}/../../hedgewars/hwLibrary.pas
+	${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/out/libhwengine.so $(SDL_ANDROID_DIR)/libs/armeabi/
 
-	${ANT} install -f $(SDL_ANDROID_DIR)/build.xml
+debug: build
+	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml
+	${ANT} debug -f $(SDL_ANDROID_DIR)/build.xml
+unsigned: build 
+	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml
+	${ANT} release -f $(SDL_ANDROID_DIR)/build.xml
+
+install/debug: debug
+	${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml
+install/release: release
+	${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml
+       
 clean:  
-	${CMAKE_COMMAND} -E remove_directory out
+	${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/out
 	${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 clean
 	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml
--- a/project_files/Android-build/Templates/complete_build.sh	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-
-cd SDL-android-project
-${ANDROID_NDK}/ndk-build -j 8
-if [ $? -ne 0 ] 
-then 
-  echo "Failed to execute ${ANDROID_NDK}/ndk-build"
-  exit 1
-fi
-
-cd ..
-make -f Makefile.android
-if [ $? -ne 0 ] 
-then 
-  echo "Failed to execute make"
-  exit 1
-fi
-
-cd SDL-android-project
-ant install
-if [ $? -ne 0 ] 
-then 
-  echo "Failed to execute ant install"
-  exit 1
-fi
-exit 0 
--- a/project_files/Android-build/Templates/default.properties	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-target=android-${ANDROID_SDK_API_LVL}
--- a/project_files/Android-build/Templates/local.properties	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-sdk.dir=${ANDROID_SDK}
--- a/project_files/Android-build/Templates/pushToDevice.sh	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-${ANDROID_SDK}/platform-tools/adb push ./out/libhwengine.so /sdcard/libhwengine.so
-${ANDROID_SDK}/platform-tools/adb shell "su -c \"cat /sdcard/libhwengine.so > /data/data/org.hedgewars.mobile/lib/libhwengine.so \""
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/download_libs.sh	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,18 @@
+#!/bin/sh
+download_and_zip (){
+    echo "Downloading: $1"
+    curl -silent -o tmp.zip $1 #grab the zips from an url
+    unzip -qq tmp.zip  -d SDL-android-project/jni/tmp #unzip it to a tmp file
+    rm -fr SDL-android-project/jni/$2 #remove any old dirs, we will get those files back with hg revert in CMakeList
+    mv SDL-android-project/jni/tmp/* SDL-android-project/jni/$2 #move the tmp dir to the jni directory
+    rm tmp.zip #remove old tmp dir
+}
+download_and_zip http://www.xelification.com/tmp/jpeg.zip jpeg
+download_and_zip http://www.xelification.com/tmp/png.zip png
+download_and_zip http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.zip SDL_image
+download_and_zip http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12.zip SDL_mixer
+download_and_zip http://www.xelification.com/tmp/mikmod.zip mikmod #temporary url since the libsdl.org site doesn't work at the moment
+download_and_zip http://www.xelification.com/tmp/SDL_net.zip SDL_net
+download_and_zip http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.zip SDL_ttf
+download_and_zip http://www.libsdl.org/tmp/SDL-1.3.zip SDL
+
--- a/project_files/Android-build/gles11.pp	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/Android-build/gles11.pp	Sun Oct 28 13:28:23 2012 +0100
@@ -32,7 +32,8 @@
     gl.hh
 }
 
-  procedure init;
+  procedure initModule;
+  procedure freeModule;
 
   const
     External_library='GLESv1_CM'; {Setup as you need}
@@ -1106,15 +1107,14 @@
       pointer(glPointSizePointerOES):=GetProcAddress(hlib,'glPointSizePointerOES');
     end;
 
-procedure init;
+procedure initModule;
 begin
     Loadgles11('libGLESv1_CM.so');
 end;
 
-
-initialization
-  Loadgles11('gles11');
-finalization
+procedure freeModule;
+begin
   Freegles11;
+end;
 
 end.
Binary file project_files/AudioMono/Music/Art.ogg has changed
Binary file project_files/AudioMono/Music/Brick.ogg has changed
Binary file project_files/AudioMono/Music/Castle.ogg has changed
Binary file project_files/AudioMono/Music/City.ogg has changed
Binary file project_files/AudioMono/Music/Compost.ogg has changed
Binary file project_files/AudioMono/Music/Desert.ogg has changed
Binary file project_files/AudioMono/Music/EarthRise.ogg has changed
Binary file project_files/AudioMono/Music/Freeway.ogg has changed
Binary file project_files/AudioMono/Music/Golf.ogg has changed
Binary file project_files/AudioMono/Music/Halloween.ogg has changed
Binary file project_files/AudioMono/Music/Nature.ogg has changed
Binary file project_files/AudioMono/Music/Olympics.ogg has changed
Binary file project_files/AudioMono/Music/Rock.ogg has changed
Binary file project_files/AudioMono/Music/Sheep.ogg has changed
Binary file project_files/AudioMono/Music/bath.ogg has changed
Binary file project_files/AudioMono/Music/hell.ogg has changed
Binary file project_files/AudioMono/Music/main_theme.ogg has changed
Binary file project_files/AudioMono/Music/oriental.ogg has changed
Binary file project_files/AudioMono/Music/pirate.ogg has changed
Binary file project_files/AudioMono/Music/snow.ogg has changed
Binary file project_files/AudioMono/Music/underwater.ogg has changed
Binary file project_files/AudioMono/Sounds/1C.ogg has changed
Binary file project_files/AudioMono/Sounds/2D.ogg has changed
Binary file project_files/AudioMono/Sounds/3E.ogg has changed
Binary file project_files/AudioMono/Sounds/4F.ogg has changed
Binary file project_files/AudioMono/Sounds/5G.ogg has changed
Binary file project_files/AudioMono/Sounds/6A.ogg has changed
Binary file project_files/AudioMono/Sounds/7B.ogg has changed
Binary file project_files/AudioMono/Sounds/8C.ogg has changed
Binary file project_files/AudioMono/Sounds/9D.ogg has changed
Binary file project_files/AudioMono/Sounds/BirdyLay.ogg has changed
Binary file project_files/AudioMono/Sounds/CollectCrate.ogg has changed
Binary file project_files/AudioMono/Sounds/Droplet1.ogg has changed
Binary file project_files/AudioMono/Sounds/Droplet2.ogg has changed
Binary file project_files/AudioMono/Sounds/Droplet3.ogg has changed
Binary file project_files/AudioMono/Sounds/Hellish.ogg has changed
Binary file project_files/AudioMono/Sounds/Whistle.ogg has changed
Binary file project_files/AudioMono/Sounds/Yoohoo.ogg has changed
Binary file project_files/AudioMono/Sounds/baseballbat.ogg has changed
Binary file project_files/AudioMono/Sounds/bee.ogg has changed
Binary file project_files/AudioMono/Sounds/beewater.ogg has changed
Binary file project_files/AudioMono/Sounds/bump.ogg has changed
Binary file project_files/AudioMono/Sounds/cake2.ogg has changed
Binary file project_files/AudioMono/Sounds/denied.ogg has changed
Binary file project_files/AudioMono/Sounds/drillgun.ogg has changed
Binary file project_files/AudioMono/Sounds/egg.ogg has changed
Binary file project_files/AudioMono/Sounds/explosion.ogg has changed
Binary file project_files/AudioMono/Sounds/graveimpact.ogg has changed
Binary file project_files/AudioMono/Sounds/grenadeimpact.ogg has changed
Binary file project_files/AudioMono/Sounds/gun.ogg has changed
Binary file project_files/AudioMono/Sounds/hammer.ogg has changed
Binary file project_files/AudioMono/Sounds/hell_growl.ogg has changed
Binary file project_files/AudioMono/Sounds/hell_ooff.ogg has changed
Binary file project_files/AudioMono/Sounds/hell_ow.ogg has changed
Binary file project_files/AudioMono/Sounds/hell_ugh.ogg has changed
Binary file project_files/AudioMono/Sounds/hogchant3.ogg has changed
Binary file project_files/AudioMono/Sounds/homerun.ogg has changed
Binary file project_files/AudioMono/Sounds/lowgravity.ogg has changed
Binary file project_files/AudioMono/Sounds/melonimpact.ogg has changed
Binary file project_files/AudioMono/Sounds/mineimpact.ogg has changed
Binary file project_files/AudioMono/Sounds/minetick.ogg has changed
Binary file project_files/AudioMono/Sounds/molotov.ogg has changed
Binary file project_files/AudioMono/Sounds/mortar.ogg has changed
Binary file project_files/AudioMono/Sounds/parachute.ogg has changed
Binary file project_files/AudioMono/Sounds/pickhammer.ogg has changed
Binary file project_files/AudioMono/Sounds/placed.ogg has changed
Binary file project_files/AudioMono/Sounds/plane.ogg has changed
Binary file project_files/AudioMono/Sounds/rcplane.ogg has changed
Binary file project_files/AudioMono/Sounds/ride_of_the_valkyries.ogg has changed
Binary file project_files/AudioMono/Sounds/ropeattach.ogg has changed
Binary file project_files/AudioMono/Sounds/roperelease.ogg has changed
Binary file project_files/AudioMono/Sounds/ropeshot.ogg has changed
Binary file project_files/AudioMono/Sounds/shotgunfire.ogg has changed
Binary file project_files/AudioMono/Sounds/shotgunreload.ogg has changed
Binary file project_files/AudioMono/Sounds/shutterclick.ogg has changed
Binary file project_files/AudioMono/Sounds/sinegun.ogg has changed
Binary file project_files/AudioMono/Sounds/skip.ogg has changed
Binary file project_files/AudioMono/Sounds/sniperreload.ogg has changed
Binary file project_files/AudioMono/Sounds/splash.ogg has changed
Binary file project_files/AudioMono/Sounds/steam.ogg has changed
Binary file project_files/AudioMono/Sounds/steps.ogg has changed
Binary file project_files/AudioMono/Sounds/suddendeath.ogg has changed
Binary file project_files/AudioMono/Sounds/switchhog.ogg has changed
Binary file project_files/AudioMono/Sounds/throwpowerup.ogg has changed
Binary file project_files/AudioMono/Sounds/throwrelease.ogg has changed
Binary file project_files/AudioMono/Sounds/ufo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/British/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Classic/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firepunch2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firepunch3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firepunch4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firepunch5.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firepunch6.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Default/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Mobster/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firepunch2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firepunch3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firepunch4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firepunch5.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firepunch6.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Pirate/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firepunch2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firepunch3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firepunch4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firepunch5.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firepunch6.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Robot/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Russian/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firepunch2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firepunch3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firepunch4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firepunch5.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firepunch6.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/FlawlessPossibility.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/VictoryPossibility.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Singer/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Amazing.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Boring.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Brilliant.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Bugger.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Bungee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Byebye.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Comeonthen.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Coward.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Cutitout.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Drat.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Enemydown.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Excellent.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Fire.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firepunch1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firepunch2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firepunch3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firepunch4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firepunch5.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firepunch6.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Firstblood.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Flawless.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Gonnagetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Grenade.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Hello.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Hmm.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Hurry.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Illgetyou.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Incoming.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Jump1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Jump2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Jump3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Justyouwait.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Kamikaze.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Laugh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Leavemealone.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Melon.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Missed.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Nooo.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Nutter.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ohdear.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ooff1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ooff2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ooff3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Oops.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ouch.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ow1.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ow2.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ow3.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Ow4.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Perfect.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/PoisonCough.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/PoisonMoan.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Reinforcements.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Revenge.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Runaway.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Sameteam.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Solong.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Stupid.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Takecover.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Thisoneismine.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Traitor.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Uh-oh.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Victory.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Watchit.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Watchthis.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Whatthe.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Whoopsee.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Yessir.ogg has changed
Binary file project_files/AudioMono/Sounds/voices/Surfer/Youllregretthat.ogg has changed
Binary file project_files/AudioMono/Sounds/warp.ogg has changed
Binary file project_files/AudioMono/Sounds/whipcrack.ogg has changed
--- a/project_files/HedgewarsMobile/Classes/AboutViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 01/08/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/AboutViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 01/08/2010.
  */
 
 
@@ -30,8 +28,7 @@
 }
 
 -(void) viewDidLoad {
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
-        self.tableView.backgroundView = nil;
+    [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]];
     self.tableView.allowsSelection = NO;
 
     NSArray *array = [[NSArray alloc] initWithContentsOfFile:CREDITS_FILE()];
@@ -44,18 +41,23 @@
     else
         imgName = @"smallerBackground~iphone.png";
     UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
+    UIImageView *background = [[UIImageView alloc] initWithImage:img];
     [img release];
+    background.frame = self.view.frame;
+    background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view insertSubview:background atIndex:0];
+    [background release];
+
     [super viewDidLoad];
 }
 
 -(IBAction) buttonPressed:(id) sender {
-    [AudioManagerController playBackSound];
+    [[AudioManagerController mainManager] playBackSound];
     [[self parentViewController] dismissModalViewControllerAnimated:YES];
 }
 
 -(IBAction) segmentedControlChanged:(id) sender {
-    [AudioManagerController playClickSound];
+    [[AudioManagerController mainManager] playClickSound];
     [self.tableView setContentOffset:CGPointMake(0, 0) animated:NO];
     [self.tableView reloadData];
 }
--- a/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 03/10/2010.
- */
-
-
-#import <UIKit/UIKit.h>
-
-
-@interface AmmoMenuViewController : UIViewController {
-    NSArray *buttonsArray;
-    NSArray *imagesArray;
-    
-    UILabel *nameLabel;
-    UILabel *extraLabel;
-    UILabel *captionLabel;
-
-    uint8_t *delay;
-    BOOL *shouldUpdateImage;
-    CGPoint currentPoint;
-    CGPoint placingPoint;
-    BOOL isVisible;
-}
-
-@property (retain) NSArray *buttonsArray;
-@property (retain) NSArray *imagesArray;
-@property (nonatomic,retain) UILabel *nameLabel;
-@property (nonatomic,retain) UILabel *extraLabel;
-@property (nonatomic,retain) UILabel *captionLabel;
-@property (assign) BOOL isVisible;
-
--(void) buttonPressed:(id) sender;
--(void) buttonReleased:(id) sender;
--(void) buttonCancelled:(id) sender;
--(void) appearInView:(UIView *)container;
--(void) disappear;
--(void) updateAmmoVisuals;
--(void) loadLabels;
--(void) loadAmmoStuff:(id) object;
-
-@end
--- a/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,390 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 03/10/2010.
- */
-
-
-#import "AmmoMenuViewController.h"
-#import <QuartzCore/QuartzCore.h>
-
-
-#define BTNS_PER_ROW         9
-#define DEFAULT_DESCRIPTION  IS_IPAD() ? \
-                             NSLocalizedString(@"Hold your finger on a weapon to see what it does.\nYou can move this window anywhere on the screen.",@"") : \
-                             NSLocalizedString(@"Hold your finger on a weapon to see what it does.\nTap anywhere to dismiss.",@"")
-
-@implementation AmmoMenuViewController
-@synthesize imagesArray, buttonsArray, nameLabel, extraLabel, captionLabel, isVisible;
-
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
-    return rotationManager(interfaceOrientation);
-}
-
-#pragma mark -
-#pragma mark view handling
--(void) viewDidLoad {    
-    self.view.frame = CGRectMake(0, 0, 480, 320);
-    self.view.backgroundColor = [UIColor blackColor];
-    self.view.layer.borderColor = [[UIColor whiteColor] CGColor];
-    self.view.layer.borderWidth = 1.3f;
-    [self.view.layer setCornerRadius:10];
-    [self.view.layer setMasksToBounds:YES];
-    self.view.autoresizingMask = UIViewAutoresizingNone;
-    placingPoint = CGPointMake(-1, -1);
-
-    self.isVisible = NO;
-    delay = (uint8_t *)calloc(HW_getNumberOfWeapons(), sizeof(uint8_t));
-    HW_getAmmoDelays(delay);
-
-    shouldUpdateImage = (BOOL *)calloc(HW_getNumberOfWeapons(), sizeof(BOOL));
-
-    [super viewDidLoad];
-}
-
--(void) viewWillAppear:(BOOL)animated {
-    [self updateAmmoVisuals];
-    [super viewWillAppear:animated];
-}
-
--(void) appearInView:(UIView *)container {
-    [self viewWillAppear:YES];
-    [container addSubview:self.view];
-
-    if (placingPoint.x == -1 || placingPoint.y == -1)
-        placingPoint = container.center;
-    self.view.center = placingPoint;
-
-    self.isVisible = YES;
-    if (IS_IPAD() == NO)
-        HW_pause();
-}
-
--(void) disappear {
-    if (self.isVisible)
-        [self.view removeFromSuperview];
-    self.isVisible = NO;
-    placingPoint = self.view.center;
-    if (IS_IPAD() == NO)
-        HW_pauseToggle();
-}
-
-#pragma mark -
-#pragma mark drawing
--(void) loadLabels {
-    int x = 12;
-    int y = (HW_getNumberOfWeapons()/BTNS_PER_ROW)*44 + 18;
-    UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(x, y, 200, 20)];
-    name.backgroundColor = [UIColor clearColor];
-    name.textColor = [UIColor darkYellowColor];
-    name.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
-    self.nameLabel = name;
-    [self.view addSubview:self.nameLabel];
-    [name release];
-
-    UILabel *caption = [[UILabel alloc] initWithFrame:CGRectMake(x+200, y, 220, 20)];
-    caption.backgroundColor = [UIColor clearColor];
-    caption.textColor = [UIColor whiteColor];
-    caption.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];
-    caption.adjustsFontSizeToFitWidth = YES;
-    caption.minimumFontSize = 8;
-    self.captionLabel = caption;
-    [self.view addSubview:self.captionLabel];
-    [caption release];
-
-    UILabel *description = [[UILabel alloc] initWithFrame:CGRectMake(x+2, self.view.frame.size.height-50, 415, 53)];
-    description.backgroundColor = [UIColor clearColor];
-    description.textColor = [UIColor whiteColor];
-    description.text = DEFAULT_DESCRIPTION;
-    description.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]];
-    description.adjustsFontSizeToFitWidth = YES;
-    description.minimumFontSize = 8;
-    description.numberOfLines = 0;
-    self.extraLabel = description;
-    [self.view addSubview:self.extraLabel];
-    [description release];
-}
-
--(void) loadAmmoStuff:(id) object {
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()];
-    UIImage *ammoStoreImage = [[UIImage alloc] initWithContentsOfFile:str];
-    CGFloat theScale = [[UIScreen mainScreen] safeScale];
-
-    NSMutableArray *imgs = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()];
-    NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()];
-    int i, j, e;
-    for (i = 0, j = 0, e = 0; i < HW_getNumberOfWeapons(); i++) {
-        int x, y;
-        float w, radius;
-        
-        // move utilities aside and make 'em rounded
-        if (HW_isWeaponAnEffect(i)) {
-            x = 432;
-            y = 20 + 48*e++;
-            w = 1.5;
-            radius = 22;
-        } else {
-            x = 10+(j%BTNS_PER_ROW)*44;
-            y = 10+(j/BTNS_PER_ROW)*44;
-            if (j / BTNS_PER_ROW % 2 != 0)
-                x += 20;
-            w = 1;
-            radius = 6;
-            j++;
-        }
-
-        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
-        button.frame = CGRectMake(x, y, 40, 40);
-        button.tag = i;
-        button.layer.borderColor = [[UIColor lightYellowColor] CGColor];
-        button.layer.borderWidth = w;
-        [button.layer setCornerRadius:radius];
-        [button.layer setMasksToBounds:YES];
-        [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown];
-        [button addTarget:self action:@selector(buttonReleased:) forControlEvents:UIControlEventTouchUpInside];
-        [button addTarget:self action:@selector(buttonCancelled:) forControlEvents:UIControlEventTouchUpOutside|UIControlEventTouchCancel];
-        [button setTitleColor:[UIColor lightYellowColor] forState:UIControlStateNormal];
-        button.titleLabel.backgroundColor = [UIColor blackColor];
-        button.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]];
-        [button.titleLabel.layer setCornerRadius:3];
-        [button.titleLabel.layer setMasksToBounds:YES];
-        button.titleLabel.layer.borderColor = [[UIColor whiteColor] CGColor];
-        button.titleLabel.layer.borderWidth = 1;
-        [self.view addSubview:button];
-        [array addObject:button];
-
-        int size = 32 * theScale;
-        int x_src = ((i*size)/(int)(ammoStoreImage.size.height * theScale))*size;
-        int y_src = (i*size)%(int)(ammoStoreImage.size.height * theScale);
-        UIImage *img = [ammoStoreImage cutAt:CGRectMake(x_src, y_src, size, size)];
-        [imgs addObject:img];
-    }
-    [self performSelectorOnMainThread:@selector(setButtonsArray:) withObject:array waitUntilDone:NO];
-    [array release];
-
-    [self performSelectorOnMainThread:@selector(setImagesArray:) withObject:imgs waitUntilDone:NO];
-    [imgs release];
-    [ammoStoreImage release];
-
-    [self performSelectorOnMainThread:@selector(loadLabels) withObject:nil waitUntilDone:NO];
-    
-    [self performSelectorOnMainThread:@selector(updateAmmoVisuals) withObject:nil waitUntilDone:YES];
-    UIActivityIndicatorView *spinner = (UIActivityIndicatorView *)object;
-    [spinner stopAnimating];
-    [pool drain];
-}
-
--(void) updateAmmoVisuals {
-    if (self.buttonsArray == nil || self.imagesArray == nil) {
-        UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
-        spinner.hidesWhenStopped = YES;
-        spinner.center = self.view.center;
-        [spinner startAnimating];
-        [self.view addSubview:spinner];
-        [NSThread detachNewThreadSelector:@selector(loadAmmoStuff:) toTarget:self withObject:spinner];
-        [spinner release];
-        return;
-    }
-    
-    int *loadout = (int *)calloc(HW_getNumberOfWeapons(), sizeof(int));
-    int res = HW_getAmmoCounts(loadout);
-    int turns = HW_getTurnsForCurrentTeam();
-    
-    if (res == 0) {
-        self.view.userInteractionEnabled = YES;
-        
-        for (int i = 0; i < HW_getNumberOfWeapons(); i++) {
-            UIButton *button = [self.buttonsArray objectAtIndex:i];
-            if (loadout[i] > 0) {
-                if (delay[i]-turns >= 0) {
-                    button.layer.borderColor = [[UIColor lightGrayColor] CGColor];
-                    [button setTitle:[NSString stringWithFormat:@" %d ",delay[i]-turns+1] forState:UIControlStateNormal];
-                    if (button.currentBackgroundImage == nil || shouldUpdateImage[i] == NO) {
-                        UIImage *img = [self.imagesArray objectAtIndex:i];
-                        [button setBackgroundImage:[img convertToGrayScale] forState:UIControlStateNormal];
-                        shouldUpdateImage[i] = YES;
-                    }
-                } else {
-                    button.layer.borderColor = [[UIColor lightYellowColor] CGColor];
-                    [button setTitle:nil forState:UIControlStateNormal];
-                    if (button.currentBackgroundImage == nil || shouldUpdateImage[i] == YES) {
-                        UIImage *img = [self.imagesArray objectAtIndex:i];
-                        [button setBackgroundImage:img forState:UIControlStateNormal];
-                        shouldUpdateImage[i] = NO;
-                    }
-                }
-                button.enabled = YES;
-            } else {
-                if (button.enabled == YES)
-                    [button setBackgroundImage:nil forState:UIControlStateNormal];
-                button.layer.borderColor = [[UIColor darkGrayColor] CGColor];
-                button.enabled = NO;
-                shouldUpdateImage[i] = NO;
-            }
-        }
-    } else {
-        self.view.userInteractionEnabled = NO;
-    }
-
-    free(loadout);
-    loadout = NULL;
-}
-
-#pragma mark -
-#pragma mark user interaction
--(void) buttonPressed:(id) sender {
-    UIButton *theButton = (UIButton *)sender;
-    if (self.nameLabel == nil || self.extraLabel == nil)
-        [self loadLabels];
-
-    self.nameLabel.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(theButton.tag)];
-    // description contains a lot of unnecessary stuff, we clean it by removing .|, !| and ?|
-    NSString *description = [NSString stringWithUTF8String:HW_getWeaponDescriptionByIndex(theButton.tag)];
-    NSArray *elements = [description componentsSeparatedByString:@".|"];
-    NSArray *purgedElements = [[elements objectAtIndex:0] componentsSeparatedByString:@"!|"];
-    NSArray *morePurgedElements = [[purgedElements objectAtIndex:0] componentsSeparatedByString:@"?|"];
-    self.extraLabel.text = [[[morePurgedElements objectAtIndex:0] stringByReplacingOccurrencesOfString:@"|" withString:@" "] stringByAppendingString:@"."];
-    if (theButton.currentTitle != nil)
-        self.captionLabel.text = NSLocalizedString(@"This weapon is locked",@"");
-    else
-        self.captionLabel.text = [NSString stringWithUTF8String:HW_getWeaponCaptionByIndex(theButton.tag)];
-    
-    self.nameLabel.backgroundColor = [UIColor blackColor];
-    self.captionLabel.backgroundColor = [UIColor blackColor];
-    self.extraLabel.backgroundColor = [UIColor blackColor];
-
-    int y, x = 8;
-    // display labels on top for lower buttons
-    if (theButton.tag > 41)
-        y = 5;
-    else
-        y = (HW_getNumberOfWeapons()/BTNS_PER_ROW)*40;
-
-    self.nameLabel.frame = CGRectMake(x, y, 200, 20);
-    self.captionLabel.frame = CGRectMake(x+200, y, 220, 20);
-    self.extraLabel.frame = CGRectMake(x+2, y+20, 415, 53);
-}
-
--(void) buttonCancelled:(id) sender {
-    self.nameLabel.text = nil;
-    self.extraLabel.text = nil;
-    self.captionLabel.text = nil;
-    self.extraLabel.backgroundColor = [UIColor clearColor];
-    self.captionLabel.backgroundColor = [UIColor clearColor];
-    self.nameLabel.backgroundColor = [UIColor clearColor];
-}
-
--(void) buttonReleased:(id) sender {
-    UIButton *theButton = (UIButton *)sender;
-    if (self.nameLabel == nil || self.extraLabel == nil)
-        [self loadLabels];
-
-    if (theButton.currentTitle == nil) {
-        HW_setWeapon(theButton.tag);
-        [AudioManagerController playClickSound];
-        if (IS_DUALHEAD() == NO)
-            [self disappear];
-    }
-    [self buttonCancelled:sender];
-}
-
--(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
-    NSSet *allTouches = [event allTouches];
-
-    if (IS_IPAD() && [touches count] == 1) {
-        self.view.layer.borderWidth = 3.5;
-        currentPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
-    }
-
-    if (IS_IPAD() == NO)
-        [self disappear];
-}
-
--(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
-    self.view.layer.borderWidth = 1.3;
-}
-
-// better window dragging implementation by
-// http://iphonedevelopertips.com/graphics/drag-an-image-within-the-bounds-of-superview.html
--(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
-    if (IS_IPAD() && [touches count] == 1) {
-        // Get active location upon move
-        CGPoint activePoint = [[touches anyObject] locationInView:self.view];
-
-        // Determine new point based on where the touch is now located
-        CGPoint newPoint = CGPointMake(self.view.center.x + (activePoint.x - currentPoint.x),
-                                       self.view.center.y + (activePoint.y - currentPoint.y));
-
-        // Make sure we stay within the bounds of the parent view
-        float midPointX = CGRectGetMidX(self.view.bounds);
-        if (newPoint.x > self.view.superview.bounds.size.width  - midPointX)
-            newPoint.x = self.view.superview.bounds.size.width - midPointX;
-        else if (newPoint.x < midPointX)
-            newPoint.x = midPointX;
-
-        float midPointY = CGRectGetMidY(self.view.bounds);
-        if (newPoint.y > self.view.superview.bounds.size.height  - midPointY)
-            newPoint.y = self.view.superview.bounds.size.height - midPointY;
-        else if (newPoint.y < midPointY)
-            newPoint.y = midPointY;
-
-        self.view.center = newPoint;
-    }
-}
-
--(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
-    [self touchesEnded:touches withEvent:event];
-}
-
-#pragma mark -
-#pragma mark memory
--(void) didReceiveMemoryWarning {
-    self.imagesArray = nil;
-    if (self.isVisible == NO)
-        self.buttonsArray = nil;
-    self.nameLabel = nil;
-    self.extraLabel = nil;
-    self.captionLabel = nil;
-    MSG_MEMCLEAN();
-    [super didReceiveMemoryWarning];
-}
-
--(void) viewDidUnload {
-    self.imagesArray = nil;
-    self.buttonsArray = nil;
-    self.nameLabel = nil;
-    self.extraLabel = nil;
-    self.captionLabel = nil;
-    free(delay);
-    delay = NULL;
-    free(shouldUpdateImage);
-    shouldUpdateImage = NULL;
-    MSG_DIDUNLOAD();
-    [super viewDidUnload];
-}
-
--(void) dealloc {
-    releaseAndNil(nameLabel);
-    releaseAndNil(extraLabel);
-    releaseAndNil(captionLabel);
-    releaseAndNil(imagesArray);
-    releaseAndNil(buttonsArray);
-    [super dealloc];
-}
-
-@end
--- a/project_files/HedgewarsMobile/Classes/Appirater.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/Appirater.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,5 +1,5 @@
 /*
- This file is part of Appirater.
+ This file is part of Appirater, http://arashpayan.com
  
  Copyright (c) 2010, Arash Payan
  All rights reserved.
@@ -25,14 +25,7 @@
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.
  */
-/*
- * Appirater.h
- * appirater
- *
- * Created by Arash Payan on 9/5/09.
- * http://arashpayan.com
- * Copyright 2010 Arash Payan. All rights reserved.
- */
+
 
 #import <Foundation/Foundation.h>
 
--- a/project_files/HedgewarsMobile/Classes/Appirater.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/Appirater.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,5 +1,5 @@
 /*
- This file is part of Appirater.
+ This file is part of Appirater, http://arashpayan.com
  
  Copyright (c) 2010, Arash Payan
  All rights reserved.
@@ -25,14 +25,7 @@
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.
  */
-/*
- * Appirater.m
- * appirater
- *
- * Created by Arash Payan on 9/5/09.
- * http://arashpayan.com
- * Copyright 2010 Arash Payan. All rights reserved.
- */
+
 
 #import "Appirater.h"
 #import <SystemConfiguration/SCNetworkReachability.h>
--- a/project_files/HedgewarsMobile/Classes/AudioManagerController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/AudioManagerController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,26 +14,45 @@
  * 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 created on 23/09/2011.
  */
 
 
 #import <Foundation/Foundation.h>
+#import <AudioToolbox/AudioToolbox.h>
 
 
+@class AVAudioPlayer;
+
 @interface AudioManagerController : NSObject {
+    @private
+    AVAudioPlayer *backgroundMusic;
+    SystemSoundID clickSound;
+    SystemSoundID backSound;
+    SystemSoundID selSound;
 
+    NSOperationQueue *audioFaderQueue;
 }
 
-+(void) playBackgroundMusic;
-+(void) pauseBackgroundMusic;
-+(void) stopBackgroundMusic;
+@property (nonatomic,retain) AVAudioPlayer *backgroundMusic;
+@property (assign) SystemSoundID clickSound;
+@property (assign) SystemSoundID backSound;
+@property (assign) SystemSoundID selSound;
+
+@property (nonatomic,retain) NSOperationQueue *audioFaderQueue;
+
++(id) mainManager;
 
-+(void) playClickSound;
-+(void) playBackSound;
-+(void) playSelectSound;
+-(void) playBackgroundMusic;
+-(void) pauseBackgroundMusic;
+-(void) stopBackgroundMusic;
 
-+(void) releaseCache;
+-(void) fadeInBackgroundMusic;
+-(void) fadeOutBackgroundMusic;
+
+-(void) playClickSound;
+-(void) playBackSound;
+-(void) playSelectSound;
+-(SystemSoundID) loadSound:(NSString *)snd;
+-(void) unloadSounds;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/AudioManagerController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/AudioManagerController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,61 +14,120 @@
  * 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 created on 23/09/2011.
  */
 
 
 #import "AudioManagerController.h"
 #import "AVFoundation/AVAudioPlayer.h"
-#import <AudioToolbox/AudioToolbox.h>
+#import "MXAudioPlayerFadeOperation.h"
 
 
-static AVAudioPlayer *backgroundMusic = nil;
-static SystemSoundID clickSound = -1;
-static SystemSoundID backSound = -1;
-static SystemSoundID selSound = -1;
+#define DEFAULT_VOLUME    0.45f
+#define FADEOUT_DURATION  3.0f
+#define FADEIN_DURATION   2.0f
+
+static AudioManagerController *mainInstance;
 
 @implementation AudioManagerController
+@synthesize backgroundMusic, clickSound, backSound, selSound, audioFaderQueue;
+
++(id) mainManager {
+    if (mainInstance == nil)
+        mainInstance = [[self alloc] init];
+    return mainInstance;
+}
+
+-(id) init {
+    if ((self = [super init])) {
+        self.backgroundMusic = nil;
+        self.clickSound = -1;
+        self.backSound = -1;
+        self.selSound = -1;
+
+        self.audioFaderQueue = nil;
+    }
+    return self;
+}
+
+-(void) dealloc {
+    [self unloadSounds];
+    releaseAndNil(backgroundMusic);
+    releaseAndNil(audioFaderQueue);
+    mainInstance = nil;
+    [super dealloc];
+}
+
+-(void) didReceiveMemoryWarning {
+    if (self.backgroundMusic.playing == NO)
+        self.backgroundMusic = nil;
+    if ([self.audioFaderQueue operationCount] == 0)
+        self.audioFaderQueue = nil;
+
+    [self unloadSounds];
+    MSG_MEMCLEAN();
+}
 
 #pragma mark -
 #pragma mark background music control
-+(void) loadBackgroundMusic {
-    NSString *musicString = [[NSBundle mainBundle] pathForResource:@"hwclassic" ofType:@"mp3"];
-    backgroundMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:musicString] error:nil];
-
-    backgroundMusic.delegate = nil;
-    backgroundMusic.volume = 0.4f;
-    backgroundMusic.numberOfLoops = -1;
-    [backgroundMusic prepareToPlay];
-}
-
-+(void) playBackgroundMusic {
+-(void) playBackgroundMusic {
     if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"music"] boolValue] == NO)
         return;
 
-    if (backgroundMusic == nil)
-        [AudioManagerController loadBackgroundMusic];
+    if (self.backgroundMusic == nil) {
+        NSString *musicString = [[NSBundle mainBundle] pathForResource:@"hwclassic" ofType:@"mp3"];
+        self.backgroundMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:musicString] error:nil];
+        self.backgroundMusic.delegate = nil;
+        self.backgroundMusic.numberOfLoops = -1;
+    }
+    
+    self.backgroundMusic.volume = DEFAULT_VOLUME;
+    [self.backgroundMusic play];
+}
 
-    [backgroundMusic play];
+-(void) pauseBackgroundMusic {
+    [self.backgroundMusic pause];
+}
+
+-(void) stopBackgroundMusic {
+    [self.backgroundMusic stop];
 }
 
-+(void) pauseBackgroundMusic {
-    [backgroundMusic pause];
+-(void) fadeOutBackgroundMusic {
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"music"] boolValue] == NO)
+        return;
+
+    if (self.audioFaderQueue == nil)
+        self.audioFaderQueue = [[NSOperationQueue alloc] init];
+    
+    MXAudioPlayerFadeOperation *fadeOut = [[MXAudioPlayerFadeOperation alloc] initFadeWithAudioPlayer:self.backgroundMusic
+                                                                                             toVolume:0.0
+                                                                                         overDuration:FADEOUT_DURATION];
+    [self.audioFaderQueue addOperation:fadeOut];
+    [fadeOut release];
 }
 
-+(void) stopBackgroundMusic {
-    [backgroundMusic stop];
+-(void) fadeInBackgroundMusic {
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"music"] boolValue] == NO)
+        return;
+
+    if (self.audioFaderQueue == nil)
+        self.audioFaderQueue = [[NSOperationQueue alloc] init];
+
+    [self playBackgroundMusic];
+    MXAudioPlayerFadeOperation *fadeIn = [[MXAudioPlayerFadeOperation alloc] initFadeWithAudioPlayer:self.backgroundMusic
+                                                                                            toVolume:DEFAULT_VOLUME
+                                                                                        overDuration:FADEIN_DURATION];
+    [audioFaderQueue addOperation:fadeIn];
+    [fadeIn release];
 }
 
 #pragma mark -
 #pragma mark sound effects control
-+(SystemSoundID) loadSound:(NSString *)snd {
-    // get the filename of the sound file:
-    NSString *path = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] resourcePath],snd];
+-(SystemSoundID) loadSound:(NSString *)snd {
+    SystemSoundID soundID;
 
-    // declare a system sound id and get a URL for the sound file
-    SystemSoundID soundID;
+    // get the filename of the sound file in a NSURL format
+    NSString *path = [[NSBundle mainBundle] pathForResource:snd ofType:@"caf"];
     NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
 
     // use audio sevices to create and play the sound
@@ -76,45 +135,40 @@
     return soundID;
 }
 
-+(void) playClickSound {
-    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"sound"] boolValue] == NO)
-        return;
-    
-    if (clickSound == -1)
-        clickSound = [AudioManagerController loadSound:@"clickSound.wav"];
-    
-    AudioServicesPlaySystemSound(clickSound);
+-(void) unloadSounds {
+    AudioServicesDisposeSystemSoundID(clickSound), clickSound = -1;
+    AudioServicesDisposeSystemSoundID(backSound), backSound = -1;
+    AudioServicesDisposeSystemSoundID(selSound), selSound = -1;
 }
 
-+(void) playBackSound {
+-(void) playClickSound {
     if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"sound"] boolValue] == NO)
         return;
     
-    if (backSound == -1)
-        backSound = [AudioManagerController loadSound:@"backSound.wav"];
+    if (self.clickSound == -1)
+        self.clickSound = [self loadSound:@"clickSound"];
     
-    AudioServicesPlaySystemSound(backSound);
+    AudioServicesPlaySystemSound(self.clickSound);
 }
 
-+(void) playSelectSound {
+-(void) playBackSound {
     if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"sound"] boolValue] == NO)
         return;
     
-    if (selSound == -1)
-        selSound = [AudioManagerController loadSound:@"selSound.wav"];
+    if (self.backSound == -1)
+        self.backSound = [self loadSound:@"backSound"];
     
-    AudioServicesPlaySystemSound(selSound);
+    AudioServicesPlaySystemSound(self.backSound);
 }
 
-#pragma mark -
-#pragma mark memory management
-+(void) releaseCache {
-    [backgroundMusic stop];
-    [backgroundMusic release], backgroundMusic = nil;
-    AudioServicesDisposeSystemSoundID(clickSound), clickSound = -1;
-    AudioServicesDisposeSystemSoundID(backSound), backSound = -1;
-    AudioServicesDisposeSystemSoundID(selSound), selSound = -1;
-    MSG_MEMCLEAN();
+-(void) playSelectSound {
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"sound"] boolValue] == NO)
+        return;
+    
+    if (self.selSound == -1)
+        self.selSound = [self loadSound:@"selSound"];
+    
+    AudioServicesPlaySystemSound(self.selSound);
 }
 
 @end
--- a/project_files/HedgewarsMobile/Classes/CGPointUtils.c	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/CGPointUtils.c	Sun Oct 28 13:28:23 2012 +0100
@@ -14,8 +14,6 @@
  * 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 created on 03/10/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/CGPointUtils.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/CGPointUtils.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,21 +14,20 @@
  * 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 created on 03/10/2010.
  */
 
 
-#import <CoreGraphics/CoreGraphics.h>
+#include <CoreGraphics/CoreGraphics.h>
+
 
 #define degreesToRadians(x) ( M_PI * x / 180.0)
 #define radiansToDegrees(x) (180.0 * x / M_PI )
 
-#define HWX(x) (int)(x-screen.size.height/2)/HW_zoomFactor()
-#define HWY(x) (int)(screen.size.width-x)/HW_zoomFactor() + (IS_IPAD()?40:17.5)*HW_zoomLevel()/HW_zoomFactor()
+#define HWX(x) (int)(x-screen.size.width/2)/HW_zoomFactor()
+#define HWY(x) (int)(screen.size.height-x)/HW_zoomFactor()+(IS_IPAD()?40:17.5)*HW_zoomLevel()/HW_zoomFactor()
 
-#define HWXZ(x) (int)(x-screen.size.height/2)
-#define HWYZ(x) (int)(screen.size.width-x)
+#define HWXZ(x) (int)(x-screen.size.width/2)
+#define HWYZ(x) (int)(screen.size.height-x)
 
 CGFloat distanceBetweenPoints (CGPoint first, CGPoint second);
 CGFloat angleBetweenPoints(CGPoint first, CGPoint second);
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,17 +14,17 @@
  * 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 created on 12/11/2010.
  */
 
 
 #import <Foundation/Foundation.h>
 
+
 @interface CreationChamber : NSObject {
 
 }
 
++(void) createFirstLaunch;
 +(void) createSettings;
 
 +(void) createTeamNamed:(NSString *)nameWithoutExt;
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,24 +14,70 @@
  * 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 created on 12/11/2010.
  */
 
 
 #import "CreationChamber.h"
-#import "hwconsts.h"
 
 
 @implementation CreationChamber
 
+#pragma mark Checking status
++(void) createFirstLaunch {
+    DLog(@"Creating necessary files");
+    NSInteger index;
+
+    // SAVES - just delete and overwrite
+    if ([[NSFileManager defaultManager] fileExistsAtPath:SAVES_DIRECTORY()])
+        [[NSFileManager defaultManager] removeItemAtPath:SAVES_DIRECTORY() error:NULL];
+    [[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY()
+                              withIntermediateDirectories:NO
+                                               attributes:nil
+                                                    error:NULL];
+
+    // SCREENSHOTS - just create it the first time
+    if ([[NSFileManager defaultManager] fileExistsAtPath:SCREENSHOTS_DIRECTORY()] == NO)
+        [[NSFileManager defaultManager] createDirectoryAtPath:SCREENSHOTS_DIRECTORY()
+                                  withIntermediateDirectories:NO
+                                                   attributes:nil
+                                                        error:NULL];
+
+    // SETTINGS - nsuserdefaults ftw
+    [self createSettings];
+
+    // TEAMS - update exisiting teams with new format
+    NSArray *teamNames = [[NSArray alloc] initWithObjects:@"Edit Me!",@"Ninjas",@"Pirates",@"Robots",nil];
+    index = 0;
+    for (NSString *name in teamNames)
+        [self createTeamNamed:name ofType:index++ controlledByAI:[name isEqualToString:@"Robots"]];
+    [teamNames release];
+
+    // SCHEMES - always overwrite and delete custom ones
+    if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES)
+        [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
+    NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate",
+                            @"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless",
+                            @"Thinking with Portals",@"King Mode",nil];
+    index = 0;
+    for (NSString *name in schemeNames)
+        [self createSchemeNamed:name ofType:index++];
+    [schemeNames release];
+
+    // WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically)
+    NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate",
+                            @"Minefield",@"Thinking with Portals",nil];
+    index = 0;
+    for (NSString *name in weaponNames)
+        [self createWeaponNamed:name ofType:index++];
+    [weaponNames release];
+}
+
 #pragma mark Settings
 +(void) createSettings {
     NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
     [settings setObject:[NSNumber numberWithBool:NO] forKey:@"alternate"];
     [settings setObject:[NSNumber numberWithBool:YES] forKey:@"music"];
     [settings setObject:[NSNumber numberWithBool:YES] forKey:@"sound"];
-    [settings setObject:[NSNumber numberWithBool:NO] forKey:@"classic_menu"];
     [settings setObject:[NSNumber numberWithBool:YES] forKey:@"sync_ws"];
 
     // don't overwrite these two strings when present
@@ -45,11 +91,11 @@
 
 #pragma mark Teams
 +(void) createTeamNamed:(NSString *)nameWithoutExt {
-    [CreationChamber createTeamNamed:nameWithoutExt ofType:0 controlledByAI:NO];
+    [self createTeamNamed:nameWithoutExt ofType:0 controlledByAI:NO];
 }
 
 +(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
-    [CreationChamber createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO];
+    [self createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO];
 }
 
 +(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type controlledByAI:(BOOL) shouldAITakeOver {
@@ -137,7 +183,7 @@
 
 #pragma mark Weapons
 +(void) createWeaponNamed:(NSString *)nameWithoutExt {
-    [CreationChamber createWeaponNamed:nameWithoutExt ofType:0];
+    [self createWeaponNamed:nameWithoutExt ofType:0];
 }
 
 +(void) createWeaponNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
@@ -212,7 +258,7 @@
 
 #pragma mark Schemes
 +(void) createSchemeNamed:(NSString *)nameWithoutExt {
-    [CreationChamber createSchemeNamed:nameWithoutExt ofType:0];
+    [self createSchemeNamed:nameWithoutExt ofType:0];
 }
 
 +(void) createSchemeNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
@@ -234,7 +280,7 @@
 
     NSArray *mods = [[NSArray alloc] initWithContentsOfFile:GAMEMODS_FILE()];
     NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]];
-    for (int i = 0; i < [mods count]; i++)
+    for (NSUInteger i = 0; i < [mods count]; i++)
         [gamemodArray addObject:[NSNumber numberWithBool:NO]];
     [mods release];
 
--- a/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h	Sun Oct 28 13:28:23 2012 +0100
@@ -14,8 +14,6 @@
  * 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 created on 01/10/2011.
  */
 
 
@@ -38,10 +36,10 @@
 
 
 #define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)
-#define rotationManager(x) (x == UIInterfaceOrientationLandscapeRight) || (x == UIInterfaceOrientationLandscapeLeft)
+#define rotationManager(x) (IS_IPAD() ? YES : (x == UIInterfaceOrientationLandscapeRight) || (x == UIInterfaceOrientationLandscapeLeft))
 
-#define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
-#define END_TIMER(msg) 	NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]);
+#define START_TIMER()   NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
+#define END_TIMER(msg) 	NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; DLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]);
 
 
 #define DOCUMENTS_FOLDER()      [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
@@ -69,13 +67,13 @@
 #define MISSIONS_DIRECTORY()    [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Missions/Maps/"]
 #define TRAININGS_DIRECTORY()   [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Missions/Training/"]
 #define LOCALE_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Locale/"]
-#define SCRIPTS_DIRECTORY()     [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Scripts/plist/"]
+#define SCRIPTS_DIRECTORY()     [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Scripts/Multiplayer/"]
 
 #define MSG_MEMCLEAN()          DLog(@"has cleaned up some memory");
 #define MSG_DIDUNLOAD()         DLog(@"unloaded");
 
-#define IS_DUALHEAD()           ([[UIScreen class] respondsToSelector:@selector(screens)] && [[UIScreen screens] count] > 1)
 #define IS_IPAD()               (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+#define IS_ON_PORTRAIT()        (IS_IPAD() && UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]))
 #define IS_NOT_POWERFUL(x)      ([x hasPrefix:@"iPhone1"] || [x hasPrefix:@"iPod1,1"] || [x hasPrefix:@"iPod2,1"])
 #define IS_NOT_VERY_POWERFUL(x) ([x hasPrefix:@"iPad1"] || [x hasPrefix:@"iPhone2"] || [x hasPrefix:@"iPod3"] || [x hasPrefix:@"iPod4"])
 #define IS_VERY_POWERFUL(x)     (IS_NOT_POWERFUL(x) == NO && IS_NOT_VERY_POWERFUL(x) == NO)
--- a/project_files/HedgewarsMobile/Classes/EditableCellView.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/EditableCellView.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 03/07/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @protocol EditableCellViewDelegate <NSObject>
 
 -(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue;
@@ -31,8 +30,8 @@
     id<EditableCellViewDelegate> delegate;
     UITextField *textField;
     UILabel *titleLabel;
-    NSInteger minimumCharacters;
-    NSInteger maximumCharacters;
+    NSUInteger minimumCharacters;
+    NSUInteger maximumCharacters;
     BOOL respectEditing;
 
 @private
@@ -42,8 +41,8 @@
 @property (nonatomic,assign) id<EditableCellViewDelegate> delegate;
 @property (nonatomic,retain,readonly) UITextField *textField;
 @property (nonatomic,retain,readonly) UILabel *titleLabel;
-@property (nonatomic,assign) NSInteger minimumCharacters;
-@property (nonatomic,assign) NSInteger maximumCharacters;
+@property (nonatomic,assign) NSUInteger minimumCharacters;
+@property (nonatomic,assign) NSUInteger maximumCharacters;
 @property (nonatomic,assign) BOOL respectEditing;
 @property (nonatomic,retain) NSString *oldValue;
 
--- a/project_files/HedgewarsMobile/Classes/EditableCellView.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/EditableCellView.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 03/07/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,23 +14,22 @@
  * 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 created on 10/01/2010.
  */
 
 
 #import <Foundation/Foundation.h>
 #import "SDL_net.h"
 
+
 @protocol EngineProtocolDelegate <NSObject>
 
--(void) gameHasEndedWithStats:(NSArray *)stats;
+-(void) gameEndedWithStatistics:(NSArray *)stats;
 
 @end
 
+
 @interface EngineProtocolNetwork : NSObject {
     id<EngineProtocolDelegate> delegate;
-
     NSOutputStream *stream;
     TCPsocket csd;
     NSInteger enginePort;
@@ -41,14 +40,10 @@
 @property (assign) TCPsocket csd;
 @property (assign) NSInteger enginePort;
 
-
 -(id)   init;
-
-+(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary;
-+(NSInteger) activeEnginePort;
-
+-(id)   initWithPort:(NSInteger) port;
+-(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary;
 -(void) engineProtocol:(id) object;
--(void) gameHasEndedWithStats:(NSArray *)stats;
 
 -(int)  sendToEngine:(NSString *)string;
 -(int)  sendToEngineNoSave:(NSString *)string;
--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,39 +14,29 @@
  * 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 created on 10/01/2010.
  */
 
 
 #import "EngineProtocolNetwork.h"
-#import "OverlayViewController.h"
 
 
 #define BUFFER_SIZE 255     // like in original frontend
 
-static NSInteger activeEnginePort;
-
 @implementation EngineProtocolNetwork
 @synthesize delegate, stream, csd, enginePort;
 
--(id) init {
-    if (self = [super init]) {
+-(id) initWithPort:(NSInteger) port {
+    if ((self = [super init])) {
         self.delegate = nil;
-
         self.csd = NULL;
         self.stream = nil;
-        self.enginePort = [HWUtils randomPort];
+        self.enginePort = port;
     }
-    activeEnginePort = self.enginePort;
     return self;
 }
 
--(void) gameHasEndedWithStats:(NSArray *)stats {
-    if (self.delegate != nil && [self.delegate respondsToSelector:@selector(gameHasEndedWithStats:)])
-        [self.delegate gameHasEndedWithStats:stats];
-    else
-        DLog(@"Error! delegate == nil");
+-(id) init {
+    return [self initWithPort:[HWUtils randomPort]];
 }
 
 -(void) dealloc {
@@ -57,20 +47,14 @@
 
 #pragma mark -
 #pragma mark Spawner functions
-+(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary {
-    EngineProtocolNetwork *proto = [[EngineProtocolNetwork alloc] init];
-    proto.stream = (onSaveFile) ? [[NSOutputStream alloc] initToFileAtPath:onSaveFile append:YES] : nil;
-    [proto.stream open];
+-(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary {
+    self.stream = (onSaveFile) ? [[NSOutputStream alloc] initToFileAtPath:onSaveFile append:YES] : nil;
+    [self.stream open];
 
     // +detachNewThreadSelector retain/release self automatically
     [NSThread detachNewThreadSelector:@selector(engineProtocol:)
-                             toTarget:proto
+                             toTarget:self
                            withObject:dictionary];
-    [proto release];
-}
-
-+(NSInteger) activeEnginePort {
-    return activeEnginePort;
 }
 
 #pragma mark -
@@ -134,7 +118,7 @@
     // if we're loading an older version of ammos fill the engine message with 0s
     int diff = HW_getNumberOfWeapons() - [[ammoData objectForKey:@"ammostore_initialqt"] length];
     NSString *update = @"";
-    while ([update length] < diff)
+    while ((int)[update length] < diff)
         update = [update stringByAppendingString:@"0"];
 
     NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@%@", [ammoData objectForKey:@"ammostore_initialqt"], update];
@@ -186,7 +170,7 @@
     result = [[basicArray objectAtIndex:0] intValue];
     NSArray *basic = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()];
 
-    for (int i = 1; i < [basicArray count]; i++) {
+    for (NSUInteger i = 1; i < [basicArray count]; i++) {
         NSDictionary *dict = [basic objectAtIndex:i];
         NSString *command = [dict objectForKey:@"command"];
         NSInteger value = [[basicArray objectAtIndex:i] intValue];
@@ -365,7 +349,7 @@
                         [statsArray addObject:[NSString stringWithFormat:@"The best shot award won by %s (with %@ points)", &buffer[index], arg]];
                         break;
                     case 'k':           // best hedgehog
-                        [statsArray addObject:[NSString stringWithFormat:@"The best killer is %s with %@ kills in a turn", &buffer[index], arg]];
+                        [statsArray addObject:[NSString stringWithFormat:@"The best killer is %s with %@ kill(s) in a turn", &buffer[index], arg]];
                         break;
                     case 'K':           // number of hogs killed
                         [statsArray addObject:[NSString stringWithFormat:@"%@ hedgehog(s) were killed during this round", arg]];
@@ -393,12 +377,17 @@
                 }
                 break;
             case 'q':
-                // game ended, can remove the savefile and present the statistics of the match
+                // game ended and match finished, statsArray is full of delicious statistics
+                if (self.delegate != nil && [self.delegate respondsToSelector:@selector(gameEndedWithStatistics:)])
+                    [self.delegate gameEndedWithStatistics:statsArray];
+                [statsArray release];
                 [HWUtils setGameStatus:gsEnded];
-                [self gameHasEndedWithStats:statsArray];
+                // closing connection here would trigger a "IPC connection lost" error, so we have to wait until recv fails
                 break;
             case 'Q':
-                // game exited but not completed, nothing to do (just don't save the message)
+                // game exited but not completed, skip this message in the savefile
+                [HWUtils setGameStatus:gsInterrupted];
+                // same here, don't set clientQuit to YES
                 break;
             default:
                 [self dumpRawData:buffer ofSize:msgSize];
@@ -406,11 +395,12 @@
         }
     }
     DLog(@"Engine exited, ending thread");
+
     [self.stream close];
     [self.stream release];
-    [statsArray release];
 
     // Close the client socket
+    [HWUtils freePort:self.enginePort];
     SDLNet_TCP_Close(csd);
     SDLNet_Quit();
 
--- a/project_files/HedgewarsMobile/Classes/ExtraCategories.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.h	Sun Oct 28 13:28:23 2012 +0100
@@ -14,8 +14,6 @@
  * 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 created on 25/10/2011.
  */
 
 
@@ -25,6 +23,7 @@
 @interface UIScreen (safe)
 
 -(CGFloat) safeScale;
+-(CGRect) safeBounds;
 
 @end
 
@@ -47,12 +46,19 @@
 @end
 
 
+@interface UIButton (quickStyle)
+
+-(id) initWithFrame:(CGRect) frame andTitle:(NSString *)title;
+
+@end
+
+
 @interface UILabel (quickStyle)
 
--(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title;
--(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title  withBorderWidth:(CGFloat) borderWidth;
--(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title  withBorderWidth:(CGFloat) borderWidth
-          withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor;
+-(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title;
+-(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth;
+-(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth
+    withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor;
 
 @end
 
--- a/project_files/HedgewarsMobile/Classes/ExtraCategories.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.m	Sun Oct 28 13:28:23 2012 +0100
@@ -14,8 +14,6 @@
  * 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 created on 25/10/2011.
  */
 
 
@@ -34,6 +32,14 @@
     return theScale;
 }
 
+-(CGRect) safeBounds {
+    CGRect original = [self bounds];
+    if (IS_ON_PORTRAIT())
+        return original;
+    else
+        return CGRectMake(original.origin.x, original.origin.y, original.size.height, original.size.width);
+}
+
 @end
 
 
@@ -88,9 +94,31 @@
 
 
 #pragma mark -
+@implementation UIButton (quickStyle)
+
+-(id) initWithFrame:(CGRect) frame andTitle:(NSString *)title {
+    [self initWithFrame:frame];
+    [self setTitle:title forState:UIControlStateNormal];
+    [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
+    self.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
+    self.backgroundColor = [UIColor blackColorTransparent];
+
+    [self.layer setBorderWidth:1];
+    [self.layer setBorderColor:[[UIColor darkYellowColor] CGColor]];
+    [self.layer setCornerRadius:9.0f];
+    [self.layer setMasksToBounds:YES];
+
+    return self;
+}
+
+@end
+
+
+#pragma mark -
 @implementation UILabel (quickStyle)
 
--(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title {
+-(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title {
     return [self initWithFrame:frame
                       andTitle:title
                withBorderWidth:1.5f
@@ -98,7 +126,7 @@
            withBackgroundColor:[UIColor darkBlueColor]];
 }
 
--(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title  withBorderWidth:(CGFloat) borderWidth {
+-(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth {
     return [self initWithFrame:frame
                       andTitle:title
                withBorderWidth:borderWidth
@@ -106,8 +134,8 @@
            withBackgroundColor:[UIColor darkBlueColorTransparent]];
 }
 
--(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title  withBorderWidth:(CGFloat) borderWidth
-          withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor{
+-(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth
+          withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor {
     UILabel *theLabel = [self initWithFrame:frame];
     theLabel.backgroundColor = backColor;
 
--- a/project_files/HedgewarsMobile/Classes/FlagsViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/FlagsViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/FlagsViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/FlagsViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/04/2010.
  */
 
 
@@ -26,12 +24,10 @@
 @implementation FlagsViewController
 @synthesize teamDictionary, flagArray, communityArray, lastIndexPath;
 
-
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
-
 #pragma mark -
 #pragma mark View lifecycle
 -(void) viewDidLoad {
--- a/project_files/HedgewarsMobile/Classes/FortsViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/FortsViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/04/2010.
  */
 
 
@@ -31,6 +29,6 @@
 
 @property (nonatomic,retain) NSDictionary * teamDictionary;
 @property (nonatomic,retain) NSArray *fortArray;
-//@property (nonatomic,retain) NSArray *fortSprites;
 @property (nonatomic,retain) NSIndexPath *lastIndexPath;
+
 @end
--- a/project_files/HedgewarsMobile/Classes/FortsViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/FortsViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/04/2010.
  */
 
 
@@ -41,7 +39,7 @@
     NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL];
     NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / IMGNUM_PER_FORT)];
     // we need to remove the double entries and the L.png suffix
-    for (int i = 0; i < [directoryContents count]; i++) {
+    for (NSUInteger i = 0; i < [directoryContents count]; i++) {
         if (i % IMGNUM_PER_FORT == IMGNUM_PER_FORT-1) {
             NSString *currentName = [directoryContents objectAtIndex:i];
             NSString *correctName = [currentName substringToIndex:([currentName length] - 5)];
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPad.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -12,6 +12,7 @@
 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="2"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -43,10 +44,9 @@
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<object class="IBUIImageView" id="109536142">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">274</int>
 						<string key="NSFrameSize">{1024, 768}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<bool key="IBUIAutoresizesSubviews">NO</bool>
 						<bool key="IBUIClipsSubviews">YES</bool>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -58,10 +58,9 @@
 					</object>
 					<object class="IBUIImageView" id="533754865">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{357, 17}, {309, 165}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -72,10 +71,9 @@
 					</object>
 					<object class="IBUIButton" id="410546531">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{441, 702}, {142, 64}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<int key="IBUITag">1</int>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -105,10 +103,9 @@
 					</object>
 					<object class="IBUIButton" id="495854712">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">268</int>
 						<string key="NSFrame">{{20, 693}, {64, 64}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
 						<int key="IBUIContentHorizontalAlignment">0</int>
@@ -127,10 +124,9 @@
 					</object>
 					<object class="IBUIButton" id="688316814">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">265</int>
 						<string key="NSFrame">{{940, 693}, {64, 64}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<int key="IBUITag">2</int>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -150,10 +146,9 @@
 					</object>
 					<object class="IBUIView" id="123574818">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">278</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{0, 60}, {320, 620}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<object class="NSColor" key="IBUIBackgroundColor" id="720784738">
 							<int key="NSColorSpace">3</int>
 							<bytes key="NSWhite">MCAwAA</bytes>
@@ -164,10 +159,9 @@
 					</object>
 					<object class="IBUIView" id="983956256">
 						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">277</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{337, 187}, {350, 505}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<reference key="IBUIBackgroundColor" ref="720784738"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIClipsSubviews">YES</bool>
@@ -178,7 +172,6 @@
 						<int key="NSvFlags">292</int>
 						<string key="NSFrame">{{269, 724}, {150, 23}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
 						<int key="IBUIContentHorizontalAlignment">0</int>
@@ -186,39 +179,9 @@
 						<float key="IBUIValue">0.05000000074505806</float>
 						<float key="IBUIMaxValue">0.05000000074505806</float>
 					</object>
-					<object class="IBUILabel" id="66923483">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{121, 720}, {148, 30}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Label</string>
-						<object class="NSFont" key="IBUIFont">
-							<string key="NSName">Helvetica-Oblique</string>
-							<double key="NSSize">18</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<object class="NSColor" key="IBUITextColor">
-							<int key="NSColorSpace">3</int>
-							<bytes key="NSWhite">MQA</bytes>
-							<object class="NSColorSpace" key="NSCustomColorSpace">
-								<int key="NSID">2</int>
-							</object>
-						</object>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUITextAlignment">1</int>
-					</object>
 				</object>
 				<string key="NSFrameSize">{1024, 768}</string>
 				<reference key="NSSuperview"/>
-				<reference key="NSWindow"/>
 				<reference key="IBUIBackgroundColor" ref="473179629"/>
 				<bool key="IBUIClipsSubviews">YES</bool>
 				<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
@@ -327,22 +290,6 @@
 					<int key="connectionID">57</int>
 				</object>
 				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">slider</string>
-						<reference key="source" ref="670598485"/>
-						<reference key="destination" ref="1000322445"/>
-					</object>
-					<int key="connectionID">61</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">sizeLabel</string>
-						<reference key="source" ref="670598485"/>
-						<reference key="destination" ref="66923483"/>
-					</object>
-					<int key="connectionID">65</int>
-				</object>
-				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchEventConnection" key="connection">
 						<string key="label">sliderChanged:</string>
 						<reference key="source" ref="1000322445"/>
@@ -360,6 +307,22 @@
 					</object>
 					<int key="connectionID">67</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">titleImage</string>
+						<reference key="source" ref="841351856"/>
+						<reference key="destination" ref="533754865"/>
+					</object>
+					<int key="connectionID">68</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">slider</string>
+						<reference key="source" ref="670598485"/>
+						<reference key="destination" ref="1000322445"/>
+					</object>
+					<int key="connectionID">69</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -394,7 +357,6 @@
 							<reference ref="123574818"/>
 							<reference ref="983956256"/>
 							<reference ref="1000322445"/>
-							<reference ref="66923483"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -467,12 +429,6 @@
 						<reference key="parent" ref="766721923"/>
 						<string key="objectName">Filter Slider</string>
 					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">64</int>
-						<reference key="object" ref="66923483"/>
-						<reference key="parent" ref="766721923"/>
-						<string key="objectName">Filter Label</string>
-					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -506,16 +462,15 @@
 					<string>55.CustomClassName</string>
 					<string>55.IBEditorWindowLastContentRect</string>
 					<string>55.IBPluginDependency</string>
+					<string>60.CustomClassName</string>
 					<string>60.IBPluginDependency</string>
 					<string>60.IBViewBoundsToFrameTransform</string>
-					<string>64.IBPluginDependency</string>
-					<string>64.IBViewBoundsToFrameTransform</string>
 				</object>
 				<object class="NSMutableArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>GameConfigViewController</string>
 					<string>UIResponder</string>
-					<string>{{289, 287}, {1024, 768}}</string>
+					<string>{{252, 239}, {1024, 768}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
@@ -554,14 +509,11 @@
 					<string>MapConfigViewController</string>
 					<string>{{126, 377}, {1024, 768}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<string>MNEValueTrackingSlider</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">AUNRAABEMoAAA</bytes>
 					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAADCtgAAxDoAAA</bytes>
-					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -580,7 +532,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">67</int>
+			<int key="maxID">69</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -627,12 +579,14 @@
 							<string>mapConfigViewController</string>
 							<string>schemeWeaponConfigViewController</string>
 							<string>teamConfigViewController</string>
+							<string>titleImage</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<string>MapConfigViewController</string>
 							<string>SchemeWeaponConfigViewController</string>
 							<string>TeamConfigViewController</string>
+							<string>UIImageView</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -642,6 +596,7 @@
 							<string>mapConfigViewController</string>
 							<string>schemeWeaponConfigViewController</string>
 							<string>teamConfigViewController</string>
+							<string>titleImage</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
@@ -657,6 +612,10 @@
 								<string key="name">teamConfigViewController</string>
 								<string key="candidateClassName">TeamConfigViewController</string>
 							</object>
+							<object class="IBToOneOutletInfo">
+								<string key="name">titleImage</string>
+								<string key="candidateClassName">UIImageView</string>
+							</object>
 						</object>
 					</object>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -665,6 +624,14 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">MNEValueTrackingSlider</string>
+					<string key="superclassName">UISlider</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/MNEValueTrackingSlider.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">MapConfigViewController</string>
 					<string key="superclassName">UIViewController</string>
 					<object class="NSMutableDictionary" key="actions">
@@ -720,7 +687,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -729,8 +695,7 @@
 							<string>UILabel</string>
 							<string>MapPreviewButtonView</string>
 							<string>UISegmentedControl</string>
-							<string>UILabel</string>
-							<string>UISlider</string>
+							<string>MNEValueTrackingSlider</string>
 							<string>UITableView</string>
 						</object>
 					</object>
@@ -741,7 +706,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -760,12 +724,8 @@
 								<string key="candidateClassName">UISegmentedControl</string>
 							</object>
 							<object class="IBToOneOutletInfo">
-								<string key="name">sizeLabel</string>
-								<string key="candidateClassName">UILabel</string>
-							</object>
-							<object class="IBToOneOutletInfo">
 								<string key="name">slider</string>
-								<string key="candidateClassName">UISlider</string>
+								<string key="candidateClassName">MNEValueTrackingSlider</string>
 							</object>
 							<object class="IBToOneOutletInfo">
 								<string key="name">tableView</string>
@@ -814,15 +774,19 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="379894190">
+					<string key="className">UIButton</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="106046383">
 						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">ExtraCategories.h</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<reference key="sourceIdentifier" ref="106046383"/>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">UITableView</string>
-					<reference key="sourceIdentifier" ref="379894190"/>
+					<reference key="sourceIdentifier" ref="106046383"/>
 				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -514,12 +514,14 @@
 							<string>mapConfigViewController</string>
 							<string>schemeWeaponConfigViewController</string>
 							<string>teamConfigViewController</string>
+							<string>titleImage</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<string>MapConfigViewController</string>
 							<string>SchemeWeaponConfigViewController</string>
 							<string>TeamConfigViewController</string>
+							<string>UIImageView</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -529,6 +531,7 @@
 							<string>mapConfigViewController</string>
 							<string>schemeWeaponConfigViewController</string>
 							<string>teamConfigViewController</string>
+							<string>titleImage</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
@@ -544,6 +547,10 @@
 								<string key="name">teamConfigViewController</string>
 								<string key="candidateClassName">TeamConfigViewController</string>
 							</object>
+							<object class="IBToOneOutletInfo">
+								<string key="name">titleImage</string>
+								<string key="candidateClassName">UIImageView</string>
+							</object>
 						</object>
 					</object>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -607,7 +614,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -616,8 +622,7 @@
 							<string>UILabel</string>
 							<string>MapPreviewButtonView</string>
 							<string>UISegmentedControl</string>
-							<string>UILabel</string>
-							<string>UISlider</string>
+							<string>ValueTrackingSliderView</string>
 							<string>UITableView</string>
 						</object>
 					</object>
@@ -628,7 +633,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -647,12 +651,8 @@
 								<string key="candidateClassName">UISegmentedControl</string>
 							</object>
 							<object class="IBToOneOutletInfo">
-								<string key="name">sizeLabel</string>
-								<string key="candidateClassName">UILabel</string>
-							</object>
-							<object class="IBToOneOutletInfo">
 								<string key="name">slider</string>
-								<string key="candidateClassName">UISlider</string>
+								<string key="candidateClassName">ValueTrackingSliderView</string>
 							</object>
 							<object class="IBToOneOutletInfo">
 								<string key="name">tableView</string>
@@ -702,14 +702,22 @@
 				</object>
 				<object class="IBPartialClassDescription">
 					<string key="className">UILabel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="270765233">
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="910572871">
 						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">ExtraCategories.h</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
 					<string key="className">UITableView</string>
-					<reference key="sourceIdentifier" ref="270765233"/>
+					<reference key="sourceIdentifier" ref="910572871"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">ValueTrackingSliderView</string>
+					<string key="superclassName">UISlider</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/MNEValueTrackingSlider.h</string>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
@@ -852,6 +860,14 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">UIImageView</string>
+					<string key="superclassName">UIView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">UIKit.framework/Headers/UIImageView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">UILabel</string>
 					<string key="superclassName">UIView</string>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,32 +14,35 @@
  * 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 created on 18/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @class SchemeWeaponConfigViewController;
 @class TeamConfigViewController;
 @class MapConfigViewController;
-@class HelpPageViewController;
+//@class HelpPageLobbyViewController;
 
 @interface GameConfigViewController : UIViewController {
     UIView *imgContainer;
+    UIImageView *titleImage;
+    UILabel *sliderBackground;
 
     SchemeWeaponConfigViewController *schemeWeaponConfigViewController;
     TeamConfigViewController *teamConfigViewController;
     MapConfigViewController *mapConfigViewController;
-    HelpPageViewController *helpPage;
+    //HelpPageLobbyViewController *helpPage;
 }
 
 @property (retain) UIView *imgContainer;
+@property (nonatomic,retain) UILabel * sliderBackground;
+@property (nonatomic,retain) IBOutlet UIImageView *titleImage;
 @property (nonatomic,retain) IBOutlet SchemeWeaponConfigViewController *schemeWeaponConfigViewController;
 @property (nonatomic,retain) IBOutlet TeamConfigViewController *teamConfigViewController;
 @property (nonatomic,retain) IBOutlet MapConfigViewController *mapConfigViewController;
-@property (nonatomic,retain) HelpPageViewController *helpPage;
+//@property (nonatomic,retain) HelpPageLobbyViewController *helpPage;
 
 -(IBAction) buttonPressed:(id) sender;
 -(IBAction) segmentPressed:(id) sender;
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 18/04/2010.
  */
 
 
@@ -23,13 +21,12 @@
 #import "MapConfigViewController.h"
 #import "TeamConfigViewController.h"
 #import "SchemeWeaponConfigViewController.h"
-#import "HelpPageViewController.h"
 #import "GameInterfaceBridge.h"
 
 
 @implementation GameConfigViewController
-@synthesize imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
-
+@synthesize imgContainer, titleImage, sliderBackground, //helpPage,
+            mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return rotationManager(interfaceOrientation);
@@ -49,12 +46,12 @@
                 [alert show];
                 [alert release];
             } else {
-                [AudioManagerController playBackSound];
+                [[AudioManagerController mainManager] playBackSound];
                 [[self parentViewController] dismissModalViewControllerAnimated:YES];
             }
             break;
         case 1:
-            [AudioManagerController playClickSound];
+            [[AudioManagerController mainManager] playClickSound];
             if ([self isEverythingSet] == NO)
                 return;
             theButton.enabled = NO;
@@ -68,14 +65,16 @@
             
             break;
         case 2:
-            [AudioManagerController playClickSound];
+            [[AudioManagerController mainManager] playClickSound];
+            /*
             if (self.helpPage == nil)
-                self.helpPage = [[HelpPageViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil];
+                self.helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil];
             self.helpPage.view.alpha = 0;
             [self.view addSubview:self.helpPage.view];
             [UIView beginAnimations:@"helplobby" context:NULL];
             self.helpPage.view.alpha = 1;
             [UIView commitAnimations];
+            */
             break;
         default:
             DLog(@"Nope");
@@ -87,7 +86,7 @@
 
     UISegmentedControl *theSegment = (UISegmentedControl *)sender;
 
-    [AudioManagerController playSelectSound];
+    [[AudioManagerController mainManager] playSelectSound];
     switch (theSegment.selectedSegmentIndex) {
         case 0:
             // this message is compulsory otherwise the table won't be loaded at all
@@ -105,13 +104,15 @@
             [self.view bringSubviewToFront:schemeWeaponConfigViewController.view];
             break;
         case 3:
+            /*
             if (helpPage == nil) {
-                helpPage = [[HelpPageViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPhone" bundle:nil];
+                helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPhone" bundle:nil];
                 [self.view addSubview:helpPage.view];
             }
             // this message is compulsory otherwise the table won't be loaded at all
             [helpPage viewWillAppear:NO];
             [self.view bringSubviewToFront:helpPage.view];
+            */
             break;
         default:
             DLog(@"Nope");
@@ -161,7 +162,7 @@
     }
 
     // play if there aren't too many teams
-    if ([self.teamConfigViewController.listOfSelectedTeams count] > HW_getMaxNumberOfTeams()) {
+    if ((int)[self.teamConfigViewController.listOfSelectedTeams count] > HW_getMaxNumberOfTeams()) {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Too many teams",@"")
                                                         message:NSLocalizedString(@"You exceeded the maximum number of tems allowed in a game",@"")
                                                        delegate:nil
@@ -223,6 +224,7 @@
                                     script,@"mission_command",
                                     nil];
 
+    [GameInterfaceBridge registerCallingController:self];
     [GameInterfaceBridge startLocalGame:gameDictionary];
     [gameDictionary release];
 }
@@ -242,7 +244,9 @@
         [self.imgContainer removeFromSuperview];
 
     self.imgContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 40)];
-    for (int i = 0; i < 1 + random()%20; i++) {
+    NSInteger numberOfHogs = 1 + random() % 20;
+    DLog(@"Drawing %d nice hedgehogs", numberOfHogs);
+    for (int i = 0; i < numberOfHogs; i++) {
         NSString *hat = [hatArray objectAtIndex:random()%numberOfHats];
 
         NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat];
@@ -273,6 +277,11 @@
         [hog release];
     }
 
+    // don't place the nice hogs if there is no space for them
+    if ((self.interfaceOrientation == UIInterfaceOrientationPortrait ||
+         self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))
+        self.imgContainer.alpha = 0;
+
     [self.view addSubview:self.imgContainer];
     [hogSprite release];
     [pool drain];
@@ -281,16 +290,17 @@
 -(void) viewDidLoad {
     self.view.backgroundColor = [UIColor blackColor];
 
-    CGRect screen = [[UIScreen mainScreen] bounds];
-    self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
+    CGRect screenRect = [[UIScreen mainScreen] safeBounds];
+    self.view.frame = screenRect;
 
     if (IS_IPAD()) {
         // the label for the filter slider
-        UILabel *filterLabel = [[UILabel alloc] initWithFrame:CGRectMake(116, 714, 310, 40)
-                                                     andTitle:nil
-                                              withBorderWidth:2.0f];
-        [self.view insertSubview:filterLabel belowSubview:self.mapConfigViewController.slider];
-        [filterLabel release];
+        UILabel *backLabel = [[UILabel alloc] initWithFrame:CGRectMake(116, 714, 310, 40)
+                                                   andTitle:nil
+                                            withBorderWidth:2.0f];
+        self.sliderBackground = backLabel;
+        [backLabel release];
+        [self.view addSubview:self.sliderBackground];
 
         // the label for max hogs
         UILabel *maxLabel = [[UILabel alloc] initWithFrame:CGRectMake(598, 714, 310, 40)
@@ -302,17 +312,44 @@
         [self.view addSubview:maxLabel];
         self.mapConfigViewController.maxLabel = maxLabel;
         [maxLabel release];
-
-        // as this is loaded from a NIB we need to set its size and position
-        self.mapConfigViewController.view.frame = CGRectMake(704, 0, 320, 680);
     } else {
-        self.mapConfigViewController.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width-44);
+        self.mapConfigViewController.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height-44);
     }
     [self.view addSubview:self.mapConfigViewController.view];
+    [self.view bringSubviewToFront:self.mapConfigViewController.slider];
 
     [super viewDidLoad];
 }
 
+-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval) duration {
+    if (IS_IPAD() == NO)
+        return;
+
+    if ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
+         toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
+        self.imgContainer.alpha = 1;
+        self.titleImage.frame = CGRectMake(357, 17, 309, 165);
+        self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620);
+        self.mapConfigViewController.view.frame = CGRectMake(704, 0, 320, 680);
+        self.teamConfigViewController.view.frame = CGRectMake(337, 187, 350, 505);
+        self.mapConfigViewController.maxLabel.frame = CGRectMake(121, 714, 300, 40);
+        self.sliderBackground.frame = CGRectMake(603, 714, 300, 40);
+        self.mapConfigViewController.slider.frame = CGRectMake(653, 724, 200, 23);
+    } else {
+        self.imgContainer.alpha = 0;
+        self.titleImage.frame = CGRectMake(37, 28, 309, 165);
+        self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 214, 378, 366);
+        self.mapConfigViewController.view.frame = CGRectMake(390, 0, 378, 580);
+        self.teamConfigViewController.view.frame = CGRectMake(170, 590, 428, 366);
+        self.mapConfigViewController.maxLabel.frame = CGRectMake(104, 975, 200, 40);
+        self.sliderBackground.frame = CGRectMake(465, 975, 200, 40);
+        self.mapConfigViewController.slider.frame = CGRectMake(475, 983, 180, 23);
+    }
+
+    [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
+                                                                            duration:duration];
+}
+
 -(void) viewWillAppear:(BOOL)animated {
     if (IS_IPAD())
         [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
@@ -349,34 +386,43 @@
 -(void) didReceiveMemoryWarning {
     self.imgContainer = nil;
 
+    if (self.titleImage.superview == nil)
+        self.titleImage = nil;
+    if (self.sliderBackground.superview == nil)
+        self.sliderBackground = nil;
+
     if (self.mapConfigViewController.view.superview == nil)
         self.mapConfigViewController = nil;
     if (self.teamConfigViewController.view.superview == nil)
         self.teamConfigViewController = nil;
     if (self.schemeWeaponConfigViewController.view.superview == nil)
         self.schemeWeaponConfigViewController = nil;
-    if (self.helpPage.view.superview == nil)
-        self.helpPage = nil;
+    //if (self.helpPage.view.superview == nil)
+    //    self.helpPage = nil;
     MSG_MEMCLEAN();
     [super didReceiveMemoryWarning];
 }
 
 -(void) viewDidUnload {
     self.imgContainer = nil;
+    self.titleImage = nil;
+    self.sliderBackground = nil;
     self.schemeWeaponConfigViewController = nil;
     self.teamConfigViewController = nil;
     self.mapConfigViewController = nil;
-    self.helpPage = nil;
+    //self.helpPage = nil;
     MSG_DIDUNLOAD();
     [super viewDidUnload];
 }
 
 -(void) dealloc {
     releaseAndNil(imgContainer);
+    releaseAndNil(titleImage);
+    releaseAndNil(sliderBackground);
     releaseAndNil(schemeWeaponConfigViewController);
     releaseAndNil(teamConfigViewController);
     releaseAndNil(mapConfigViewController);
-    releaseAndNil(helpPage);
+    //releaseAndNil(helpPage);
     [super dealloc];
 }
 
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,22 +14,28 @@
  * 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 created on 18/04/2011.
  */
 
 
 #import <Foundation/Foundation.h>
+#import "EngineProtocolNetwork.h"
 
 
-@interface GameInterfaceBridge : NSObject {
+@interface GameInterfaceBridge : NSObject <EngineProtocolDelegate> {
     UIView *blackView;
+    NSString *savePath;
+    NSInteger port;
 }
 
 @property (nonatomic,retain) UIView *blackView;
+@property (nonatomic,retain) NSString *savePath;
+@property (assign) NSInteger port;
 
 +(void) startLocalGame:(NSDictionary *)withOptions;
 +(void) startSaveGame:(NSString *)atPath;
 +(void) startMissionGame:(NSString *)withScript;
++(void) startSimpleGame;
+
++(void) registerCallingController:(UIViewController *)controller;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,36 +14,39 @@
  * 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 created on 18/04/2011.
  */
 
 
 #import "GameInterfaceBridge.h"
 #import "EngineProtocolNetwork.h"
-#import "OverlayViewController.h"
 #import "StatsPageViewController.h"
-#import "AudioManagerController.h"
-#import "ObjcExports.h"
+
+
+static UIViewController *callingController;
 
 @implementation GameInterfaceBridge
-@synthesize blackView;
+@synthesize blackView, savePath, port;
 
 #pragma mark -
 #pragma mark Instance methods for engine interaction
 // prepares the controllers for hosting a game
--(void) earlyEngineLaunch:(NSString *)pathOrNil withOptions:(NSDictionary *)optionsOrNil {
+-(void) earlyEngineLaunch:(NSDictionary *)optionsOrNil {
     [self retain];
-    [AudioManagerController stopBackgroundMusic];
-    [EngineProtocolNetwork spawnThread:pathOrNil withOptions:optionsOrNil];
+    [[AudioManagerController mainManager] fadeOutBackgroundMusic];
+
+    EngineProtocolNetwork *engineProtocol = [[EngineProtocolNetwork alloc] init];
+    self.port = engineProtocol.enginePort;
+    engineProtocol.delegate = self;
+    [engineProtocol spawnThread:self.savePath withOptions:optionsOrNil];
+    [engineProtocol release];
 
     // add a black view hiding the background
-    CGRect theFrame = [[UIScreen mainScreen] bounds];
     UIWindow *thisWindow = [[HedgewarsAppDelegate sharedAppDelegate] uiwindow];
-    self.blackView = [[UIView alloc] initWithFrame:theFrame];
+    self.blackView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     self.blackView.opaque = YES;
     self.blackView.backgroundColor = [UIColor blackColor];
     self.blackView.alpha = 0;
+    self.blackView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [UIView beginAnimations:@"fade out" context:NULL];
     [UIView setAnimationDuration:1];
     self.blackView.alpha = 1;
@@ -51,17 +54,22 @@
     [thisWindow addSubview:self.blackView];
     [self.blackView release];
 
-    // keep track of uncompleted games
+    // keep the point of return for games that completed loading
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-    [userDefaults setObject:pathOrNil forKey:@"savedGamePath"];
+    [userDefaults setObject:self.savePath forKey:@"savedGamePath"];
+    [userDefaults setObject:[NSNumber numberWithBool:NO] forKey:@"saveIsValid"];
     [userDefaults synchronize];
 
     // let's launch the engine using this -perfomSelector so that the runloop can deal with queued messages first
-    [self performSelector:@selector(engineLaunch:) withObject:pathOrNil afterDelay:0.1f];
+    [self performSelector:@selector(engineLaunch) withObject:nil afterDelay:0.1f];
 }
 
 // cleans up everything
 -(void) lateEngineLaunch {
+    // notify views below that they are getting the spotlight again
+    [[[HedgewarsAppDelegate sharedAppDelegate] uiwindow] makeKeyAndVisible];
+    [callingController viewWillAppear:YES];
+
     // remove completed games notification
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
     [userDefaults setObject:@"" forKey:@"savedGamePath"];
@@ -75,33 +83,29 @@
     [UIView commitAnimations];
     [self.blackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
 
-    // the overlay is not needed any more and can be removed
-    [[OverlayViewController mainOverlay] removeOverlay];
+    // can remove the savefile if the replay has ended
+    if ([HWUtils gameType] == gtSave)
+        [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
 
     // restart music and we're done
-    [AudioManagerController playBackgroundMusic];
+    [[AudioManagerController mainManager] fadeInBackgroundMusic];
+    [HWUtils setGameStatus:gsNone];
+    [HWUtils setGameType:gtNone];
     [self release];
 }
 
 // main routine for calling the actual game engine
--(void) engineLaunch:(NSString *)pathOrNil {
+-(void) engineLaunch {
     const char *gameArgs[11];
     CGFloat width, height;
-    NSInteger enginePort = [EngineProtocolNetwork activeEnginePort];
     CGFloat screenScale = [[UIScreen mainScreen] safeScale];
-    NSString *ipcString = [[NSString alloc] initWithFormat:@"%d",enginePort];
-    NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt",[[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]];
+    NSString *ipcString = [[NSString alloc] initWithFormat:@"%d",self.port];
+    NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt",[[NSLocale preferredLanguages] objectAtIndex:0]];
     NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
 
-    if (IS_DUALHEAD()) {
-        CGRect screenBounds = [[[UIScreen screens] objectAtIndex:1] bounds];
-        width = screenBounds.size.width;
-        height = screenBounds.size.height;
-    } else {
-        CGRect screenBounds = [[UIScreen mainScreen] bounds];
-        width = screenBounds.size.height;
-        height = screenBounds.size.width;
-    }
+    CGRect screenBounds = [[UIScreen mainScreen] safeBounds];
+    width = screenBounds.size.width;
+    height = screenBounds.size.height;
 
     NSString *horizontalSize = [[NSString alloc] initWithFormat:@"%d", (int)(width * screenScale)];
     NSString *verticalSize = [[NSString alloc] initWithFormat:@"%d", (int)(height * screenScale)];
@@ -133,13 +137,13 @@
     gameArgs[ 1] = [horizontalSize UTF8String];                                                 //cScreenWidth
     gameArgs[ 2] = [verticalSize UTF8String];                                                   //cScreenHeight
     gameArgs[ 3] = [[NSString stringWithFormat:@"%d",tmpQuality] UTF8String];                   //quality
-    gameArgs[ 4] = "en.txt";//[localeString UTF8String];                                        //cLocaleFName
+    gameArgs[ 4] = [localeString UTF8String];                                                   //cLocaleFName
     gameArgs[ 5] = [username UTF8String];                                                       //UserNick
     gameArgs[ 6] = [[[settings objectForKey:@"sound"] stringValue] UTF8String];                 //isSoundEnabled
     gameArgs[ 7] = [[[settings objectForKey:@"music"] stringValue] UTF8String];                 //isMusicEnabled
     gameArgs[ 8] = [[[settings objectForKey:@"alternate"] stringValue] UTF8String];             //cAltDamage
     gameArgs[ 9] = [resourcePath UTF8String];                                                   //PathPrefix
-    gameArgs[10] = ([HWUtils gameType] == gtSave) ? [pathOrNil UTF8String] : NULL;              //recordFileName
+    gameArgs[10] = ([HWUtils gameType] == gtSave) ? [self.savePath UTF8String] : NULL;          //recordFileName
 
     [verticalSize release];
     [horizontalSize release];
@@ -154,12 +158,36 @@
     [self lateEngineLaunch];
 }
 
+-(void) dealloc {
+    releaseAndNil(blackView);
+    releaseAndNil(savePath);
+    [super dealloc];
+}
+
+#pragma mark -
+#pragma mark EngineProtocolDelegate methods
+-(void) gameEndedWithStatistics:(NSArray *)stats {
+    if (stats != nil) {
+        StatsPageViewController *statsPage = [[StatsPageViewController alloc] init];
+        statsPage.statsArray = stats;
+        statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
+
+        [callingController presentModalViewController:statsPage animated:YES];
+        [statsPage release];
+    }
+}
+
 #pragma mark -
 #pragma mark Class methods for setting up the engine from outsite
++(void) registerCallingController:(UIViewController *)controller {
+    callingController = controller;
+}
+
 +(void) startGame:(TGameType) type atPath:(NSString *)path withOptions:(NSDictionary *)config {
     [HWUtils setGameType:type];
-    GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] init];
-    [bridge earlyEngineLaunch:path withOptions:config];
+    id bridge = [[self alloc] init];
+    [bridge setSavePath:path];
+    [bridge earlyEngineLaunch:config];
     [bridge release];
 }
 
@@ -190,27 +218,67 @@
     [missionLine release];
 }
 
-/*
--(void) gameHasEndedWithStats:(NSArray *)stats {
-    // wrap this around a retain/realse to prevent being deallocated too soon
-    [self retain];
-    // display stats page if there is something to display
-    if (stats != nil) {
-        StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped];
-        statsPage.statsArray = stats;
-        statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
-        if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)])
-            statsPage.modalPresentationStyle = UIModalPresentationPageSheet;
++(void) startSimpleGame {
+    srand(time(0));
+
+    // generate a seed
+    CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
+    NSString *seed = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid);
+    CFRelease(uuid);
+    NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed];
+
+    // pick a random static map
+    NSArray *listOfMaps = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL];
+    NSString *mapName = [listOfMaps objectAtIndex:random()%[listOfMaps count]];
+    NSString *fileCfg = [[NSString alloc] initWithFormat:@"%@/%@/map.cfg",MAPS_DIRECTORY(),mapName];
+    NSString *contents = [[NSString alloc] initWithContentsOfFile:fileCfg encoding:NSUTF8StringEncoding error:NULL];
+    [fileCfg release];
+    NSArray *split = [contents componentsSeparatedByString:@"\n"];
+    [contents release];
+    NSString *themeCommand = [[NSString alloc] initWithFormat:@"etheme %@", [split objectAtIndex:0]];
+    NSString *staticMapCommand = [[NSString alloc] initWithFormat:@"emap %@", mapName];
+
+    // select teams with two different colors
+    NSArray *colorArray = [HWUtils teamColors];
+    NSInteger firstColorIndex, secondColorIndex;
+    do {
+        firstColorIndex = random()%[colorArray count];
+        secondColorIndex = random()%[colorArray count];
+    } while (firstColorIndex == secondColorIndex);
+    unsigned int firstColor = [[colorArray objectAtIndex:firstColorIndex] intValue];
+    unsigned int secondColor = [[colorArray objectAtIndex:secondColorIndex] intValue];
 
-        [self.parentController presentModalViewController:statsPage animated:YES];
-        [statsPage release];
-    }
+    NSDictionary *firstTeam = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:4],@"number",
+                                                                           [NSNumber numberWithUnsignedInt:firstColor],@"color",
+                                                                           @"Ninjas.plist",@"team",nil];
+    NSDictionary *secondTeam = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:4],@"number",
+                                                                            [NSNumber numberWithUnsignedInt:secondColor],@"color",
+                                                                            @"Robots.plist",@"team",nil];
+    NSArray *listOfTeams = [[NSArray alloc] initWithObjects:firstTeam,secondTeam,nil];
+    [firstTeam release];
+    [secondTeam release];
 
-    // can remove the savefile if the replay has ended
-    if ([HWUtils gameType] == gtSave)
-        [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
-    [self release];
+    // create the configuration
+    NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
+                                    seedCmd,@"seed_command",
+                                    @"e$template_filter 0",@"templatefilter_command",
+                                    @"e$mapgen 0",@"mapgen_command",
+                                    @"e$maze_size 0",@"mazesize_command",
+                                    themeCommand,@"theme_command",
+                                    staticMapCommand,@"staticmap_command",
+                                    listOfTeams,@"teams_list",
+                                    @"Default.plist",@"scheme",
+                                    @"Default.plist",@"weapon",
+                                    @"",@"mission_command",
+                                    nil];
+    [listOfTeams release];
+    [staticMapCommand release];
+    [themeCommand release];
+    [seedCmd release];
+
+    // launch game
+    [GameInterfaceBridge startLocalGame:gameDictionary];
+    [gameDictionary release];
 }
-*/
 
 @end
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,11 @@
  * 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 created on 08/01/2010.
  */
 
 
 #import <UIKit/UIKit.h>
-#import "EditableCellView.h"
+
 
 @interface GeneralSettingsViewController : UITableViewController <EditableCellViewDelegate> {
 
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/01/2010.
  */
 
 
@@ -45,7 +43,7 @@
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
     [userDefaults synchronize];
     if ([[userDefaults objectForKey:@"music"] boolValue] == NO)
-        [AudioManagerController stopBackgroundMusic];
+        [[AudioManagerController mainManager] stopBackgroundMusic];
 
     [super viewWillDisappear:animated];
 }
@@ -65,7 +63,7 @@
             [theOtherSwitch setOn:NO animated:YES];
 
             // since switching sound on won't turn music on anyways, we can always turn off music
-            [AudioManagerController pauseBackgroundMusic];
+            [[AudioManagerController mainManager]pauseBackgroundMusic];
             [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"];
             break;
         case 20:    //musicSwitch
@@ -78,9 +76,9 @@
                 [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"music"];
 
             if (theSwitch.on)
-                [AudioManagerController playBackgroundMusic];
+                [[AudioManagerController mainManager] playBackgroundMusic];
             else
-                [AudioManagerController pauseBackgroundMusic];
+                [[AudioManagerController mainManager] pauseBackgroundMusic];
             break;
         case 30:    //alternateSwitch
             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
@@ -88,9 +86,6 @@
         case 90:    //synched weapons/scheme
             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"sync_ws"];
             break;
-        case 60:    //classic menu
-            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"classic_menu"];
-            break;
         default:
             DLog(@"Wrong tag");
             break;
@@ -121,7 +116,7 @@
             return 2;
             break;
         case 2:     // other options
-            return 3;
+            return 2;
             break;
         default:
             DLog(@"Nope");
@@ -134,13 +129,13 @@
     NSString *sectionTitle = nil;
     switch (section) {
         case 0:
-            sectionTitle = NSLocalizedString(@"Main Configuration", @"");
+            sectionTitle = NSLocalizedString(@"Main Configuration", @"from the settings table");
             break;
         case 1:
-            sectionTitle = NSLocalizedString(@"Audio Preferences", @"");
+            sectionTitle = NSLocalizedString(@"Audio Preferences", @"from the settings table");
             break;
         case 2:
-            sectionTitle = NSLocalizedString(@"Other Settings", @"");
+            sectionTitle = NSLocalizedString(@"Other Settings", @"from the settings table");
             break;
         default:
             DLog(@"Nope");
@@ -173,13 +168,13 @@
             
             if (row == 0) {
                 editableCell.titleLabel.text = NSLocalizedString(@"Nickname","from the settings table");
-                editableCell.textField.placeholder = NSLocalizedString(@"Insert your username (if you have one)",@"");
+                editableCell.textField.placeholder = NSLocalizedString(@"Insert your username (if you have one)",@"from the settings table");
                 editableCell.textField.text = [settings objectForKey:@"username"];
                 editableCell.textField.secureTextEntry = NO;
                 editableCell.tag = 40;
             } else {
                 editableCell.titleLabel.text = NSLocalizedString(@"Password","from the settings table");
-                editableCell.textField.placeholder = NSLocalizedString(@"Insert your password",@"");
+                editableCell.textField.placeholder = NSLocalizedString(@"Insert your password",@"from the settings table");
                 editableCell.textField.text = [settings objectForKey:@"password"];
                 editableCell.textField.secureTextEntry = YES;
                 editableCell.tag = 50;
@@ -200,11 +195,11 @@
             
             switchContent = (UISwitch *)cell.accessoryView;
             if (row == 0) {
-                cell.textLabel.text = NSLocalizedString(@"Sound", @"");
+                cell.textLabel.text = NSLocalizedString(@"Sound", @"from the settings table");
                 switchContent.on = [[settings objectForKey:@"sound"] boolValue];
                 switchContent.tag = 10;
             } else {
-                cell.textLabel.text = NSLocalizedString(@"Music", @"");
+                cell.textLabel.text = NSLocalizedString(@"Music", @"from the settings table");
                 switchContent.on = [[settings objectForKey:@"music"] boolValue];
                 switchContent.tag = 20;
             }
@@ -223,23 +218,17 @@
             cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
             switch (row) {
                 case 0:
-                    cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"");
-                    cell.detailTextLabel.text = NSLocalizedString(@"Damage popups will notify you on every single hit", @"");
+                    cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"from the settings table");
+                    cell.detailTextLabel.text = NSLocalizedString(@"Damage popups will notify you on every single hit", @"from the settings table");
                     switchContent.on = [[settings objectForKey:@"alternate"] boolValue];
                     switchContent.tag = 30;
                     break;
                 case 1:
                     cell.textLabel.text = NSLocalizedString(@"Sync Schemes and Weapons", @"");
-                    cell.detailTextLabel.text = NSLocalizedString(@"Choosing a Scheme will select its associated Weapon", @"");
+                    cell.detailTextLabel.text = NSLocalizedString(@"Choosing a Scheme will select its associated Weapon", @"from the settings table");
                     switchContent.on = [[settings objectForKey:@"sync_ws"] boolValue];
                     switchContent.tag = 90;
                     break;
-                case 2:
-                    cell.textLabel.text = NSLocalizedString(@"Classic Ammo Menu", @"");
-                    cell.detailTextLabel.text = NSLocalizedString(@"Select which style of ammo menu you prefer",@"");
-                    switchContent.on = [[settings objectForKey:@"classic_menu"] boolValue];
-                    switchContent.tag = 60;
-                    break;
                 default:
                     DLog(@"Nope");
                     break;
--- a/project_files/HedgewarsMobile/Classes/GravesViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GravesViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/GravesViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GravesViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
@@ -25,12 +23,10 @@
 @implementation GravesViewController
 @synthesize teamDictionary, graveArray, lastIndexPath;
 
-
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
-
 #pragma mark -
 #pragma mark View lifecycle
 -(void) viewDidLoad {
--- a/project_files/HedgewarsMobile/Classes/HWUtils.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HWUtils.h	Sun Oct 28 13:28:23 2012 +0100
@@ -14,15 +14,14 @@
  * 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 created on 01/10/2011.
  */
 
 
 #import <Foundation/Foundation.h>
 
+
 typedef enum {gtNone, gtLocal, gtSave, gtMission, gtNet} TGameType;
-typedef enum {gsNone, gsLoading, gsInGame, gsEnded} TGameStatus;
+typedef enum {gsNone, gsLoading, gsInGame, gsInterrupted, gsEnded} TGameStatus;
 
 @interface HWUtils : NSObject {
 
@@ -37,9 +36,12 @@
 
 +(NSString *)modelType;
 +(NSArray *)teamColors;
++(void) releaseCache;
+
 +(NSInteger) randomPort;
++(void) freePort:(NSInteger) port;
 +(BOOL) isNetworkReachable;
-+(void) releaseCache;
+//+(UIView *)mainSDLViewInstance;
 
 @end
 
--- a/project_files/HedgewarsMobile/Classes/HWUtils.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HWUtils.m	Sun Oct 28 13:28:23 2012 +0100
@@ -14,8 +14,6 @@
  * 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 created on 01/10/2011.
  */
 
 
@@ -24,11 +22,11 @@
 #import <sys/sysctl.h>
 #import <netinet/in.h>
 #import <SystemConfiguration/SCNetworkReachability.h>
-#import "hwconsts.h"
-#import "EngineProtocolNetwork.h"
+
 
 static NSString *cachedModel = nil;
 static NSArray *cachedColors = nil;
+static NSMutableArray *activePorts = nil;
 
 static TGameType gameType = gtNone;
 static TGameStatus gameStatus = gsNone;
@@ -62,7 +60,7 @@
 }
 
 #pragma mark -
-#pragma mark Helper Functions
+#pragma mark Helper Functions with cache
 +(NSString *)modelType {
     if (cachedModel == nil) {
         size_t size;
@@ -94,14 +92,34 @@
     return cachedColors;
 }
 
++(void) releaseCache {
+    [cachedModel release], cachedModel = nil;
+    [cachedColors release], cachedColors = nil;
+    // don't release activePorts here
+}
+
+#pragma mark -
+#pragma mark Helper Functions without cache
 +(NSInteger) randomPort {
-    srandom(time(NULL));
-    NSInteger res = (random() % 64511) + 1024;
-    // recall self until you get a free port
-    if (res == NETGAME_DEFAULT_PORT || res == [EngineProtocolNetwork activeEnginePort])
-        return [self randomPort];
-    else
-        return res;
+    // set a new feed only at initialization time and forbid connecting to the server port
+    if (activePorts == nil) {
+        srandom(time(NULL));
+        activePorts = [[NSMutableArray arrayWithObject:[NSNumber numberWithInt:NETGAME_DEFAULT_PORT]] retain];
+    }
+
+    // pick a random number from the free ports list
+    NSInteger res = 0;
+    do {
+        res = (random() % 64511) + 1024;
+    } while ([activePorts containsObject:[NSNumber numberWithInt:res]]);
+
+    // add this number to the forbdding list
+    [activePorts addObject:[NSNumber numberWithInt:res]];
+    return res;
+}
+
++(void) freePort:(NSInteger) port {
+    [activePorts removeObject:[NSNumber numberWithInt:port]];
 }
 
 +(BOOL) isNetworkReachable {
@@ -138,9 +156,17 @@
     return ((isReachable && !needsConnection) || nonWiFi) ? testResult : NO;
 }
 
-+(void) releaseCache {
-    [cachedModel release], cachedModel = nil;
-    [cachedColors release], cachedColors = nil;
+/*
++(UIView *)mainSDLViewInstance {
+    SDL_Window *window = HW_getSDLWindow();
+    if (window == NULL) {
+        SDL_SetError("Window does not exist");
+        return nil;
+    }
+    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
+    SDL_uikitview *view = data != NULL ? data->view : nil;
+    return view;
 }
+*/
 
 @end
--- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,27 +14,22 @@
  * 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 created on 13/03/2011.
  */
 
 
 #import <UIKit/UIKit.h>
-#import "SDL_uikitappdelegate.h"
+#import "../src/video/uikit/SDL_uikitappdelegate.h"
+
 
 @class MainMenuViewController;
 
 @interface HedgewarsAppDelegate : SDLUIKitDelegate {
-    MainMenuViewController *mainViewController;
+    MainMenuViewController *mainViewController;     // required to dismiss the SettingsBaseViewController
     UIWindow *uiwindow;
-    UIWindow *secondWindow;
 }
 
 @property (nonatomic,retain) MainMenuViewController *mainViewController;
 @property (nonatomic,retain) UIWindow *uiwindow;
-@property (nonatomic,retain) UIWindow *secondWindow;
-
-+(HedgewarsAppDelegate *)sharedAppDelegate;
 
 @end
 
--- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,19 +14,16 @@
  * 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 created on 13/03/2011.
  */
 
 
 #import "HedgewarsAppDelegate.h"
 #import "MainMenuViewController.h"
-#import "ObjcExports.h"
-#include <unistd.h>
 
 
 @implementation SDLUIKitDelegate (customDelegate)
 
+// hijack the the SDL_UIKitAppDelegate to use the UIApplicationDelegate we implement here
 +(NSString *)getAppDelegateClassName {
     return @"HedgewarsAppDelegate";
 }
@@ -34,20 +31,14 @@
 @end
 
 @implementation HedgewarsAppDelegate
-@synthesize mainViewController, uiwindow, secondWindow;
-
-// convenience method
-+(HedgewarsAppDelegate *)sharedAppDelegate {
-    return (HedgewarsAppDelegate *)[[UIApplication sharedApplication] delegate];
-}
+@synthesize mainViewController, uiwindow;
 
 #pragma mark -
 #pragma mark AppDelegate methods
 -(id) init {
-    if (self = [super init]){
+    if ((self = [super init])) {
         mainViewController = nil;
         uiwindow = nil;
-        secondWindow = nil;
     }
     return self;
 }
@@ -55,7 +46,6 @@
 -(void) dealloc {
     [mainViewController release];
     [uiwindow release];
-    [secondWindow release];
     [super dealloc];
 }
 
@@ -64,44 +54,31 @@
     [[UIApplication sharedApplication] setStatusBarHidden:YES];
 
     self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    self.uiwindow.backgroundColor = [UIColor blackColor];
 
     NSString *controllerName = (IS_IPAD() ? @"MainMenuViewController-iPad" : @"MainMenuViewController-iPhone");
     self.mainViewController = [[MainMenuViewController alloc] initWithNibName:controllerName bundle:nil];
-
     [self.uiwindow addSubview:self.mainViewController.view];
     [self.mainViewController release];
-    self.uiwindow.backgroundColor = [UIColor blackColor];
+
     [self.uiwindow makeKeyAndVisible];
-
-    // check for dual monitor support
-    if (IS_DUALHEAD()) {
-        DLog(@"Dualhead mode");
-        self.secondWindow = [[UIWindow alloc] initWithFrame:[[[UIScreen screens] objectAtIndex:1] bounds]];
-        self.secondWindow.backgroundColor = [UIColor blackColor];
-        self.secondWindow.screen = [[UIScreen screens] objectAtIndex:1];
-        UIImage *titleImage = [UIImage imageWithContentsOfFile:@"title.png"];
-        UIImageView *titleView = [[UIImageView alloc] initWithImage:titleImage];
-        titleView.center = self.secondWindow.center;
-        [self.secondWindow addSubview:titleView];
-        [titleView release];
-        [self.secondWindow makeKeyAndVisible];
-    }
 }
 
 -(void) applicationDidReceiveMemoryWarning:(UIApplication *)application {
     [HWUtils releaseCache];
     // don't stop music if it is playing
     if ([HWUtils isGameLaunched]) {
-        [AudioManagerController releaseCache];
+        [[AudioManagerController mainManager] didReceiveMemoryWarning];
+        HW_memoryWarningCallback();
     }
     MSG_MEMCLEAN();
     // don't clean mainMenuViewController here!!!
 }
 
-// true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return
+// true multitasking with SDL works only on 4.2 and above; we close the game to avoid a black screen at return
 -(void) applicationWillResignActive:(UIApplication *)application {
     if ([HWUtils isGameLaunched] && [[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f)
-         HW_terminate(NO);
+        HW_terminate(NO);
 
     [super applicationWillResignActive:application];
 }
--- a/project_files/HedgewarsMobile/Classes/HelpPageInGameViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,889 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
-	<data>
-		<int key="IBDocument.SystemTarget">1024</int>
-		<string key="IBDocument.SystemVersion">10F569</string>
-		<string key="IBDocument.InterfaceBuilderVersion">788</string>
-		<string key="IBDocument.AppKitVersion">1038.29</string>
-		<string key="IBDocument.HIToolboxVersion">461.00</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-			<string key="NS.object.0">117</string>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="2"/>
-		</object>
-		<object class="NSArray" key="IBDocument.PluginDependencies">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.Metadata">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys" id="0">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="IBProxyObject" id="841351856">
-				<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
-				<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-			</object>
-			<object class="IBProxyObject" id="606714003">
-				<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
-				<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-			</object>
-			<object class="IBUIView" id="766721923">
-				<reference key="NSNextResponder"/>
-				<int key="NSvFlags">292</int>
-				<object class="NSMutableArray" key="NSSubviews">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBUIImageView" id="625666841">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{0, -1}, {1024, 768}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpingame.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="271354909">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{79, 473}, {150, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Direction buttons</string>
-						<object class="NSFont" key="IBUIFont" id="583365693">
-							<string key="NSName">Helvetica-Bold</string>
-							<double key="NSSize">18</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<object class="NSColor" key="IBUITextColor" id="283637272">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MCAwIDAAA</bytes>
-						</object>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="1061067446">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{79, 491}, {203, 85}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">With these buttons you can move your hog, aim and control certain weapons.</string>
-						<object class="NSFont" key="IBUIFont" id="818038162">
-							<string key="NSName">Helvetica</string>
-							<double key="NSSize">16</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUILabel" id="435000744">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{53, 97}, {186, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Timer</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="580244456">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{53, 118}, {187, 43}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Don't let your turn time run out!</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="162303877">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{780, 248}, {240, 128}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpright.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="323588470">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{790, 256}, {109, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Ammo Menu</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="687330896">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{790, 282}, {214, 84}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">This menu contains all the weapons you can use. Drag your finger on a weapon for more details on what it does!</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUILabel" id="697316303">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{780, 97}, {186, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Pause / Open ammos</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="859729380">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{782, 118}, {187, 43}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Tap to pause or open the ammo menu.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUILabel" id="1045445495">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{418, 73}, {186, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Wind bar</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="635730473">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{418, 89}, {191, 63}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Some weapons are affected by the wind and their direction may shift.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUILabel" id="701155026">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{447, 573}, {203, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Teams flags and health</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="929603608">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{447, 592}, {203, 85}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">These bars report the team name, the team flags and the global health status of every hog.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">4</int>
-					</object>
-					<object class="IBUILabel" id="157896337">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{741, 501}, {135, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Joypad buttons</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="213370333">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{741, 520}, {211, 85}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Press X to jump forward, Y to jump backwards (double tap to jump twice) and Missile to attack or use items.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="533288614">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{67, 238}, {240, 128}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpplain.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="203633929">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{72, 246}, {229, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Tap to return to game</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUITextAlignment">1</int>
-					</object>
-					<object class="IBUILabel" id="345016434">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{72, 268}, {229, 87}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Pan to move camera, pinch to zoom, double tap to center hog, and a single touch to interact with weapons and much more!</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-				</object>
-				<string key="NSFrameSize">{1024, 768}</string>
-				<reference key="NSSuperview"/>
-				<object class="NSColor" key="IBUIBackgroundColor">
-					<int key="NSColorSpace">3</int>
-					<bytes key="NSWhite">MCAwLjQAA</bytes>
-				</object>
-				<bool key="IBUIOpaque">NO</bool>
-				<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-				<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
-					<int key="interfaceOrientation">3</int>
-				</object>
-				<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-			</object>
-		</object>
-		<object class="IBObjectContainer" key="IBDocument.Objects">
-			<object class="NSMutableArray" key="connectionRecords">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">view</string>
-						<reference key="source" ref="841351856"/>
-						<reference key="destination" ref="766721923"/>
-					</object>
-					<int key="connectionID">3</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">dismiss</string>
-						<reference key="source" ref="766721923"/>
-						<reference key="destination" ref="841351856"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">16</int>
-				</object>
-			</object>
-			<object class="IBMutableOrderedSet" key="objectRecords">
-				<object class="NSArray" key="orderedObjects">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBObjectRecord">
-						<int key="objectID">0</int>
-						<reference key="object" ref="0"/>
-						<reference key="children" ref="1000"/>
-						<nil key="parent"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-1</int>
-						<reference key="object" ref="841351856"/>
-						<reference key="parent" ref="0"/>
-						<string key="objectName">File's Owner</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-2</int>
-						<reference key="object" ref="606714003"/>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">2</int>
-						<reference key="object" ref="766721923"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="625666841"/>
-							<reference ref="162303877"/>
-							<reference ref="323588470"/>
-							<reference ref="697316303"/>
-							<reference ref="859729380"/>
-							<reference ref="1045445495"/>
-							<reference ref="635730473"/>
-							<reference ref="435000744"/>
-							<reference ref="580244456"/>
-							<reference ref="271354909"/>
-							<reference ref="1061067446"/>
-							<reference ref="701155026"/>
-							<reference ref="157896337"/>
-							<reference ref="533288614"/>
-							<reference ref="203633929"/>
-							<reference ref="345016434"/>
-							<reference ref="213370333"/>
-							<reference ref="929603608"/>
-							<reference ref="687330896"/>
-						</object>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">5</int>
-						<reference key="object" ref="625666841"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">6</int>
-						<reference key="object" ref="162303877"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">7</int>
-						<reference key="object" ref="323588470"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">8</int>
-						<reference key="object" ref="687330896"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">9</int>
-						<reference key="object" ref="697316303"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">10</int>
-						<reference key="object" ref="859729380"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">11</int>
-						<reference key="object" ref="1045445495"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">12</int>
-						<reference key="object" ref="635730473"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">13</int>
-						<reference key="object" ref="435000744"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">14</int>
-						<reference key="object" ref="580244456"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">17</int>
-						<reference key="object" ref="271354909"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">18</int>
-						<reference key="object" ref="1061067446"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">21</int>
-						<reference key="object" ref="701155026"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">22</int>
-						<reference key="object" ref="929603608"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">23</int>
-						<reference key="object" ref="157896337"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">24</int>
-						<reference key="object" ref="213370333"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">25</int>
-						<reference key="object" ref="533288614"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">26</int>
-						<reference key="object" ref="203633929"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">27</int>
-						<reference key="object" ref="345016434"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="flattenedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="NSArray" key="dict.sortedKeys">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>-1.CustomClassName</string>
-					<string>-2.CustomClassName</string>
-					<string>10.IBPluginDependency</string>
-					<string>11.IBPluginDependency</string>
-					<string>12.IBPluginDependency</string>
-					<string>13.IBPluginDependency</string>
-					<string>14.IBPluginDependency</string>
-					<string>17.IBPluginDependency</string>
-					<string>18.IBPluginDependency</string>
-					<string>2.CustomClassName</string>
-					<string>2.IBEditorWindowLastContentRect</string>
-					<string>2.IBPluginDependency</string>
-					<string>21.IBPluginDependency</string>
-					<string>22.IBPluginDependency</string>
-					<string>23.IBPluginDependency</string>
-					<string>24.IBPluginDependency</string>
-					<string>25.IBPluginDependency</string>
-					<string>26.IBPluginDependency</string>
-					<string>27.IBPluginDependency</string>
-					<string>5.IBPluginDependency</string>
-					<string>6.IBPluginDependency</string>
-					<string>7.IBPluginDependency</string>
-					<string>8.IBPluginDependency</string>
-					<string>9.IBPluginDependency</string>
-				</object>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>HelpPageViewController</string>
-					<string>UIResponder</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>UIControl</string>
-					<string>{{288, 355}, {1024, 768}}</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="unlocalizedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="activeLocalization"/>
-			<object class="NSMutableDictionary" key="localizations">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="sourceID"/>
-			<int key="maxID">27</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">HelpPageViewController</string>
-					<string key="superclassName">UIViewController</string>
-					<object class="NSMutableDictionary" key="actions">
-						<string key="NS.key.0">dismiss</string>
-						<string key="NS.object.0">id</string>
-					</object>
-					<object class="NSMutableDictionary" key="actionInfosByName">
-						<string key="NS.key.0">dismiss</string>
-						<object class="IBActionInfo" key="NS.object.0">
-							<string key="name">dismiss</string>
-							<string key="candidateClassName">id</string>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HelpPageViewController.h</string>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="786211723">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIControl</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIImageView</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIImageView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIResponder</string>
-					<string key="superclassName">NSObject</string>
-					<reference key="sourceIdentifier" ref="786211723"/>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchBar</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchDisplayController</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
-					</object>
-				</object>
-			</object>
-		</object>
-		<int key="IBDocument.localizationMode">0</int>
-		<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
-			<integer value="1024" key="NS.object.0"/>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
-			<integer value="3100" key="NS.object.0"/>
-		</object>
-		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
-		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
-		<int key="IBDocument.defaultPropertyAccessControl">3</int>
-		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>helpingame.png</string>
-				<string>helpplain.png</string>
-				<string>helpright.png</string>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>{1024, 768}</string>
-				<string>{296, 138}</string>
-				<string>{308, 144}</string>
-			</object>
-		</object>
-		<string key="IBCocoaTouchPluginVersion">117</string>
-	</data>
-</archive>
--- a/project_files/HedgewarsMobile/Classes/HelpPageInGameViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1014 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
-	<data>
-		<int key="IBDocument.SystemTarget">1056</int>
-		<string key="IBDocument.SystemVersion">10H574</string>
-		<string key="IBDocument.InterfaceBuilderVersion">823</string>
-		<string key="IBDocument.AppKitVersion">1038.35</string>
-		<string key="IBDocument.HIToolboxVersion">461.00</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-			<string key="NS.object.0">132</string>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="2"/>
-		</object>
-		<object class="NSArray" key="IBDocument.PluginDependencies">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.Metadata">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys" id="0">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="IBProxyObject" id="841351856">
-				<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-			<object class="IBProxyObject" id="606714003">
-				<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-			<object class="IBUIView" id="766721923">
-				<reference key="NSNextResponder"/>
-				<int key="NSvFlags">292</int>
-				<object class="NSMutableArray" key="NSSubviews">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBUIScrollView" id="480371523">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">274</int>
-						<object class="NSMutableArray" key="NSSubviews">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBUILabel" id="806535969">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 283}, {150, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Direction buttons</string>
-								<object class="NSFont" key="IBUIFont" id="583365693">
-									<string key="NSName">Helvetica-Bold</string>
-									<double key="NSSize">18</double>
-									<int key="NSfFlags">16</int>
-								</object>
-								<object class="NSColor" key="IBUITextColor" id="283637272">
-									<int key="NSColorSpace">1</int>
-									<bytes key="NSRGB">MCAwIDAAA</bytes>
-								</object>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="837055082">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 292}, {203, 85}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">With these buttons you can move your hog, aim and control certain weapons.</string>
-								<object class="NSFont" key="IBUIFont" id="818038162">
-									<string key="NSName">Helvetica</string>
-									<double key="NSSize">16</double>
-									<int key="NSfFlags">16</int>
-								</object>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="669645325">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 13}, {186, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Timer</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="392421036">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 34}, {187, 43}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Don't let your turn time run out!</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="709427542">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{217, 308}, {243, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Touch interface</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="748437184">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{231, 328}, {229, 87}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Pan to move camera, pinch to zoom, double tap to center hog, and a single touch to interact with weapons and much more!</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="941791832">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 85}, {186, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Wind bar</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="26100154">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 101}, {191, 63}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Some weapons are affected by the wind and their direction may shift.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="413836006">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 172}, {203, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Teams flags and health</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="579557686">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 191}, {203, 85}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">These bars report the team name, the team flags and the global health status of every hog.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">4</int>
-							</object>
-							<object class="IBUILabel" id="740577465">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{274, 13}, {186, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Pause / Open ammos</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="347724774">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{273, 35}, {187, 43}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Tap to pause or open the ammo menu.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="318624215">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{351, 82}, {109, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Ammo Menu</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="145842014">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{246, 105}, {214, 84}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">This menu contains all the weapons you can use. Drag your finger on a weapon for more details on what it does!</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="415037922">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{325, 197}, {135, 22}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Joypad buttons</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-							<object class="IBUILabel" id="499026341">
-								<reference key="NSNextResponder" ref="480371523"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{249, 217}, {211, 85}}</string>
-								<reference key="NSSuperview" ref="480371523"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Press X to jump forward, Y to jump backwards (double tap to jump twice) and Missile to attack or use items.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-								<int key="IBUITextAlignment">2</int>
-							</object>
-						</object>
-						<string key="NSFrame">{{-5, 44}, {489, 332}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">1</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-					</object>
-					<object class="IBUINavigationBar" id="126317414">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">290</int>
-						<string key="NSFrame">{{-1, 0}, {481, 44}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<object class="NSArray" key="IBUIItems">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBUINavigationItem" id="477618874">
-								<reference key="IBUINavigationBar" ref="126317414"/>
-								<string key="IBUITitle">Help page</string>
-								<object class="IBUIBarButtonItem" key="IBUILeftBarButtonItem" id="843591489">
-									<string key="IBUITitle">Back</string>
-									<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-									<int key="IBUIStyle">1</int>
-									<reference key="IBUINavigationItem" ref="477618874"/>
-								</object>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-							</object>
-						</object>
-					</object>
-				</object>
-				<string key="NSFrameSize">{480, 320}</string>
-				<reference key="NSSuperview"/>
-				<object class="NSColor" key="IBUIBackgroundColor">
-					<int key="NSColorSpace">2</int>
-					<bytes key="NSRGB">MC45OTYwNzg0OTEyIDAuOTg4MjM1MzU0NCAxAA</bytes>
-				</object>
-				<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-				<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
-					<int key="interfaceOrientation">3</int>
-				</object>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-		</object>
-		<object class="IBObjectContainer" key="IBDocument.Objects">
-			<object class="NSMutableArray" key="connectionRecords">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">view</string>
-						<reference key="source" ref="841351856"/>
-						<reference key="destination" ref="766721923"/>
-					</object>
-					<int key="connectionID">3</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">dismiss</string>
-						<reference key="source" ref="843591489"/>
-						<reference key="destination" ref="841351856"/>
-					</object>
-					<int key="connectionID">141</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">scrollView</string>
-						<reference key="source" ref="841351856"/>
-						<reference key="destination" ref="480371523"/>
-					</object>
-					<int key="connectionID">142</int>
-				</object>
-			</object>
-			<object class="IBMutableOrderedSet" key="objectRecords">
-				<object class="NSArray" key="orderedObjects">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBObjectRecord">
-						<int key="objectID">0</int>
-						<reference key="object" ref="0"/>
-						<reference key="children" ref="1000"/>
-						<nil key="parent"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-1</int>
-						<reference key="object" ref="841351856"/>
-						<reference key="parent" ref="0"/>
-						<string key="objectName">File's Owner</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-2</int>
-						<reference key="object" ref="606714003"/>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">2</int>
-						<reference key="object" ref="766721923"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="126317414"/>
-							<reference ref="480371523"/>
-						</object>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">118</int>
-						<reference key="object" ref="126317414"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="477618874"/>
-						</object>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">121</int>
-						<reference key="object" ref="480371523"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="709427542"/>
-							<reference ref="392421036"/>
-							<reference ref="669645325"/>
-							<reference ref="941791832"/>
-							<reference ref="26100154"/>
-							<reference ref="806535969"/>
-							<reference ref="837055082"/>
-							<reference ref="413836006"/>
-							<reference ref="579557686"/>
-							<reference ref="748437184"/>
-							<reference ref="740577465"/>
-							<reference ref="347724774"/>
-							<reference ref="318624215"/>
-							<reference ref="145842014"/>
-							<reference ref="415037922"/>
-							<reference ref="499026341"/>
-						</object>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">122</int>
-						<reference key="object" ref="709427542"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">124</int>
-						<reference key="object" ref="392421036"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">125</int>
-						<reference key="object" ref="669645325"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">126</int>
-						<reference key="object" ref="941791832"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">127</int>
-						<reference key="object" ref="26100154"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">128</int>
-						<reference key="object" ref="806535969"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">129</int>
-						<reference key="object" ref="837055082"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">130</int>
-						<reference key="object" ref="413836006"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">131</int>
-						<reference key="object" ref="579557686"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">132</int>
-						<reference key="object" ref="748437184"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">133</int>
-						<reference key="object" ref="740577465"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">134</int>
-						<reference key="object" ref="347724774"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">135</int>
-						<reference key="object" ref="318624215"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">136</int>
-						<reference key="object" ref="145842014"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">137</int>
-						<reference key="object" ref="415037922"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">138</int>
-						<reference key="object" ref="499026341"/>
-						<reference key="parent" ref="480371523"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">119</int>
-						<reference key="object" ref="477618874"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="843591489"/>
-						</object>
-						<reference key="parent" ref="126317414"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">140</int>
-						<reference key="object" ref="843591489"/>
-						<reference key="parent" ref="477618874"/>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="flattenedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="NSArray" key="dict.sortedKeys">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>-1.CustomClassName</string>
-					<string>-2.CustomClassName</string>
-					<string>118.IBPluginDependency</string>
-					<string>118.IBViewBoundsToFrameTransform</string>
-					<string>119.IBPluginDependency</string>
-					<string>121.IBEditorWindowLastContentRect</string>
-					<string>121.IBPluginDependency</string>
-					<string>121.IBViewBoundsToFrameTransform</string>
-					<string>122.IBPluginDependency</string>
-					<string>122.IBViewBoundsToFrameTransform</string>
-					<string>124.IBPluginDependency</string>
-					<string>124.IBViewBoundsToFrameTransform</string>
-					<string>125.IBPluginDependency</string>
-					<string>125.IBViewBoundsToFrameTransform</string>
-					<string>126.IBPluginDependency</string>
-					<string>126.IBViewBoundsToFrameTransform</string>
-					<string>127.IBPluginDependency</string>
-					<string>127.IBViewBoundsToFrameTransform</string>
-					<string>128.IBPluginDependency</string>
-					<string>128.IBViewBoundsToFrameTransform</string>
-					<string>129.IBPluginDependency</string>
-					<string>129.IBViewBoundsToFrameTransform</string>
-					<string>130.IBPluginDependency</string>
-					<string>130.IBViewBoundsToFrameTransform</string>
-					<string>131.IBPluginDependency</string>
-					<string>131.IBViewBoundsToFrameTransform</string>
-					<string>132.IBPluginDependency</string>
-					<string>132.IBViewBoundsToFrameTransform</string>
-					<string>133.IBPluginDependency</string>
-					<string>133.IBViewBoundsToFrameTransform</string>
-					<string>134.IBPluginDependency</string>
-					<string>134.IBViewBoundsToFrameTransform</string>
-					<string>135.IBPluginDependency</string>
-					<string>135.IBViewBoundsToFrameTransform</string>
-					<string>136.IBPluginDependency</string>
-					<string>136.IBViewBoundsToFrameTransform</string>
-					<string>137.IBPluginDependency</string>
-					<string>137.IBViewBoundsToFrameTransform</string>
-					<string>138.IBPluginDependency</string>
-					<string>138.IBViewBoundsToFrameTransform</string>
-					<string>140.IBPluginDependency</string>
-					<string>2.IBEditorWindowLastContentRect</string>
-					<string>2.IBPluginDependency</string>
-					<string>2.IBViewBoundsToFrameTransform</string>
-				</object>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>HelpPageViewController</string>
-					<string>UIResponder</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">AQAAAADAQAAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>{{589, 578}, {480, 320}}</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">AcCgAABCMAAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDZwAAw7aAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABCVAAAwx8AAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwnQAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABCxgAAwtYAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABCxgAAwyQAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw+SAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAxARAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw6aAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw8+AAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDZwAAw+EAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDiQAAwmwAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDiIAAwswAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDr4AAwwUAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDdgAAw1oAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDooAAw3gAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDeQAAw6aAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>{{165, 514}, {480, 320}}</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw4kAAA</bytes>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="unlocalizedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="activeLocalization"/>
-			<object class="NSMutableDictionary" key="localizations">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="sourceID"/>
-			<int key="maxID">142</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">HelpPageViewController</string>
-					<string key="superclassName">UIViewController</string>
-					<object class="NSMutableDictionary" key="actions">
-						<string key="NS.key.0">dismiss</string>
-						<string key="NS.object.0">id</string>
-					</object>
-					<object class="NSMutableDictionary" key="actionInfosByName">
-						<string key="NS.key.0">dismiss</string>
-						<object class="IBActionInfo" key="NS.object.0">
-							<string key="name">dismiss</string>
-							<string key="candidateClassName">id</string>
-						</object>
-					</object>
-					<object class="NSMutableDictionary" key="outlets">
-						<string key="NS.key.0">scrollView</string>
-						<string key="NS.object.0">UIScrollView</string>
-					</object>
-					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<string key="NS.key.0">scrollView</string>
-						<object class="IBToOneOutletInfo" key="NS.object.0">
-							<string key="name">scrollView</string>
-							<string key="candidateClassName">UIScrollView</string>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HelpPageViewController.h</string>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="786211723">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIBarButtonItem</string>
-					<string key="superclassName">UIBarItem</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIBarItem</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UINavigationBar</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="847596400">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINavigationBar.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UINavigationItem</string>
-					<string key="superclassName">NSObject</string>
-					<reference key="sourceIdentifier" ref="847596400"/>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIResponder</string>
-					<string key="superclassName">NSObject</string>
-					<reference key="sourceIdentifier" ref="786211723"/>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIScrollView</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchBar</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchDisplayController</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
-					</object>
-				</object>
-			</object>
-		</object>
-		<int key="IBDocument.localizationMode">0</int>
-		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
-			<integer value="1056" key="NS.object.0"/>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
-			<integer value="3100" key="NS.object.0"/>
-		</object>
-		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
-		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
-		<int key="IBDocument.defaultPropertyAccessControl">3</int>
-		<string key="IBCocoaTouchPluginVersion">132</string>
-	</data>
-</archive>
--- a/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
-	<data>
-		<int key="IBDocument.SystemTarget">1024</int>
-		<string key="IBDocument.SystemVersion">10F569</string>
-		<string key="IBDocument.InterfaceBuilderVersion">804</string>
-		<string key="IBDocument.AppKitVersion">1038.29</string>
-		<string key="IBDocument.HIToolboxVersion">461.00</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-			<string key="NS.object.0">123</string>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-		</object>
-		<object class="NSArray" key="IBDocument.PluginDependencies">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.Metadata">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys" id="0">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="IBProxyObject" id="841351856">
-				<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
-				<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-			</object>
-			<object class="IBProxyObject" id="606714003">
-				<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
-				<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-			</object>
-			<object class="IBUIView" id="766721923">
-				<reference key="NSNextResponder"/>
-				<int key="NSvFlags">292</int>
-				<object class="NSMutableArray" key="NSSubviews">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBUIImageView" id="1011244481">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{742, 389}, {240, 102}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage" id="468391955">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpabove.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="636170775">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{753, 408}, {109, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Map theme</string>
-						<object class="NSFont" key="IBUIFont" id="583365693">
-							<string key="NSName">Helvetica-Bold</string>
-							<double key="NSSize">18</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<object class="NSColor" key="IBUITextColor" id="283637272">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MCAwIDAAA</bytes>
-						</object>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="552788325">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{753, 425}, {218, 66}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Here you can choose how your map will appear in game.</string>
-						<object class="NSFont" key="IBUIFont" id="818038162">
-							<string key="NSName">Helvetica</string>
-							<double key="NSSize">16</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="379980516">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{653, 202}, {240, 146}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<reference key="IBUIImage" ref="468391955"/>
-					</object>
-					<object class="IBUILabel" id="901581152">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{664, 223}, {109, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Map type</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="595424508">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{664, 244}, {218, 99}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Choose between a static map or a randomly generated one (might require more time). In a mission you need to perfom some action to win.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="162303877">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{494, 20}, {240, 101}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpright.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="323588470">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{502, 25}, {109, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Map preview</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="687330896">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{502, 46}, {218, 65}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">This is a small preview of your next map. Tap to select / generate a new map.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="713859408">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{391, 389}, {242, 171}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<reference key="IBUIImage" ref="468391955"/>
-					</object>
-					<object class="IBUILabel" id="896727228">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{401, 413}, {109, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Teams</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="704238452">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{400, 434}, {232, 120}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Select which teams are playing! Add hogs by tapping on them and set their color to figure friend and foe teams out. AI teams will appear with a small robot badge next their name.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="993770514">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{142, 125}, {240, 104}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage" id="63133621">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpleft.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="488737408">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{162, 133}, {204, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Schemes and Weapons</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="463058693">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{162, 152}, {210, 71}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Here you can choose which rules and which weapon set will be applied in game.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="845663511">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{155, 8}, {278, 50}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<reference key="IBUIImage" ref="63133621"/>
-					</object>
-					<object class="IBUILabel" id="823916653">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{177, 6}, {248, 54}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Did you know you can customize almost everything in the settings page?</string>
-						<object class="NSFont" key="IBUIFont">
-							<string key="NSName">Helvetica-Oblique</string>
-							<double key="NSSize">14</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="678356402">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{686, 583}, {240, 117}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage" id="835742298">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpbottom.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="1068254353">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{697, 592}, {138, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Max hedgehogs</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="1023832701">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{697, 609}, {218, 73}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">This number is the maximum size for all the hogs playing (in every team).</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="261734864">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{20, 587}, {240, 109}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<reference key="IBUIImage" ref="835742298"/>
-					</object>
-					<object class="IBUILabel" id="578857422">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{30, 592}, {138, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Size slider</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="972150858">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{30, 608}, {218, 73}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">For Random and Maze maps you can decide to generate only maps of a certain size.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="533288614">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{45, 318}, {240, 128}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<object class="NSCustomResource" key="IBUIImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">helpplain.png</string>
-						</object>
-					</object>
-					<object class="IBUILabel" id="203633929">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{50, 326}, {229, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Tap anywhere to dismiss</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUITextAlignment">1</int>
-					</object>
-					<object class="IBUILabel" id="345016434">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{52, 348}, {224, 87}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Still confused? Don't worry, it's really simple! Try a couple of games and everything will become clear to you.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-					<object class="IBUIImageView" id="109182727">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{344, 635}, {240, 61}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<reference key="IBUIImage" ref="835742298"/>
-					</object>
-					<object class="IBUILabel" id="815146899">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{353, 637}, {138, 22}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Start button</string>
-						<reference key="IBUIFont" ref="583365693"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-					</object>
-					<object class="IBUILabel" id="379008984">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{354, 650}, {218, 46}}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<reference key="NSWindow"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">This button starts the game.</string>
-						<reference key="IBUIFont" ref="818038162"/>
-						<reference key="IBUITextColor" ref="283637272"/>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUINumberOfLines">0</int>
-					</object>
-				</object>
-				<string key="NSFrameSize">{1024, 768}</string>
-				<reference key="NSSuperview"/>
-				<reference key="NSWindow"/>
-				<object class="NSColor" key="IBUIBackgroundColor">
-					<int key="NSColorSpace">3</int>
-					<bytes key="NSWhite">MCAwLjQAA</bytes>
-				</object>
-				<bool key="IBUIOpaque">NO</bool>
-				<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-				<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
-					<int key="interfaceOrientation">3</int>
-				</object>
-				<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-			</object>
-		</object>
-		<object class="IBObjectContainer" key="IBDocument.Objects">
-			<object class="NSMutableArray" key="connectionRecords">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">view</string>
-						<reference key="source" ref="841351856"/>
-						<reference key="destination" ref="766721923"/>
-					</object>
-					<int key="connectionID">3</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">dismiss</string>
-						<reference key="source" ref="766721923"/>
-						<reference key="destination" ref="841351856"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">16</int>
-				</object>
-			</object>
-			<object class="IBMutableOrderedSet" key="objectRecords">
-				<object class="NSArray" key="orderedObjects">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBObjectRecord">
-						<int key="objectID">0</int>
-						<reference key="object" ref="0"/>
-						<reference key="children" ref="1000"/>
-						<nil key="parent"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-1</int>
-						<reference key="object" ref="841351856"/>
-						<reference key="parent" ref="0"/>
-						<string key="objectName">File's Owner</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-2</int>
-						<reference key="object" ref="606714003"/>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">2</int>
-						<reference key="object" ref="766721923"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="162303877"/>
-							<reference ref="323588470"/>
-							<reference ref="687330896"/>
-							<reference ref="1011244481"/>
-							<reference ref="552788325"/>
-							<reference ref="636170775"/>
-							<reference ref="1023832701"/>
-							<reference ref="1068254353"/>
-							<reference ref="261734864"/>
-							<reference ref="578857422"/>
-							<reference ref="972150858"/>
-							<reference ref="713859408"/>
-							<reference ref="896727228"/>
-							<reference ref="704238452"/>
-							<reference ref="533288614"/>
-							<reference ref="203633929"/>
-							<reference ref="345016434"/>
-							<reference ref="109182727"/>
-							<reference ref="379008984"/>
-							<reference ref="815146899"/>
-							<reference ref="379980516"/>
-							<reference ref="901581152"/>
-							<reference ref="595424508"/>
-							<reference ref="678356402"/>
-							<reference ref="993770514"/>
-							<reference ref="488737408"/>
-							<reference ref="463058693"/>
-							<reference ref="845663511"/>
-							<reference ref="823916653"/>
-						</object>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">6</int>
-						<reference key="object" ref="162303877"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">7</int>
-						<reference key="object" ref="323588470"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">8</int>
-						<reference key="object" ref="687330896"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">25</int>
-						<reference key="object" ref="533288614"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">26</int>
-						<reference key="object" ref="203633929"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">27</int>
-						<reference key="object" ref="345016434"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">28</int>
-						<reference key="object" ref="1011244481"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">29</int>
-						<reference key="object" ref="636170775"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">30</int>
-						<reference key="object" ref="552788325"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">34</int>
-						<reference key="object" ref="678356402"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">35</int>
-						<reference key="object" ref="1068254353"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">36</int>
-						<reference key="object" ref="1023832701"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">37</int>
-						<reference key="object" ref="261734864"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">38</int>
-						<reference key="object" ref="578857422"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">39</int>
-						<reference key="object" ref="972150858"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">40</int>
-						<reference key="object" ref="993770514"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">41</int>
-						<reference key="object" ref="488737408"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">42</int>
-						<reference key="object" ref="463058693"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">43</int>
-						<reference key="object" ref="713859408"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">44</int>
-						<reference key="object" ref="896727228"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">45</int>
-						<reference key="object" ref="704238452"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">49</int>
-						<reference key="object" ref="109182727"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">50</int>
-						<reference key="object" ref="815146899"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">51</int>
-						<reference key="object" ref="379008984"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">52</int>
-						<reference key="object" ref="379980516"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">53</int>
-						<reference key="object" ref="901581152"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">54</int>
-						<reference key="object" ref="595424508"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">58</int>
-						<reference key="object" ref="845663511"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">59</int>
-						<reference key="object" ref="823916653"/>
-						<reference key="parent" ref="766721923"/>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="flattenedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="NSArray" key="dict.sortedKeys">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>-1.CustomClassName</string>
-					<string>-2.CustomClassName</string>
-					<string>2.CustomClassName</string>
-					<string>2.IBEditorWindowLastContentRect</string>
-					<string>2.IBPluginDependency</string>
-					<string>25.IBPluginDependency</string>
-					<string>26.IBPluginDependency</string>
-					<string>27.IBPluginDependency</string>
-					<string>28.IBPluginDependency</string>
-					<string>29.IBPluginDependency</string>
-					<string>30.IBPluginDependency</string>
-					<string>34.IBPluginDependency</string>
-					<string>35.IBPluginDependency</string>
-					<string>36.IBPluginDependency</string>
-					<string>37.IBPluginDependency</string>
-					<string>38.IBPluginDependency</string>
-					<string>39.IBPluginDependency</string>
-					<string>40.IBPluginDependency</string>
-					<string>41.IBPluginDependency</string>
-					<string>42.IBPluginDependency</string>
-					<string>43.IBPluginDependency</string>
-					<string>44.IBPluginDependency</string>
-					<string>45.IBPluginDependency</string>
-					<string>49.IBPluginDependency</string>
-					<string>50.IBPluginDependency</string>
-					<string>51.IBPluginDependency</string>
-					<string>52.IBPluginDependency</string>
-					<string>53.IBPluginDependency</string>
-					<string>54.IBPluginDependency</string>
-					<string>58.IBPluginDependency</string>
-					<string>59.IBPluginDependency</string>
-					<string>6.IBPluginDependency</string>
-					<string>7.IBPluginDependency</string>
-					<string>8.IBPluginDependency</string>
-				</object>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>HelpPageViewController</string>
-					<string>UIResponder</string>
-					<string>UIControl</string>
-					<string>{{273, 125}, {1024, 768}}</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="unlocalizedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="activeLocalization"/>
-			<object class="NSMutableDictionary" key="localizations">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="sourceID"/>
-			<int key="maxID">59</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">HelpPageViewController</string>
-					<string key="superclassName">UIViewController</string>
-					<object class="NSMutableDictionary" key="actions">
-						<string key="NS.key.0">dismiss</string>
-						<string key="NS.object.0">id</string>
-					</object>
-					<object class="NSMutableDictionary" key="actionInfosByName">
-						<string key="NS.key.0">dismiss</string>
-						<object class="IBActionInfo" key="NS.object.0">
-							<string key="name">dismiss</string>
-							<string key="candidateClassName">id</string>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HelpPageViewController.h</string>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="786211723">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIControl</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIImageView</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIImageView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIResponder</string>
-					<string key="superclassName">NSObject</string>
-					<reference key="sourceIdentifier" ref="786211723"/>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchBar</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchDisplayController</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
-					</object>
-				</object>
-			</object>
-		</object>
-		<int key="IBDocument.localizationMode">0</int>
-		<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
-			<integer value="1024" key="NS.object.0"/>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
-			<integer value="3100" key="NS.object.0"/>
-		</object>
-		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
-		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
-		<int key="IBDocument.defaultPropertyAccessControl">3</int>
-		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>helpabove.png</string>
-				<string>helpbottom.png</string>
-				<string>helpleft.png</string>
-				<string>helpplain.png</string>
-				<string>helpright.png</string>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>{295, 156}</string>
-				<string>{295, 156}</string>
-				<string>{308, 144}</string>
-				<string>{296, 138}</string>
-				<string>{308, 144}</string>
-			</object>
-		</object>
-		<string key="IBCocoaTouchPluginVersion">123</string>
-	</data>
-</archive>
--- a/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,907 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
-	<data>
-		<int key="IBDocument.SystemTarget">1024</int>
-		<string key="IBDocument.SystemVersion">10F569</string>
-		<string key="IBDocument.InterfaceBuilderVersion">804</string>
-		<string key="IBDocument.AppKitVersion">1038.29</string>
-		<string key="IBDocument.HIToolboxVersion">461.00</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-			<string key="NS.object.0">123</string>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="2"/>
-		</object>
-		<object class="NSArray" key="IBDocument.PluginDependencies">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.Metadata">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys" id="0">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="IBProxyObject" id="841351856">
-				<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-			<object class="IBProxyObject" id="606714003">
-				<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-			<object class="IBUIView" id="766721923">
-				<reference key="NSNextResponder"/>
-				<int key="NSvFlags">292</int>
-				<object class="NSMutableArray" key="NSSubviews">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBUIScrollView" id="451725730">
-						<reference key="NSNextResponder" ref="766721923"/>
-						<int key="NSvFlags">268</int>
-						<object class="NSMutableArray" key="NSSubviews">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBUILabel" id="381271451">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 587}, {440, 52}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Still confused? Don't worry, it's really simple! Try a couple of games and everything will become clear to you.</string>
-								<object class="NSFont" key="IBUIFont" id="818038162">
-									<string key="NSName">Helvetica</string>
-									<double key="NSSize">16</double>
-									<int key="NSfFlags">16</int>
-								</object>
-								<object class="NSColor" key="IBUITextColor" id="283637272">
-									<int key="NSColorSpace">1</int>
-									<bytes key="NSRGB">MCAwIDAAA</bytes>
-								</object>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-								<int key="IBUITextAlignment">1</int>
-							</object>
-							<object class="IBUILabel" id="160273292">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 279}, {138, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Size slider</string>
-								<object class="NSFont" key="IBUIFont" id="583365693">
-									<string key="NSName">Helvetica-Bold</string>
-									<double key="NSSize">18</double>
-									<int key="NSfFlags">16</int>
-								</object>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="399703336">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 298}, {440, 44}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">For Random and Maze maps you can decide to generate only maps of a certain size.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="780482878">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 511}, {204, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Schemes and Weapons</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="715276626">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 530}, {433, 45}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Here you can choose which rules and which weapon set will be applied in game.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="81383071">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 68}, {109, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Map preview</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="518187701">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 88}, {440, 44}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">This is a small preview of your next map. Tap to select / generate a new map.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="601567061">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 140}, {109, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Map type</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="514192288">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 164}, {440, 58}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Choose between a static map or a randomly generated one (might require more time). In a mission you need to perfom some action to win.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="136109594">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 229}, {109, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Map theme</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="345586237">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 244}, {440, 33}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Here you can choose how your map will appear in game.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="686505362">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 347}, {138, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Max hedgehogs</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="629677748">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 367}, {440, 41}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">This number is the maximum size for all the hogs playing (in every team).</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="79643170">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 418}, {109, 22}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Teams</string>
-								<reference key="IBUIFont" ref="583365693"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-							</object>
-							<object class="IBUILabel" id="676482380">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 436}, {433, 66}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Select which teams are playing! Add hogs by tapping on them and set their color to figure friend and foe teams out. AI teams will appear with a small robot badge next their name.</string>
-								<reference key="IBUIFont" ref="818038162"/>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-							</object>
-							<object class="IBUILabel" id="66496634">
-								<reference key="NSNextResponder" ref="451725730"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{13, 3}, {440, 60}}</string>
-								<reference key="NSSuperview" ref="451725730"/>
-								<bool key="IBUIOpaque">NO</bool>
-								<bool key="IBUIClipsSubviews">YES</bool>
-								<int key="IBUIContentMode">7</int>
-								<bool key="IBUIUserInteractionEnabled">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<string key="IBUIText">Here you can find help for the game configuration options. You can customize almost everything in the settings page.</string>
-								<object class="NSFont" key="IBUIFont">
-									<string key="NSName">Helvetica-Oblique</string>
-									<double key="NSSize">16</double>
-									<int key="NSfFlags">16</int>
-								</object>
-								<reference key="IBUITextColor" ref="283637272"/>
-								<nil key="IBUIHighlightedColor"/>
-								<int key="IBUIBaselineAdjustment">1</int>
-								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUINumberOfLines">0</int>
-								<int key="IBUITextAlignment">1</int>
-							</object>
-						</object>
-						<string key="NSFrameSize">{480, 276}</string>
-						<reference key="NSSuperview" ref="766721923"/>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-					</object>
-				</object>
-				<string key="NSFrameSize">{480, 276}</string>
-				<reference key="NSSuperview"/>
-				<object class="NSColor" key="IBUIBackgroundColor">
-					<int key="NSColorSpace">2</int>
-					<bytes key="NSRGB">MC45OTYwNzg0OTEyIDAuOTg4MjM1MzU0NCAxAA</bytes>
-				</object>
-				<bool key="IBUIOpaque">NO</bool>
-				<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-				<object class="IBUISimulatedToolbarMetrics" key="IBUISimulatedBottomBarMetrics"/>
-				<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
-					<int key="interfaceOrientation">3</int>
-				</object>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-		</object>
-		<object class="IBObjectContainer" key="IBDocument.Objects">
-			<object class="NSMutableArray" key="connectionRecords">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">view</string>
-						<reference key="source" ref="841351856"/>
-						<reference key="destination" ref="766721923"/>
-					</object>
-					<int key="connectionID">3</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">scrollView</string>
-						<reference key="source" ref="841351856"/>
-						<reference key="destination" ref="451725730"/>
-					</object>
-					<int key="connectionID">95</int>
-				</object>
-			</object>
-			<object class="IBMutableOrderedSet" key="objectRecords">
-				<object class="NSArray" key="orderedObjects">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBObjectRecord">
-						<int key="objectID">0</int>
-						<reference key="object" ref="0"/>
-						<reference key="children" ref="1000"/>
-						<nil key="parent"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-1</int>
-						<reference key="object" ref="841351856"/>
-						<reference key="parent" ref="0"/>
-						<string key="objectName">File's Owner</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-2</int>
-						<reference key="object" ref="606714003"/>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">2</int>
-						<reference key="object" ref="766721923"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="451725730"/>
-						</object>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">60</int>
-						<reference key="object" ref="451725730"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="381271451"/>
-							<reference ref="160273292"/>
-							<reference ref="399703336"/>
-							<reference ref="81383071"/>
-							<reference ref="518187701"/>
-							<reference ref="601567061"/>
-							<reference ref="514192288"/>
-							<reference ref="136109594"/>
-							<reference ref="345586237"/>
-							<reference ref="686505362"/>
-							<reference ref="629677748"/>
-							<reference ref="780482878"/>
-							<reference ref="715276626"/>
-							<reference ref="79643170"/>
-							<reference ref="676482380"/>
-							<reference ref="66496634"/>
-						</object>
-						<reference key="parent" ref="766721923"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">61</int>
-						<reference key="object" ref="381271451"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">62</int>
-						<reference key="object" ref="160273292"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">63</int>
-						<reference key="object" ref="399703336"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">64</int>
-						<reference key="object" ref="780482878"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">65</int>
-						<reference key="object" ref="715276626"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">66</int>
-						<reference key="object" ref="81383071"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">67</int>
-						<reference key="object" ref="518187701"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">68</int>
-						<reference key="object" ref="601567061"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">69</int>
-						<reference key="object" ref="514192288"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">70</int>
-						<reference key="object" ref="136109594"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">71</int>
-						<reference key="object" ref="345586237"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">72</int>
-						<reference key="object" ref="686505362"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">73</int>
-						<reference key="object" ref="629677748"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">74</int>
-						<reference key="object" ref="79643170"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">75</int>
-						<reference key="object" ref="676482380"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">76</int>
-						<reference key="object" ref="66496634"/>
-						<reference key="parent" ref="451725730"/>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="flattenedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="NSArray" key="dict.sortedKeys">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>-1.CustomClassName</string>
-					<string>-2.CustomClassName</string>
-					<string>2.IBEditorWindowLastContentRect</string>
-					<string>2.IBPluginDependency</string>
-					<string>60.IBPluginDependency</string>
-					<string>60.IBViewBoundsToFrameTransform</string>
-					<string>61.IBPluginDependency</string>
-					<string>61.IBViewBoundsToFrameTransform</string>
-					<string>62.IBPluginDependency</string>
-					<string>62.IBViewBoundsToFrameTransform</string>
-					<string>63.IBPluginDependency</string>
-					<string>63.IBViewBoundsToFrameTransform</string>
-					<string>64.IBPluginDependency</string>
-					<string>64.IBViewBoundsToFrameTransform</string>
-					<string>65.IBPluginDependency</string>
-					<string>65.IBViewBoundsToFrameTransform</string>
-					<string>66.IBPluginDependency</string>
-					<string>66.IBViewBoundsToFrameTransform</string>
-					<string>67.IBPluginDependency</string>
-					<string>67.IBViewBoundsToFrameTransform</string>
-					<string>68.IBPluginDependency</string>
-					<string>68.IBViewBoundsToFrameTransform</string>
-					<string>69.IBPluginDependency</string>
-					<string>69.IBViewBoundsToFrameTransform</string>
-					<string>70.IBPluginDependency</string>
-					<string>70.IBViewBoundsToFrameTransform</string>
-					<string>71.IBPluginDependency</string>
-					<string>71.IBViewBoundsToFrameTransform</string>
-					<string>72.IBPluginDependency</string>
-					<string>72.IBViewBoundsToFrameTransform</string>
-					<string>73.IBPluginDependency</string>
-					<string>73.IBViewBoundsToFrameTransform</string>
-					<string>74.IBPluginDependency</string>
-					<string>74.IBViewBoundsToFrameTransform</string>
-					<string>75.IBPluginDependency</string>
-					<string>75.IBViewBoundsToFrameTransform</string>
-					<string>76.IBPluginDependency</string>
-					<string>76.IBViewBoundsToFrameTransform</string>
-				</object>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>HelpPageViewController</string>
-					<string>UIResponder</string>
-					<string>{{16, 775}, {480, 320}}</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform"/>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">AUGgAABEDIAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABC+AAAw0kAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw14AAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw9mAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw+6AAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABByAAAwqYAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwxMAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAADCQAAAwqYAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAADCQAAAwzcAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDAAAAw3AAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDAAAAw5aAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDOwAAw6OAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDOwAAw8WAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDDgAAw7UAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABDDQAAw/CAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAADBAAAAwlQAAA</bytes>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="unlocalizedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="activeLocalization"/>
-			<object class="NSMutableDictionary" key="localizations">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="sourceID"/>
-			<int key="maxID">95</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">HelpPageViewController</string>
-					<string key="superclassName">UIViewController</string>
-					<object class="NSMutableDictionary" key="actions">
-						<string key="NS.key.0">dismiss</string>
-						<string key="NS.object.0">id</string>
-					</object>
-					<object class="NSMutableDictionary" key="actionInfosByName">
-						<string key="NS.key.0">dismiss</string>
-						<object class="IBActionInfo" key="NS.object.0">
-							<string key="name">dismiss</string>
-							<string key="candidateClassName">id</string>
-						</object>
-					</object>
-					<object class="NSMutableDictionary" key="outlets">
-						<string key="NS.key.0">scrollView</string>
-						<string key="NS.object.0">UIScrollView</string>
-					</object>
-					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<string key="NS.key.0">scrollView</string>
-						<object class="IBToOneOutletInfo" key="NS.object.0">
-							<string key="name">scrollView</string>
-							<string key="candidateClassName">UIScrollView</string>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HelpPageViewController.h</string>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="786211723">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIResponder</string>
-					<string key="superclassName">NSObject</string>
-					<reference key="sourceIdentifier" ref="786211723"/>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIScrollView</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchBar</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchDisplayController</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
-					</object>
-				</object>
-			</object>
-		</object>
-		<int key="IBDocument.localizationMode">0</int>
-		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
-			<integer value="1024" key="NS.object.0"/>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
-			<integer value="3100" key="NS.object.0"/>
-		</object>
-		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
-		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
-		<int key="IBDocument.defaultPropertyAccessControl">3</int>
-		<string key="IBCocoaTouchPluginVersion">123</string>
-	</data>
-</archive>
--- a/project_files/HedgewarsMobile/Classes/HelpPageViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 30/08/2010.
- */
-
-
-#import <UIKit/UIKit.h>
-
-
-@interface HelpPageViewController : UIViewController <UIScrollViewDelegate> {
-    UIScrollView *scrollView;
-}
-
-@property (nonatomic, retain) IBOutlet UIScrollView *scrollView;
-
--(IBAction) dismiss;
-
-@end
--- a/project_files/HedgewarsMobile/Classes/HelpPageViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 30/08/2010.
- */
-
-
-#import "HelpPageViewController.h"
-
-
-@implementation HelpPageViewController
-@synthesize scrollView;
-
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
-    return rotationManager(interfaceOrientation);
-}
-
--(void) didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    self.scrollView = nil;
-}
-
-// on iPhone the XIBs contain UIScrollView
--(void) viewDidLoad {
-    if (scrollView.tag == 0)    // ipad
-        scrollView.contentSize = CGSizeMake(480,650);
-    else                        // iphone
-        scrollView.contentSize = CGSizeMake(480,470);
-    scrollView.maximumZoomScale = 4.0;
-    scrollView.minimumZoomScale = 0.75;
-    scrollView.clipsToBounds = YES;
-    scrollView.delegate = self;
-    [super viewDidLoad];
-}
-
--(void) viewDidUnload {
-    [super viewDidUnload];
-    self.scrollView = nil;
-}
-
--(void) dealloc {
-    releaseAndNil(scrollView);
-    [super dealloc];
-}
-
--(IBAction) dismiss {
-    [UIView beginAnimations:@"helpingame" context:NULL];
-    self.view.alpha = 0;
-    [UIView commitAnimations];
-    [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
-}
-
-@end
--- a/project_files/HedgewarsMobile/Classes/HogHatViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HogHatViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/HogHatViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HogHatViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/HoldTableViewCell.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HoldTableViewCell.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 03/07/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @protocol HoldTableViewCellDelegate <NSObject>
 
 -(void) holdAction:(NSString *)content onTable:(UITableView *)aTableView;
--- a/project_files/HedgewarsMobile/Classes/HoldTableViewCell.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HoldTableViewCell.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,11 @@
  * 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 created on 03/07/2010.
  */
 
 
 #import "HoldTableViewCell.h"
-#import "CGPointUtils.h"
+
 
 @implementation HoldTableViewCell
 @synthesize delegate;
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 25/03/2010.
- */
-
-
-#import <UIKit/UIKit.h>
-
-
-@interface InGameMenuViewController : UITableViewController <UIActionSheetDelegate> {
-
-}
-
-
--(void) present;
--(void) dismiss;
-
-@end
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 25/03/2010.
- */
-
-
-#import "InGameMenuViewController.h"
-#import "SDL_sysvideo.h"
-#import "SDL_uikitkeyboard.h"
-
-//FIXME: add a proper #import when this is exposed in SDL
-extern UIView *SDL_getUikitView(void *);
-
-#define VIEW_HEIGHT 200
-
-@implementation InGameMenuViewController
-
-
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
-    return rotationManager(interfaceOrientation);
-}
-
-#pragma mark -
-#pragma mark animating
--(void) present {
-    CGRect screen = [[UIScreen mainScreen] bounds];
-    self.view.backgroundColor = [UIColor clearColor];
-    self.view.frame = CGRectMake(screen.size.height, 0, 200, VIEW_HEIGHT);
-
-    [UIView beginAnimations:@"showing popover" context:NULL];
-    [UIView setAnimationDuration:0.35];
-    self.view.frame = CGRectMake(screen.size.height-200, 0, 200, VIEW_HEIGHT);
-    [UIView commitAnimations];
-}
-
--(void) dismiss {
-    if (IS_IPAD() == NO) {
-        CGRect screen = [[UIScreen mainScreen] bounds];
-        [UIView beginAnimations:@"hiding popover" context:NULL];
-        [UIView setAnimationDuration:0.35];
-        self.view.frame = CGRectMake(screen.size.height, 0, 200, VIEW_HEIGHT);
-        [UIView commitAnimations];
-        [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.35];
-    }
-
-    SDL_iPhoneKeyboardHide((SDL_Window *)HW_getSDLWindow());
-}
-
-#pragma mark -
-#pragma mark tableView methods
--(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
-    return 1;
-}
-
--(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 3;
-}
-
--(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    static NSString *cellIdentifier = @"CellIdentifier";
-
-    NSInteger row = [indexPath row];
-    NSString *cellTitle;
-    if (row == 0)
-        cellTitle = NSLocalizedString(@"Show Help", @"");
-    else if (row == 1)
-        cellTitle = NSLocalizedString(@"Tag", @"");
-    else
-        cellTitle = NSLocalizedString(@"End Game", @"");
-
-    UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier];
-    if (nil == cell) {
-        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
-                                       reuseIdentifier:cellIdentifier] autorelease];
-    }
-    cell.textLabel.text = cellTitle;
-
-    if (IS_IPAD())
-        cell.textLabel.textAlignment = UITextAlignmentCenter;
-
-    return cell;
-}
-
--(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    UIActionSheet *actionSheet;
-
-    switch ([indexPath row]) {
-        case 0:
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"show help ingame" object:nil];
-
-            break;
-        case 1:
-            HW_chat();
-            SDL_iPhoneKeyboardShow((SDL_Window *)HW_getSDLWindow());
-
-            break;
-        case 2:
-            actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Are you reeeeeally sure?", @"")
-                                                      delegate:self
-                                             cancelButtonTitle:NSLocalizedString(@"Well, maybe not...", @"")
-                                        destructiveButtonTitle:NSLocalizedString(@"Of course!", @"")
-                                             otherButtonTitles:nil];
-            [actionSheet showInView:(IS_IPAD() ? self.view : SDL_getUikitView(HW_getSDLWindow()))];
-            [actionSheet release];
-
-            break;
-        default:
-            DLog(@"Warning: unset case value in section!");
-            break;
-    }
-
-    [aTableView deselectRowAtIndexPath:indexPath animated:YES];
-}
-
-#pragma mark -
-#pragma mark actionSheet methods
--(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
-    if ([actionSheet cancelButtonIndex] != buttonIndex) {
-        SDL_iPhoneKeyboardHide((SDL_Window *)HW_getSDLWindow());
-        HW_terminate(NO);
-    }
-}
-
-@end
--- a/project_files/HedgewarsMobile/Classes/LevelViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/LevelViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/LevelViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/LevelViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 0211-1307, USA.
- *
- * File created on 02/04/2010.
  */
 
 
@@ -25,12 +23,10 @@
 @implementation LevelViewController
 @synthesize teamDictionary, levelArray, levelSprites, lastIndexPath;
 
-
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
-
 #pragma mark -
 #pragma mark View lifecycle
 -(void) viewDidLoad {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/LICENCE.rtf	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,104 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
+{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
+{\colortbl;\red255\green255\blue255;\red51\green51\blue51;\red0\green180\blue128;\red255\green0\blue0;
+\red31\green105\blue199;\red119\green119\blue119;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid1\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
+\deftab720
+\pard\pardeftab720\ql\qnatural
+
+\f0\b\fs24 \cf2 Matt Legend Gemmell / Instinctive Code Source Code License\
+
+\b0\fs22 Last updated: 9th May 2010
+\fs24 \
+\
+\
+Thanks for downloading some of our source code!\
+\
+This is the license agreement for the source code which this document accompanies (don\'92t worry: you\'92re allowed to use it in your own products, commercial or otherwise).\
+\
+The full license text is further down this page, and you should only use the source code if you agree to the terms in that text. For convenience, though, we\'92ve put together a human-readable 
+\b non-authoritative
+\b0  interpretation of the license which will hopefully answer any questions you have.\
+\
+\
+
+\b \cf3 Green
+\b0 \cf2  text shows 
+\b \cf3 what you can do with the code
+\b0 \cf2 .\
+
+\b \cf4 Red
+\b0 \cf2  text means 
+\b \cf4 restrictions you must abide by
+\b0 \cf2 .\
+\
+Basically, the license says that:\
+\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls1\ilvl0\cf2 {\listtext	1.	}You can 
+\b \cf3 use the code in your own products, including commercial and/or closed-source products
+\b0 \cf2 .\
+{\listtext	2.	}You can 
+\b \cf3 modify the code
+\b0 \cf0  as you wish\cf2 , and 
+\b \cf3 use the modified code in your products
+\b0 \cf2 .\
+{\listtext	3.	}You can 
+\b \cf3 redistribute the original, unmodified code
+\b0 \cf2 , but you 
+\b \cf4 have to include the full license text below
+\b0 \cf2 .\
+{\listtext	4.	}You can 
+\b \cf3 redistribute the modified code
+\b0 \cf2  as you wish (
+\b \cf4 without the full license text below
+\b0 \cf2 ).\
+{\listtext	5.	}In all cases, you 
+\b \cf4 must include a credit mentioning Matt Legend Gemmell
+\b0 \cf2  as the original author of the source.\
+{\listtext	6.	}Matt Legend Gemmell is \cf0 not liable for anything you do with the code\cf2 , no matter what. So be sensible.\
+{\listtext	7.	}You 
+\b \cf4 can\'92t use the name Matt Legend Gemmell, the name Instinctive Code, the Instinctive Code logo or any other related marks to promote your products
+\b0 \cf2  based on the code.\
+{\listtext	8.	}If you agree to all of that, go ahead and use the source. Otherwise, don\'92t!\
+\pard\pardeftab720\ql\qnatural
+\cf2 \
+
+\b \
+\
+Suggested Attribution Format\
+
+\b0 \
+The license requires that you give credit to Matt Legend Gemmell, as the original author of any of our source that you use. The placement and format of the credit is up to you, but we prefer the credit to be in the software\'92s \'93About\'94 window. Alternatively, you could put the credit in a list of acknowledgements within the software, in the software\'92s documentation, or on the web page for the software. The suggested format for the attribution is:\
+\
+\pard\pardeftab720\ql\qnatural
+
+\b \cf0 	Includes <Name of Code> code by {\field{\*\fldinst{HYPERLINK "http://mattgemmell.com/"}}{\fldrslt \cf5 Matt Legend Gemmell}}\cf6 .
+\b0 \
+\pard\pardeftab720\ql\qnatural
+\cf2 \
+where <Name of Code> would be replaced by the name of the specific source-code package you made use of. Where possible, please link the text \'93Matt Legend Gemmell\'94 to the following URL, or include the URL as plain text: {\field{\*\fldinst{HYPERLINK "http://mattgemmell.com/"}}{\fldrslt \cf5 http://mattgemmell.com/}}\
+\
+\
+
+\b Full Source Code License Text\
+\
+
+\b0 Below you can find the actual text of the license agreement.
+\b \
+\
+\pard\pardeftab720\ql\qnatural
+\cf6 \
+License Agreement for Source Code provided by Matt Legend Gemmell
+\b0 \
+\
+This software is supplied to you by Matt Legend Gemmell in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this software.\
+\
+In consideration of your agreement to abide by the following terms, and subject to these terms, Matt Legend Gemmell grants you a personal, non-exclusive license, to use, reproduce, modify and redistribute the software, with or without modifications, in source and/or binary forms; provided that if you redistribute the software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the software, and that in all cases attribution of Matt Legend Gemmell as the original author of the source code shall be included in all such resulting software products or distributions.\uc0\u8232 \
+Neither the name, trademarks, service marks or logos of Matt Legend Gemmell or Instinctive Code may be used to endorse or promote products derived from the software without specific prior written permission from Matt Legend Gemmell. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Matt Legend Gemmell herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the software may be incorporated.\
+\
+The software is provided by Matt Legend Gemmell on an "AS IS" basis. MATT LEGEND GEMMELL AND INSTINCTIVE CODE MAKE NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\
+\
+IN NO EVENT SHALL MATT LEGEND GEMMELL OR INSTINCTIVE CODE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF MATT LEGEND GEMMELL OR INSTINCTIVE CODE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+//
+//  MGSplitCornersView.h
+//  MGSplitView
+//
+//  Created by Matt Gemmell on 28/07/2010.
+//  Copyright 2010 Instinctive Code.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef enum _MGCornersPosition {
+	MGCornersPositionLeadingVertical	= 0, // top of screen for a left/right split.
+	MGCornersPositionTrailingVertical	= 1, // bottom of screen for a left/right split.
+	MGCornersPositionLeadingHorizontal	= 2, // left of screen for a top/bottom split.
+	MGCornersPositionTrailingHorizontal	= 3  // right of screen for a top/bottom split.
+} MGCornersPosition;
+
+@class MGSplitViewController;
+@interface MGSplitCornersView : UIView {
+	float cornerRadius;
+	MGSplitViewController *splitViewController;
+	MGCornersPosition cornersPosition;
+	UIColor *cornerBackgroundColor;
+}
+
+@property (nonatomic, assign) float cornerRadius;
+@property (nonatomic, assign) MGSplitViewController *splitViewController; // weak ref.
+@property (nonatomic, assign) MGCornersPosition cornersPosition; // don't change this manually; let the splitViewController manage it.
+@property (nonatomic, retain) UIColor *cornerBackgroundColor;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.m	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,223 @@
+//
+//  MGSplitCornersView.m
+//  MGSplitView
+//
+//  Created by Matt Gemmell on 28/07/2010.
+//  Copyright 2010 Instinctive Code.
+//
+
+#import "MGSplitCornersView.h"
+#import "CGPointUtils.h"
+
+@implementation MGSplitCornersView
+
+
+#pragma mark -
+#pragma mark Setup and teardown
+
+
+- (id)initWithFrame:(CGRect)frame
+{
+    if ((self = [super initWithFrame:frame])) {
+		self.contentMode = UIViewContentModeRedraw;
+		self.userInteractionEnabled = NO;
+		self.opaque = NO;
+		self.backgroundColor = [UIColor clearColor];
+		cornerRadius = 0.0; // actual value is set by the splitViewController.
+		cornersPosition = MGCornersPositionLeadingVertical;
+    }
+	
+    return self;
+}
+
+
+- (void)dealloc
+{
+	self.cornerBackgroundColor = nil;
+	
+	[super dealloc];
+}
+
+
+#pragma mark -
+#pragma mark Drawing
+
+
+- (void)drawRect:(CGRect)rect
+{
+	// Draw two appropriate corners, with cornerBackgroundColor behind them.
+	if (cornerRadius > 0) {
+		if (NO) { // just for debugging.
+			[[UIColor redColor] set];
+			UIRectFill(self.bounds);
+		}
+		
+		float maxX = CGRectGetMaxX(self.bounds);
+		float maxY = CGRectGetMaxY(self.bounds);
+		UIBezierPath *path = [UIBezierPath bezierPath];
+		CGPoint pt = CGPointZero;
+		switch (cornersPosition) {
+			case MGCornersPositionLeadingVertical: // top of screen for a left/right split
+				[path moveToPoint:pt];
+				pt.y += cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(90) endAngle:0 clockwise:YES]];
+				pt.x += cornerRadius;
+				pt.y -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path addLineToPoint:CGPointZero];
+				[path closePath];
+				
+				pt.x = maxX - cornerRadius;
+				pt.y = 0;
+				[path moveToPoint:pt];
+				pt.y = maxY;
+				[path addLineToPoint:pt];
+				pt.x += cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(90) clockwise:YES]];
+				pt.y -= cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				break;
+				
+			case MGCornersPositionTrailingVertical: // bottom of screen for a left/right split
+				pt.y = maxY;
+				[path moveToPoint:pt];
+				pt.y -= cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(270) endAngle:degreesToRadians(360) clockwise:NO]];
+				pt.x += cornerRadius;
+				pt.y += cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				pt.x = maxX - cornerRadius;
+				pt.y = maxY;
+				[path moveToPoint:pt];
+				pt.y -= cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x += cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(270) clockwise:NO]];
+				pt.y += cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				break;
+				
+			case MGCornersPositionLeadingHorizontal: // left of screen for a top/bottom split
+				pt.x = 0;
+				pt.y = cornerRadius;
+				[path moveToPoint:pt];
+				pt.y -= cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x += cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(270) clockwise:NO]];
+				pt.y += cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				pt.x = 0;
+				pt.y = maxY - cornerRadius;
+				[path moveToPoint:pt];
+				pt.y = maxY;
+				[path addLineToPoint:pt];
+				pt.x += cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(90) clockwise:YES]];
+				pt.y -= cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				break;
+				
+			case MGCornersPositionTrailingHorizontal: // right of screen for a top/bottom split
+				pt.y = cornerRadius;
+				[path moveToPoint:pt];
+				pt.y -= cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(270) endAngle:degreesToRadians(360) clockwise:NO]];
+				pt.x += cornerRadius;
+				pt.y += cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				pt.y = maxY - cornerRadius;
+				[path moveToPoint:pt];
+				pt.y += cornerRadius;
+				[path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(90) endAngle:0 clockwise:YES]];
+				pt.x += cornerRadius;
+				pt.y -= cornerRadius;
+				[path addLineToPoint:pt];
+				pt.x -= cornerRadius;
+				[path addLineToPoint:pt];
+				[path closePath];
+				
+				break;
+				
+			default:
+				break;
+		}
+		
+		[self.cornerBackgroundColor set];
+		[path fill];
+	}
+}
+
+
+#pragma mark -
+#pragma mark Accessors and properties
+
+
+- (void)setCornerRadius:(float)newRadius
+{
+	if (newRadius != cornerRadius) {
+		cornerRadius = newRadius;
+		[self setNeedsDisplay];
+	}
+}
+
+
+- (void)setSplitViewController:(MGSplitViewController *)theController
+{
+	if (theController != splitViewController) {
+		splitViewController = theController;
+		[self setNeedsDisplay];
+	}
+}
+
+
+- (void)setCornersPosition:(MGCornersPosition)posn
+{
+	if (cornersPosition != posn) {
+		cornersPosition = posn;
+		[self setNeedsDisplay];
+	}
+}
+
+
+- (void)setCornerBackgroundColor:(UIColor *)color
+{
+	if (color != cornerBackgroundColor) {
+		[cornerBackgroundColor release];
+		cornerBackgroundColor = [color retain];
+		[self setNeedsDisplay];
+	}
+}
+
+
+@synthesize cornerRadius;
+@synthesize splitViewController;
+@synthesize cornersPosition;
+@synthesize cornerBackgroundColor;
+
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,22 @@
+//
+//  MGSplitDividerView.h
+//  MGSplitView
+//
+//  Created by Matt Gemmell on 26/07/2010.
+//  Copyright 2010 Instinctive Code.
+//
+
+#import <UIKit/UIKit.h>
+
+@class MGSplitViewController;
+@interface MGSplitDividerView : UIView {
+	MGSplitViewController *splitViewController;
+	BOOL allowsDragging;
+}
+
+@property (nonatomic, assign) MGSplitViewController *splitViewController; // weak ref.
+@property (nonatomic, assign) BOOL allowsDragging;
+
+- (void)drawGripThumbInRect:(CGRect)rect;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.m	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,216 @@
+//
+//  MGSplitDividerView.m
+//  MGSplitView
+//
+//  Created by Matt Gemmell on 26/07/2010.
+//  Copyright 2010 Instinctive Code.
+//
+
+#import "MGSplitDividerView.h"
+#import "MGSplitViewController.h"
+
+
+@implementation MGSplitDividerView
+
+
+#pragma mark -
+#pragma mark Setup and teardown
+
+
+- (id)initWithFrame:(CGRect)frame
+{
+	if ((self = [super initWithFrame:frame])) {
+		self.userInteractionEnabled = NO;
+		self.allowsDragging = NO;
+		self.contentMode = UIViewContentModeRedraw;
+	}
+	return self;
+}
+
+
+- (void)dealloc
+{
+	self.splitViewController = nil;
+	[super dealloc];
+}
+
+
+#pragma mark -
+#pragma mark Drawing
+
+
+- (void)drawRect:(CGRect)rect
+{
+	if (splitViewController.dividerStyle == MGSplitViewDividerStyleThin) {
+		[super drawRect:rect];
+		
+	} else if (splitViewController.dividerStyle == MGSplitViewDividerStylePaneSplitter) {
+		// Draw gradient background.
+		CGRect bounds = self.bounds;
+		CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
+		CGFloat locations[2] = {0, 1};
+		CGFloat components[8] = {	0.988, 0.988, 0.988, 1.0,  // light
+									0.875, 0.875, 0.875, 1.0 };// dark
+		CGGradientRef gradient = CGGradientCreateWithColorComponents (rgb, components, locations, 2);
+		CGContextRef context = UIGraphicsGetCurrentContext();
+		CGPoint start, end;
+		if (splitViewController.vertical) {
+			// Light left to dark right.
+			start = CGPointMake(CGRectGetMinX(bounds), CGRectGetMidY(bounds));
+			end = CGPointMake(CGRectGetMaxX(bounds), CGRectGetMidY(bounds));
+		} else {
+			// Light top to dark bottom.
+			start = CGPointMake(CGRectGetMidX(bounds), CGRectGetMinY(bounds));
+			end = CGPointMake(CGRectGetMidX(bounds), CGRectGetMaxY(bounds));
+		}
+		CGContextDrawLinearGradient(context, gradient, start, end, 0);
+		CGColorSpaceRelease(rgb);
+		CGGradientRelease(gradient);
+		
+		// Draw borders.
+		float borderThickness = 1.0;
+		[[UIColor colorWithWhite:0.7 alpha:1.0] set];
+		CGRect borderRect = bounds;
+		if (splitViewController.vertical) {
+			borderRect.size.width = borderThickness;
+			UIRectFill(borderRect);
+			borderRect.origin.x = CGRectGetMaxX(bounds) - borderThickness;
+			UIRectFill(borderRect);
+			
+		} else {
+			borderRect.size.height = borderThickness;
+			UIRectFill(borderRect);
+			borderRect.origin.y = CGRectGetMaxY(bounds) - borderThickness;
+			UIRectFill(borderRect);
+		}
+		
+		// Draw grip.
+		[self drawGripThumbInRect:bounds];
+	}
+}
+
+
+- (void)drawGripThumbInRect:(CGRect)rect
+{
+	float width = 9.0;
+	float height;
+	if (splitViewController.vertical) {
+		height = 30.0;
+	} else {
+		height = width;
+		width = 30.0;
+	}
+	
+	// Draw grip in centred in rect.
+	CGRect gripRect = CGRectMake(0, 0, width, height);
+	gripRect.origin.x = ((rect.size.width - gripRect.size.width) / 2.0);
+	gripRect.origin.y = ((rect.size.height - gripRect.size.height) / 2.0);
+	
+	float stripThickness = 1.0;
+	UIColor *stripColor = [UIColor colorWithWhite:0.35 alpha:1.0];
+	UIColor *lightColor = [UIColor colorWithWhite:1.0 alpha:1.0];
+	float space = 3.0;
+	if (splitViewController.vertical) {
+		gripRect.size.width = stripThickness;
+		[stripColor set];
+		UIRectFill(gripRect);
+		
+		gripRect.origin.x += stripThickness;
+		gripRect.origin.y += 1;
+		[lightColor set];
+		UIRectFill(gripRect);
+		gripRect.origin.x -= stripThickness;
+		gripRect.origin.y -= 1;
+		
+		gripRect.origin.x += space + stripThickness;
+		[stripColor set];
+		UIRectFill(gripRect);
+		
+		gripRect.origin.x += stripThickness;
+		gripRect.origin.y += 1;
+		[lightColor set];
+		UIRectFill(gripRect);
+		gripRect.origin.x -= stripThickness;
+		gripRect.origin.y -= 1;
+		
+		gripRect.origin.x += space + stripThickness;
+		[stripColor set];
+		UIRectFill(gripRect);
+		
+		gripRect.origin.x += stripThickness;
+		gripRect.origin.y += 1;
+		[lightColor set];
+		UIRectFill(gripRect);
+		
+	} else {
+		gripRect.size.height = stripThickness;
+		[stripColor set];
+		UIRectFill(gripRect);
+		
+		gripRect.origin.y += stripThickness;
+		gripRect.origin.x -= 1;
+		[lightColor set];
+		UIRectFill(gripRect);
+		gripRect.origin.y -= stripThickness;
+		gripRect.origin.x += 1;
+		
+		gripRect.origin.y += space + stripThickness;
+		[stripColor set];
+		UIRectFill(gripRect);
+		
+		gripRect.origin.y += stripThickness;
+		gripRect.origin.x -= 1;
+		[lightColor set];
+		UIRectFill(gripRect);
+		gripRect.origin.y -= stripThickness;
+		gripRect.origin.x += 1;
+		
+		gripRect.origin.y += space + stripThickness;
+		[stripColor set];
+		UIRectFill(gripRect);
+		
+		gripRect.origin.y += stripThickness;
+		gripRect.origin.x -= 1;
+		[lightColor set];
+		UIRectFill(gripRect);
+	}
+}
+
+
+#pragma mark -
+#pragma mark Interaction
+
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
+{
+	UITouch *touch = [touches anyObject];
+	if (touch) {
+		CGPoint lastPt = [touch previousLocationInView:self];
+		CGPoint pt = [touch locationInView:self];
+		float offset = (splitViewController.vertical) ? pt.x - lastPt.x : pt.y - lastPt.y;
+		if (!splitViewController.masterBeforeDetail) {
+			offset = -offset;
+		}
+		splitViewController.splitPosition = splitViewController.splitPosition + offset;
+	}
+}
+
+
+#pragma mark -
+#pragma mark Accessors and properties
+
+
+- (void)setAllowsDragging:(BOOL)flag
+{
+	if (flag != allowsDragging) {
+		allowsDragging = flag;
+		self.userInteractionEnabled = allowsDragging;
+	}
+}
+
+
+@synthesize splitViewController;
+@synthesize allowsDragging;
+
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,116 @@
+//
+//  MGSplitViewController.h
+//  MGSplitView
+//
+//  Created by Matt Gemmell on 26/07/2010.
+//  Copyright 2010 Instinctive Code.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef enum _MGSplitViewDividerStyle {
+	// These names have been chosen to be conceptually similar to those of NSSplitView on Mac OS X.
+	MGSplitViewDividerStyleThin			= 0, // Thin divider, like UISplitViewController (default).
+	MGSplitViewDividerStylePaneSplitter	= 1  // Thick divider, drawn with a grey gradient and a grab-strip.
+} MGSplitViewDividerStyle;
+
+@class MGSplitDividerView;
+@protocol MGSplitViewControllerDelegate;
+@interface MGSplitViewController : UIViewController <UIPopoverControllerDelegate> {
+	BOOL _showsMasterInPortrait;
+	BOOL _showsMasterInLandscape;
+	float _splitWidth;
+	id _delegate;
+	BOOL _vertical;
+	BOOL _masterBeforeDetail;
+	NSMutableArray *_viewControllers;
+	UIBarButtonItem *_barButtonItem; // To be compliant with wacky UISplitViewController behaviour.
+    UIPopoverController *_hiddenPopoverController; // Popover used to hold the master view if it's not always visible.
+	MGSplitDividerView *_dividerView; // View that draws the divider between the master and detail views.
+	NSArray *_cornerViews; // Views to draw the inner rounded corners between master and detail views.
+	float _splitPosition;
+	BOOL _reconfigurePopup;
+	MGSplitViewDividerStyle _dividerStyle; // Meta-setting which configures several aspects of appearance and behaviour.
+}
+
+@property (nonatomic, assign) IBOutlet id <MGSplitViewControllerDelegate> delegate;
+@property (nonatomic, assign) BOOL showsMasterInPortrait; // applies to both portrait orientations (default NO)
+@property (nonatomic, assign) BOOL showsMasterInLandscape; // applies to both landscape orientations (default YES)
+@property (nonatomic, assign, getter=isVertical) BOOL vertical; // if NO, split is horizontal, i.e. master above detail (default YES)
+@property (nonatomic, assign, getter=isMasterBeforeDetail) BOOL masterBeforeDetail; // if NO, master view is below/right of detail (default YES)
+@property (nonatomic, assign) float splitPosition; // starting position of split in pixels, relative to top/left (depending on .isVertical setting) if masterBeforeDetail is YES, else relative to bottom/right.
+@property (nonatomic, assign) float splitWidth; // width of split in pixels.
+@property (nonatomic, assign) BOOL allowsDraggingDivider; // whether to let the user drag the divider to alter the split position (default NO).
+
+@property (nonatomic, copy) NSArray *viewControllers; // array of UIViewControllers; master is at index 0, detail is at index 1.
+@property (nonatomic, retain) IBOutlet UIViewController *masterViewController; // convenience.
+@property (nonatomic, retain) IBOutlet UIViewController *detailViewController; // convenience.
+@property (nonatomic, retain) MGSplitDividerView *dividerView; // the view which draws the divider/split between master and detail.
+@property (nonatomic, assign) MGSplitViewDividerStyle dividerStyle; // style (and behaviour) of the divider between master and detail.
+
+@property (nonatomic, readonly, getter=isLandscape) BOOL landscape; // returns YES if this view controller is in either of the two Landscape orientations, else NO.
+
+// Actions
+- (IBAction)toggleSplitOrientation:(id)sender; // toggles split axis between vertical (left/right; default) and horizontal (top/bottom).
+- (IBAction)toggleMasterBeforeDetail:(id)sender; // toggles position of master view relative to detail view.
+- (IBAction)toggleMasterView:(id)sender; // toggles display of the master view in the current orientation.
+- (IBAction)showMasterPopover:(id)sender; // shows the master view in a popover spawned from the provided barButtonItem, if it's currently hidden.
+- (void)notePopoverDismissed; // should rarely be needed, because you should not change the popover's delegate. If you must, then call this when it's dismissed.
+
+// Conveniences for you, because I care.
+- (BOOL)isShowingMaster;
+- (void)setSplitPosition:(float)posn animated:(BOOL)animate; // Allows for animation of splitPosition changes. The property's regular setter is not animated.
+/* Note:	splitPosition is the width (in a left/right split, or height in a top/bottom split) of the master view.
+			It is relative to the appropriate side of the splitView, which can be any of the four sides depending on the values in isMasterBeforeDetail and isVertical:
+				isVertical = YES, isMasterBeforeDetail = YES: splitPosition is relative to the LEFT edge. (Default)
+				isVertical = YES, isMasterBeforeDetail = NO: splitPosition is relative to the RIGHT edge.
+ 				isVertical = NO, isMasterBeforeDetail = YES: splitPosition is relative to the TOP edge.
+ 				isVertical = NO, isMasterBeforeDetail = NO: splitPosition is relative to the BOTTOM edge.
+
+			This implementation was chosen so you don't need to recalculate equivalent splitPositions if the user toggles masterBeforeDetail themselves.
+ */
+- (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle animated:(BOOL)animate; // Allows for animation of dividerStyle changes. The property's regular setter is not animated.
+- (NSArray *)cornerViews;
+/*
+ -cornerViews returns an NSArray of two MGSplitCornersView objects, used to draw the inner corners.
+ The first view is the "leading" corners (top edge of screen for left/right split, left edge of screen for top/bottom split).
+ The second view is the "trailing" corners (bottom edge of screen for left/right split, right edge of screen for top/bottom split).
+ Do NOT modify them, except to:
+	1. Change their .cornerBackgroundColor
+	2. Change their .cornerRadius
+ */
+
+@end
+
+
+@protocol MGSplitViewControllerDelegate
+
+@optional
+
+// Called when a button should be added to a toolbar for a hidden view controller.
+- (void)splitViewController:(MGSplitViewController*)svc 
+	 willHideViewController:(UIViewController *)aViewController 
+		  withBarButtonItem:(UIBarButtonItem*)barButtonItem 
+	   forPopoverController: (UIPopoverController*)pc;
+
+// Called when the master view is shown again in the split view, invalidating the button and popover controller.
+- (void)splitViewController:(MGSplitViewController*)svc 
+	 willShowViewController:(UIViewController *)aViewController 
+  invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem;
+
+// Called when the master view is shown in a popover, so the delegate can take action like hiding other popovers.
+- (void)splitViewController:(MGSplitViewController*)svc 
+		  popoverController:(UIPopoverController*)pc 
+  willPresentViewController:(UIViewController *)aViewController;
+
+// Called when the split orientation will change (from vertical to horizontal, or vice versa).
+- (void)splitViewController:(MGSplitViewController*)svc willChangeSplitOrientationToVertical:(BOOL)isVertical;
+
+// Called when split position will change to the given pixel value (relative to left if split is vertical, or to top if horizontal).
+- (void)splitViewController:(MGSplitViewController*)svc willMoveSplitToPosition:(float)position;
+
+// Called before split position is changed to the given pixel value (relative to left if split is vertical, or to top if horizontal).
+// Note that viewSize is the current size of the entire split-view; i.e. the area enclosing the master, divider and detail views.
+- (float)splitViewController:(MGSplitViewController *)svc constrainSplitPosition:(float)proposedPosition splitViewSize:(CGSize)viewSize;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,1133 @@
+//
+//  MGSplitViewController.m
+//  MGSplitView
+//
+//  Created by Matt Gemmell on 26/07/2010.
+//  Copyright 2010 Instinctive Code.
+//
+
+#import "MGSplitViewController.h"
+#import "MGSplitDividerView.h"
+#import "MGSplitCornersView.h"
+
+#define MG_DEFAULT_SPLIT_POSITION		320.0	// default width of master view in UISplitViewController.
+#define MG_DEFAULT_SPLIT_WIDTH			1.0		// default width of split-gutter in UISplitViewController.
+#define MG_DEFAULT_CORNER_RADIUS		5.0		// default corner-radius of overlapping split-inner corners on the master and detail views.
+#define MG_DEFAULT_CORNER_COLOR			[UIColor blackColor]	// default color of intruding inner corners (and divider background).
+
+#define MG_PANESPLITTER_CORNER_RADIUS	0.0		// corner-radius of split-inner corners for MGSplitViewDividerStylePaneSplitter style.
+#define MG_PANESPLITTER_SPLIT_WIDTH		25.0	// width of split-gutter for MGSplitViewDividerStylePaneSplitter style.
+
+#define MG_MIN_VIEW_WIDTH				200.0	// minimum width a view is allowed to become as a result of changing the splitPosition.
+
+#define MG_ANIMATION_CHANGE_SPLIT_ORIENTATION	@"ChangeSplitOrientation"	// Animation ID for internal use.
+#define MG_ANIMATION_CHANGE_SUBVIEWS_ORDER		@"ChangeSubviewsOrder"	// Animation ID for internal use.
+
+
+@interface MGSplitViewController (MGPrivateMethods)
+
+- (void)setup;
+- (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation;
+- (void)layoutSubviews;
+- (void)layoutSubviewsWithAnimation:(BOOL)animate;
+- (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrientation withAnimation:(BOOL)animate;
+- (BOOL)shouldShowMasterForInterfaceOrientation:(UIInterfaceOrientation)theOrientation;
+- (BOOL)shouldShowMaster;
+- (NSString *)nameOfInterfaceOrientation:(UIInterfaceOrientation)theOrientation;
+- (void)reconfigureForMasterInPopover:(BOOL)inPopover;
+
+@end
+
+
+@implementation MGSplitViewController
+
+
+#pragma mark -
+#pragma mark Orientation helpers
+
+
+- (NSString *)nameOfInterfaceOrientation:(UIInterfaceOrientation)theOrientation
+{
+	NSString *orientationName = nil;
+	switch (theOrientation) {
+		case UIInterfaceOrientationPortrait:
+			orientationName = @"Portrait"; // Home button at bottom
+			break;
+		case UIInterfaceOrientationPortraitUpsideDown:
+			orientationName = @"Portrait (Upside Down)"; // Home button at top
+			break;
+		case UIInterfaceOrientationLandscapeLeft:
+			orientationName = @"Landscape (Left)"; // Home button on left
+			break;
+		case UIInterfaceOrientationLandscapeRight:
+			orientationName = @"Landscape (Right)"; // Home button on right
+			break;
+		default:
+			break;
+	}
+	
+	return orientationName;
+}
+
+
+- (BOOL)isLandscape
+{
+	return UIInterfaceOrientationIsLandscape(self.interfaceOrientation);
+}
+
+
+- (BOOL)shouldShowMasterForInterfaceOrientation:(UIInterfaceOrientation)theOrientation
+{
+	// Returns YES if master view should be shown directly embedded in the splitview, instead of hidden in a popover.
+	return ((UIInterfaceOrientationIsLandscape(theOrientation)) ? _showsMasterInLandscape : _showsMasterInPortrait);
+}
+
+
+- (BOOL)shouldShowMaster
+{
+	return [self shouldShowMasterForInterfaceOrientation:self.interfaceOrientation];
+}
+
+
+- (BOOL)isShowingMaster
+{
+	return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view);
+}
+
+
+#pragma mark -
+#pragma mark Setup and Teardown
+
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+	if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
+		[self setup];
+	}
+	
+	return self;
+}
+
+
+- (id)initWithCoder:(NSCoder *)aDecoder
+{
+	if ((self = [super initWithCoder:aDecoder])) {
+		[self setup];
+	}
+	
+	return self;
+}
+
+
+- (void)setup
+{
+	// Configure default behaviour.
+	_viewControllers = [[NSMutableArray alloc] initWithObjects:[NSNull null], [NSNull null], nil];
+	_splitWidth = MG_DEFAULT_SPLIT_WIDTH;
+	_showsMasterInPortrait = NO;
+	_showsMasterInLandscape = YES;
+	_reconfigurePopup = NO;
+	_vertical = YES;
+	_masterBeforeDetail = YES;
+	_splitPosition = MG_DEFAULT_SPLIT_POSITION;
+	CGRect divRect = self.view.bounds;
+	if ([self isVertical]) {
+		divRect.origin.y = _splitPosition;
+		divRect.size.height = _splitWidth;
+	} else {
+		divRect.origin.x = _splitPosition;
+		divRect.size.width = _splitWidth;
+	}
+	_dividerView = [[MGSplitDividerView alloc] initWithFrame:divRect];
+	_dividerView.splitViewController = self;
+	_dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR;
+	_dividerStyle = MGSplitViewDividerStyleThin;
+}
+
+
+- (void)dealloc
+{
+	_delegate = nil;
+	[self.view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
+	[_viewControllers release];
+	[_barButtonItem release];
+	[_hiddenPopoverController release];
+	[_dividerView release];
+	[_cornerViews release];
+	
+	[super dealloc];
+}
+
+
+#pragma mark -
+#pragma mark View management
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+    return YES;
+}
+
+
+- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
+{
+	[self.masterViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
+	[self.detailViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
+}
+
+
+- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
+{
+	[self.masterViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+	[self.detailViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+}
+
+
+- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
+										 duration:(NSTimeInterval)duration
+{
+	[self.masterViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+	[self.detailViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+	
+	// Hide popover.
+	if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+		[_hiddenPopoverController dismissPopoverAnimated:NO];
+	}
+	
+	// Re-tile views.
+	_reconfigurePopup = YES;
+	[self layoutSubviewsForInterfaceOrientation:toInterfaceOrientation withAnimation:YES];
+}
+
+
+- (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
+{
+	[self.masterViewController willAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+	[self.detailViewController willAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+}
+
+
+- (void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
+{
+	[self.masterViewController didAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation];
+	[self.detailViewController didAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation];
+}
+
+
+- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration
+{
+	[self.masterViewController willAnimateSecondHalfOfRotationFromInterfaceOrientation:fromInterfaceOrientation duration:duration];
+	[self.detailViewController willAnimateSecondHalfOfRotationFromInterfaceOrientation:fromInterfaceOrientation duration:duration];
+}
+
+
+- (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation
+{
+	UIScreen *screen = [UIScreen mainScreen];
+	CGRect fullScreenRect = screen.bounds; // always implicitly in Portrait orientation.
+	CGRect appFrame = screen.applicationFrame;
+	
+	// Find status bar height by checking which dimension of the applicationFrame is narrower than screen bounds.
+	// Little bit ugly looking, but it'll still work even if they change the status bar height in future.
+	float statusBarHeight = MAX((fullScreenRect.size.width - appFrame.size.width), (fullScreenRect.size.height - appFrame.size.height));
+	
+	// Initially assume portrait orientation.
+	float width = fullScreenRect.size.width;
+	float height = fullScreenRect.size.height;
+	
+	// Correct for orientation.
+	if (UIInterfaceOrientationIsLandscape(theOrientation)) {
+		width = height;
+		height = fullScreenRect.size.width;
+	}
+	
+	// Account for status bar, which always subtracts from the height (since it's always at the top of the screen).
+	height -= statusBarHeight;
+	
+	return CGSizeMake(width, height);
+}
+
+
+- (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrientation withAnimation:(BOOL)animate
+{
+	if (_reconfigurePopup) {
+		[self reconfigureForMasterInPopover:![self shouldShowMasterForInterfaceOrientation:theOrientation]];
+	}
+	
+	// Layout the master, detail and divider views appropriately, adding/removing subviews as needed.
+	// First obtain relevant geometry.
+	CGSize fullSize = [self splitViewSizeForOrientation:theOrientation];
+	float width = fullSize.width;
+	float height = fullSize.height;
+	
+	if (NO) { // Just for debugging.
+		NSLog(@"Target orientation is %@, dimensions will be %.0f x %.0f", 
+			  [self nameOfInterfaceOrientation:theOrientation], width, height);
+	}
+	
+	// Layout the master, divider and detail views.
+	CGRect newFrame = CGRectMake(0, 0, width, height);
+	UIViewController *controller;
+	UIView *theView;
+	BOOL shouldShowMaster = [self shouldShowMasterForInterfaceOrientation:theOrientation];
+	BOOL masterFirst = [self isMasterBeforeDetail];
+	if ([self isVertical]) {
+		// Master on left, detail on right (or vice versa).
+		CGRect masterRect, dividerRect, detailRect;
+		if (masterFirst) {
+			if (!shouldShowMaster) {
+				// Move off-screen.
+				newFrame.origin.x -= (_splitPosition + _splitWidth);
+			}
+			
+			newFrame.size.width = _splitPosition;
+			masterRect = newFrame;
+			
+			newFrame.origin.x += newFrame.size.width;
+			newFrame.size.width = _splitWidth;
+			dividerRect = newFrame;
+			
+			newFrame.origin.x += newFrame.size.width;
+			newFrame.size.width = width - newFrame.origin.x;
+			detailRect = newFrame;
+			
+		} else {
+			if (!shouldShowMaster) {
+				// Move off-screen.
+				newFrame.size.width += (_splitPosition + _splitWidth);
+			}
+			
+			newFrame.size.width -= (_splitPosition + _splitWidth);
+			detailRect = newFrame;
+			
+			newFrame.origin.x += newFrame.size.width;
+			newFrame.size.width = _splitWidth;
+			dividerRect = newFrame;
+			
+			newFrame.origin.x += newFrame.size.width;
+			newFrame.size.width = _splitPosition;
+			masterRect = newFrame;
+		}
+		
+		// Position master.
+		controller = self.masterViewController;
+		if (controller && [controller isKindOfClass:[UIViewController class]])  {
+			theView = controller.view;
+			if (theView) {
+				theView.frame = masterRect;
+				if (!theView.superview) {
+					[controller viewWillAppear:NO];
+					[self.view addSubview:theView];
+					[controller viewDidAppear:NO];
+				}
+			}
+		}
+		
+		// Position divider.
+		theView = _dividerView;
+		theView.frame = dividerRect;
+		if (!theView.superview) {
+			[self.view addSubview:theView];
+		}
+		
+		// Position detail.
+		controller = self.detailViewController;
+		if (controller && [controller isKindOfClass:[UIViewController class]])  {
+			theView = controller.view;
+			if (theView) {
+				theView.frame = detailRect;
+				if (!theView.superview) {
+					[self.view insertSubview:theView aboveSubview:self.masterViewController.view];
+				} else {
+					[self.view bringSubviewToFront:theView];
+				}
+			}
+		}
+		
+	} else {
+		// Master above, detail below (or vice versa).
+		CGRect masterRect, dividerRect, detailRect;
+		if (masterFirst) {
+			if (!shouldShowMaster) {
+				// Move off-screen.
+				newFrame.origin.y -= (_splitPosition + _splitWidth);
+			}
+			
+			newFrame.size.height = _splitPosition;
+			masterRect = newFrame;
+			
+			newFrame.origin.y += newFrame.size.height;
+			newFrame.size.height = _splitWidth;
+			dividerRect = newFrame;
+			
+			newFrame.origin.y += newFrame.size.height;
+			newFrame.size.height = height - newFrame.origin.y;
+			detailRect = newFrame;
+			
+		} else {
+			if (!shouldShowMaster) {
+				// Move off-screen.
+				newFrame.size.height += (_splitPosition + _splitWidth);
+			}
+			
+			newFrame.size.height -= (_splitPosition + _splitWidth);
+			detailRect = newFrame;
+			
+			newFrame.origin.y += newFrame.size.height;
+			newFrame.size.height = _splitWidth;
+			dividerRect = newFrame;
+			
+			newFrame.origin.y += newFrame.size.height;
+			newFrame.size.height = _splitPosition;
+			masterRect = newFrame;
+		}
+		
+		// Position master.
+		controller = self.masterViewController;
+		if (controller && [controller isKindOfClass:[UIViewController class]])  {
+			theView = controller.view;
+			if (theView) {
+				theView.frame = masterRect;
+				if (!theView.superview) {
+					[controller viewWillAppear:NO];
+					[self.view addSubview:theView];
+					[controller viewDidAppear:NO];
+				}
+			}
+		}
+		
+		// Position divider.
+		theView = _dividerView;
+		theView.frame = dividerRect;
+		if (!theView.superview) {
+			[self.view addSubview:theView];
+		}
+		
+		// Position detail.
+		controller = self.detailViewController;
+		if (controller && [controller isKindOfClass:[UIViewController class]])  {
+			theView = controller.view;
+			if (theView) {
+				theView.frame = detailRect;
+				if (!theView.superview) {
+					[self.view insertSubview:theView aboveSubview:self.masterViewController.view];
+				} else {
+					[self.view bringSubviewToFront:theView];
+				}
+			}
+		}
+	}
+	
+	// Create corner views if necessary.
+	MGSplitCornersView *leadingCorners; // top/left of screen in vertical/horizontal split.
+	MGSplitCornersView *trailingCorners; // bottom/right of screen in vertical/horizontal split.
+	if (!_cornerViews) {
+		CGRect cornerRect = CGRectMake(0, 0, 10, 10); // arbitrary, will be resized below.
+		leadingCorners = [[MGSplitCornersView alloc] initWithFrame:cornerRect];
+		leadingCorners.splitViewController = self;
+		leadingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR;
+		leadingCorners.cornerRadius = MG_DEFAULT_CORNER_RADIUS;
+		trailingCorners = [[MGSplitCornersView alloc] initWithFrame:cornerRect];
+		trailingCorners.splitViewController = self;
+		trailingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR;
+		trailingCorners.cornerRadius = MG_DEFAULT_CORNER_RADIUS;
+		_cornerViews = [[NSArray alloc] initWithObjects:leadingCorners, trailingCorners, nil];
+		[leadingCorners release];
+		[trailingCorners release];
+		
+	} else if ([_cornerViews count] == 2) {
+		leadingCorners = [_cornerViews objectAtIndex:0];
+		trailingCorners = [_cornerViews objectAtIndex:1];
+	}
+	
+	// Configure and layout the corner-views.
+	leadingCorners.cornersPosition = (_vertical) ? MGCornersPositionLeadingVertical : MGCornersPositionLeadingHorizontal;
+	trailingCorners.cornersPosition = (_vertical) ? MGCornersPositionTrailingVertical : MGCornersPositionTrailingHorizontal;
+	leadingCorners.autoresizingMask = (_vertical) ? UIViewAutoresizingFlexibleBottomMargin : UIViewAutoresizingFlexibleRightMargin;
+	trailingCorners.autoresizingMask = (_vertical) ? UIViewAutoresizingFlexibleTopMargin : UIViewAutoresizingFlexibleLeftMargin;
+	
+	float x, y, cornersWidth, cornersHeight;
+	CGRect leadingRect, trailingRect;
+	float radius = leadingCorners.cornerRadius;
+	if (_vertical) { // left/right split
+		cornersWidth = (radius * 2.0) + _splitWidth;
+		cornersHeight = radius;
+		x = ((shouldShowMaster) ? ((masterFirst) ? _splitPosition : width - (_splitPosition + _splitWidth)) : (0 - _splitWidth)) - radius;
+		y = 0;
+		leadingRect = CGRectMake(x, y, cornersWidth, cornersHeight); // top corners
+		trailingRect = CGRectMake(x, (height - cornersHeight), cornersWidth, cornersHeight); // bottom corners
+		
+	} else { // top/bottom split
+		x = 0;
+		y = ((shouldShowMaster) ? ((masterFirst) ? _splitPosition : height - (_splitPosition + _splitWidth)) : (0 - _splitWidth)) - radius;
+		cornersWidth = radius;
+		cornersHeight = (radius * 2.0) + _splitWidth;
+		leadingRect = CGRectMake(x, y, cornersWidth, cornersHeight); // left corners
+		trailingRect = CGRectMake((width - cornersWidth), y, cornersWidth, cornersHeight); // right corners
+	}
+	
+	leadingCorners.frame = leadingRect;
+	trailingCorners.frame = trailingRect;
+	
+	// Ensure corners are visible and frontmost.
+	if (!leadingCorners.superview) {
+		[self.view insertSubview:leadingCorners aboveSubview:self.detailViewController.view];
+		[self.view insertSubview:trailingCorners aboveSubview:self.detailViewController.view];
+	} else {
+		[self.view bringSubviewToFront:leadingCorners];
+		[self.view bringSubviewToFront:trailingCorners];
+	}
+}
+
+
+- (void)layoutSubviewsWithAnimation:(BOOL)animate
+{
+	[self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:animate];
+}
+
+
+- (void)layoutSubviews
+{
+	[self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:YES];
+}
+
+
+- (void)viewWillAppear:(BOOL)animated
+{
+	[super viewWillAppear:animated];
+	
+	if ([self isShowingMaster]) {
+		[self.masterViewController viewWillAppear:animated];
+	}
+	[self.detailViewController viewWillAppear:animated];
+	
+	_reconfigurePopup = YES;
+	[self layoutSubviews];
+}
+
+
+- (void)viewDidAppear:(BOOL)animated
+{
+	[super viewDidAppear:animated];
+	
+	if ([self isShowingMaster]) {
+		[self.masterViewController viewDidAppear:animated];
+	}
+	[self.detailViewController viewDidAppear:animated];
+}
+
+
+- (void)viewWillDisappear:(BOOL)animated
+{
+	[super viewWillDisappear:animated];
+	
+	if ([self isShowingMaster]) {
+		[self.masterViewController viewWillDisappear:animated];
+	}
+	[self.detailViewController viewWillDisappear:animated];
+}
+
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+	[super viewDidDisappear:animated];
+	
+	if ([self isShowingMaster]) {
+		[self.masterViewController viewDidDisappear:animated];
+	}
+	[self.detailViewController viewDidDisappear:animated];
+}
+
+
+#pragma mark -
+#pragma mark Popover handling
+
+
+- (void)reconfigureForMasterInPopover:(BOOL)inPopover
+{
+	_reconfigurePopup = NO;
+	
+	if ((inPopover && _hiddenPopoverController) || (!inPopover && !_hiddenPopoverController) || !self.masterViewController) {
+		// Nothing to do.
+		return;
+	}
+	
+	if (inPopover && !_hiddenPopoverController && !_barButtonItem) {
+		// Create and configure popover for our masterViewController.
+		[_hiddenPopoverController release];
+		_hiddenPopoverController = nil;
+		[self.masterViewController viewWillDisappear:NO];
+		_hiddenPopoverController = [[UIPopoverController alloc] initWithContentViewController:self.masterViewController];
+		[self.masterViewController viewDidDisappear:NO];
+		
+		// Create and configure _barButtonItem.
+		_barButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Master", nil) 
+														  style:UIBarButtonItemStyleBordered 
+														 target:self 
+														 action:@selector(showMasterPopover:)];
+		
+		// Inform delegate of this state of affairs.
+		if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willHideViewController:withBarButtonItem:forPopoverController:)]) {
+			[(NSObject <MGSplitViewControllerDelegate> *)_delegate splitViewController:self 
+																willHideViewController:self.masterViewController 
+																	 withBarButtonItem:_barButtonItem 
+																  forPopoverController:_hiddenPopoverController];
+		}
+		
+	} else if (!inPopover && _hiddenPopoverController && _barButtonItem) {
+		// I know this looks strange, but it fixes a bizarre issue with UIPopoverController leaving masterViewController's views in disarray.
+		[_hiddenPopoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
+		
+		// Remove master from popover and destroy popover, if it exists.
+		[_hiddenPopoverController dismissPopoverAnimated:NO];
+		[_hiddenPopoverController release];
+		_hiddenPopoverController = nil;
+		
+		// Inform delegate that the _barButtonItem will become invalid.
+		if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willShowViewController:invalidatingBarButtonItem:)]) {
+			[(NSObject <MGSplitViewControllerDelegate> *)_delegate splitViewController:self 
+																willShowViewController:self.masterViewController 
+															 invalidatingBarButtonItem:_barButtonItem];
+		}
+		
+		// Destroy _barButtonItem.
+		[_barButtonItem release];
+		_barButtonItem = nil;
+		
+		// Move master view.
+		UIView *masterView = self.masterViewController.view;
+		if (masterView && masterView.superview != self.view) {
+			[masterView removeFromSuperview];
+		}
+	}
+}
+
+
+- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController
+{
+	[self reconfigureForMasterInPopover:NO];
+}
+
+
+- (void)notePopoverDismissed
+{
+	[self popoverControllerDidDismissPopover:_hiddenPopoverController];
+}
+
+
+#pragma mark -
+#pragma mark Animations
+
+
+- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
+{
+	if (([animationID isEqualToString:MG_ANIMATION_CHANGE_SPLIT_ORIENTATION] || 
+		 [animationID isEqualToString:MG_ANIMATION_CHANGE_SUBVIEWS_ORDER])
+		&& _cornerViews) {
+		for (UIView *corner in _cornerViews) {
+			corner.hidden = NO;
+		}
+		_dividerView.hidden = NO;
+	}
+}
+
+
+#pragma mark -
+#pragma mark IB Actions
+
+
+- (IBAction)toggleSplitOrientation:(id)sender
+{
+	BOOL showingMaster = [self isShowingMaster];
+	if (showingMaster) {
+		if (_cornerViews) {
+			for (UIView *corner in _cornerViews) {
+				corner.hidden = YES;
+			}
+			_dividerView.hidden = YES;
+		}
+		[UIView beginAnimations:MG_ANIMATION_CHANGE_SPLIT_ORIENTATION context:nil];
+		[UIView setAnimationDelegate:self];
+		[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
+	}
+	self.vertical = (!self.vertical);
+	if (showingMaster) {
+		[UIView commitAnimations];
+	}
+}
+
+
+- (IBAction)toggleMasterBeforeDetail:(id)sender
+{
+	BOOL showingMaster = [self isShowingMaster];
+	if (showingMaster) {
+		if (_cornerViews) {
+			for (UIView *corner in _cornerViews) {
+				corner.hidden = YES;
+			}
+			_dividerView.hidden = YES;
+		}
+		[UIView beginAnimations:MG_ANIMATION_CHANGE_SUBVIEWS_ORDER context:nil];
+		[UIView setAnimationDelegate:self];
+		[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
+	}
+	self.masterBeforeDetail = (!self.masterBeforeDetail);
+	if (showingMaster) {
+		[UIView commitAnimations];
+	}
+}
+
+
+- (IBAction)toggleMasterView:(id)sender
+{
+	if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+		[_hiddenPopoverController dismissPopoverAnimated:NO];
+	}
+	
+	if (![self isShowingMaster]) {
+		// We're about to show the master view. Ensure it's in place off-screen to be animated in.
+		_reconfigurePopup = YES;
+		[self reconfigureForMasterInPopover:NO];
+		[self layoutSubviews];
+	}
+	
+	// This action functions on the current primary orientation; it is independent of the other primary orientation.
+	[UIView beginAnimations:@"toggleMaster" context:nil];
+	if (self.isLandscape) {
+		self.showsMasterInLandscape = !_showsMasterInLandscape;
+	} else {
+		self.showsMasterInPortrait = !_showsMasterInPortrait;
+	}
+	[UIView commitAnimations];
+}
+
+
+- (IBAction)showMasterPopover:(id) sender
+{
+	if (_hiddenPopoverController && !(_hiddenPopoverController.popoverVisible)) {
+		// Inform delegate.
+		if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:popoverController:willPresentViewController:)]) {
+			[(NSObject <MGSplitViewControllerDelegate> *)_delegate splitViewController:self 
+																	 popoverController:_hiddenPopoverController 
+															 willPresentViewController:self.masterViewController];
+		}
+		
+		// Show popover.
+		[_hiddenPopoverController presentPopoverFromBarButtonItem:_barButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
+	}
+}
+
+
+#pragma mark -
+#pragma mark Accessors and properties
+
+
+- (id)delegate
+{
+	return _delegate;
+}
+
+
+- (void)setDelegate:(id <MGSplitViewControllerDelegate>)newDelegate
+{
+	if (newDelegate != _delegate && 
+		(!newDelegate || [(NSObject *)newDelegate conformsToProtocol:@protocol(MGSplitViewControllerDelegate)])) {
+		_delegate = newDelegate;
+	}
+}
+
+
+- (BOOL)showsMasterInPortrait
+{
+	return _showsMasterInPortrait;
+}
+
+
+- (void)setShowsMasterInPortrait:(BOOL)flag
+{
+	if (flag != _showsMasterInPortrait) {
+		_showsMasterInPortrait = flag;
+		
+		if (![self isLandscape]) { // i.e. if this will cause a visual change.
+			if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+				[_hiddenPopoverController dismissPopoverAnimated:NO];
+			}
+			
+			// Rearrange views.
+			_reconfigurePopup = YES;
+			[self layoutSubviews];
+		}
+	}
+}
+
+
+- (BOOL)showsMasterInLandscape
+{
+	return _showsMasterInLandscape;
+}
+
+
+- (void)setShowsMasterInLandscape:(BOOL)flag
+{
+	if (flag != _showsMasterInLandscape) {
+		_showsMasterInLandscape = flag;
+		
+		if ([self isLandscape]) { // i.e. if this will cause a visual change.
+			if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+				[_hiddenPopoverController dismissPopoverAnimated:NO];
+			}
+			
+			// Rearrange views.
+			_reconfigurePopup = YES;
+			[self layoutSubviews];
+		}
+	}
+}
+
+
+- (BOOL)isVertical
+{
+	return _vertical;
+}
+
+
+- (void)setVertical:(BOOL)flag
+{
+	if (flag != _vertical) {
+		if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+			[_hiddenPopoverController dismissPopoverAnimated:NO];
+		}
+		
+		_vertical = flag;
+		
+		// Inform delegate.
+		if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willChangeSplitOrientationToVertical:)]) {
+			[_delegate splitViewController:self willChangeSplitOrientationToVertical:_vertical];
+		}
+		
+		[self layoutSubviews];
+	}
+}
+
+
+- (BOOL)isMasterBeforeDetail
+{
+	return _masterBeforeDetail;
+}
+
+
+- (void)setMasterBeforeDetail:(BOOL)flag
+{
+	if (flag != _masterBeforeDetail) {
+		if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+			[_hiddenPopoverController dismissPopoverAnimated:NO];
+		}
+		
+		_masterBeforeDetail = flag;
+		
+		if ([self isShowingMaster]) {
+			[self layoutSubviews];
+		}
+	}
+}
+
+
+- (float)splitPosition
+{
+	return _splitPosition;
+}
+
+
+- (void)setSplitPosition:(float)posn
+{
+	// Check to see if delegate wishes to constrain the position.
+	float newPosn = posn;
+	BOOL constrained = NO;
+	CGSize fullSize = [self splitViewSizeForOrientation:self.interfaceOrientation];
+	if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:constrainSplitPosition:splitViewSize:)]) {
+		newPosn = [_delegate splitViewController:self constrainSplitPosition:newPosn splitViewSize:fullSize];
+		constrained = YES; // implicitly trust delegate's response.
+		
+	} else {
+		// Apply default constraints if delegate doesn't wish to participate.
+		float minPos = MG_MIN_VIEW_WIDTH;
+		float maxPos = ((_vertical) ? fullSize.width : fullSize.height) - (MG_MIN_VIEW_WIDTH + _splitWidth);
+		constrained = (newPosn != _splitPosition && newPosn >= minPos && newPosn <= maxPos);
+	}
+	
+	if (constrained) {
+		if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+			[_hiddenPopoverController dismissPopoverAnimated:NO];
+		}
+		
+		_splitPosition = newPosn;
+		
+		// Inform delegate.
+		if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willMoveSplitToPosition:)]) {
+			[_delegate splitViewController:self willMoveSplitToPosition:_splitPosition];
+		}
+		
+		if ([self isShowingMaster]) {
+			[self layoutSubviews];
+		}
+	}
+}
+
+
+- (void)setSplitPosition:(float)posn animated:(BOOL)animate
+{
+	BOOL shouldAnimate = (animate && [self isShowingMaster]);
+	if (shouldAnimate) {
+		[UIView beginAnimations:@"SplitPosition" context:nil];
+	}
+	[self setSplitPosition:posn];
+	if (shouldAnimate) {
+		[UIView commitAnimations];
+	}
+}
+
+
+- (float)splitWidth
+{
+	return _splitWidth;
+}
+
+
+- (void)setSplitWidth:(float)width
+{
+	if (width != _splitWidth && width >= 0) {
+		_splitWidth = width;
+		if ([self isShowingMaster]) {
+			[self layoutSubviews];
+		}
+	}
+}
+
+
+- (NSArray *)viewControllers
+{
+	return [[_viewControllers copy] autorelease];
+}
+
+
+- (void)setViewControllers:(NSArray *)controllers
+{
+	if (controllers != _viewControllers) {
+		for (UIViewController *controller in _viewControllers) {
+			if ([controller isKindOfClass:[UIViewController class]]) {
+				[controller.view removeFromSuperview];
+			}
+		}
+		[_viewControllers release];
+		_viewControllers = [[NSMutableArray alloc] initWithCapacity:2];
+		if (controllers && [controllers count] >= 2) {
+			self.masterViewController = [controllers objectAtIndex:0];
+			self.detailViewController = [controllers objectAtIndex:1];
+		} else {
+			NSLog(@"Error: %@ requires 2 view-controllers. (%@)", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
+		}
+		
+		[self layoutSubviews];
+	}
+}
+
+
+- (UIViewController *)masterViewController
+{
+	if (_viewControllers && [_viewControllers count] > 0) {
+		NSObject *controller = [_viewControllers objectAtIndex:0];
+		if ([controller isKindOfClass:[UIViewController class]]) {
+			return [[controller retain] autorelease];
+		}
+	}
+	
+	return nil;
+}
+
+
+- (void)setMasterViewController:(UIViewController *)master
+{
+	if (!_viewControllers) {
+		_viewControllers = [[NSMutableArray alloc] initWithCapacity:2];
+	}
+	
+	NSObject *newMaster = master;
+	if (!newMaster) {
+		newMaster = [NSNull null];
+	}
+	
+	BOOL changed = YES;
+	if ([_viewControllers count] > 0) {
+		if ([_viewControllers objectAtIndex:0] == newMaster) {
+			changed = NO;
+		} else {
+			[_viewControllers replaceObjectAtIndex:0 withObject:newMaster];
+		}
+		
+	} else {
+		[_viewControllers addObject:newMaster];
+	}
+	
+	if (changed) {
+		[self layoutSubviews];
+	}
+}
+
+
+- (UIViewController *)detailViewController
+{
+	if (_viewControllers && [_viewControllers count] > 1) {
+		NSObject *controller = [_viewControllers objectAtIndex:1];
+		if ([controller isKindOfClass:[UIViewController class]]) {
+			return [[controller retain] autorelease];
+		}
+	}
+	
+	return nil;
+}
+
+
+- (void)setDetailViewController:(UIViewController *)detail
+{
+	if (!_viewControllers) {
+		_viewControllers = [[NSMutableArray alloc] initWithCapacity:2];
+		[_viewControllers addObject:[NSNull null]];
+	}
+	
+	BOOL changed = YES;
+	if ([_viewControllers count] > 1) {
+		if ([_viewControllers objectAtIndex:1] == detail) {
+			changed = NO;
+		} else {
+			[_viewControllers replaceObjectAtIndex:1 withObject:detail];
+		}
+		
+	} else {
+		[_viewControllers addObject:detail];
+	}
+	
+	if (changed) {
+		[self layoutSubviews];
+	}
+}
+
+
+- (MGSplitDividerView *)dividerView
+{
+	return [[_dividerView retain] autorelease];
+}
+
+
+- (void)setDividerView:(MGSplitDividerView *)divider
+{
+	if (divider != _dividerView) {
+		[_dividerView removeFromSuperview];
+		[_dividerView release];
+		_dividerView = [divider retain];
+		_dividerView.splitViewController = self;
+		_dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR;
+		if ([self isShowingMaster]) {
+			[self layoutSubviews];
+		}
+	}
+}
+
+
+- (BOOL)allowsDraggingDivider
+{
+	if (_dividerView) {
+		return _dividerView.allowsDragging;
+	}
+	
+	return NO;
+}
+
+
+- (void)setAllowsDraggingDivider:(BOOL)flag
+{
+	if (self.allowsDraggingDivider != flag && _dividerView) {
+		_dividerView.allowsDragging = flag;
+	}
+}
+
+
+- (MGSplitViewDividerStyle)dividerStyle
+{
+	return _dividerStyle;
+}
+
+
+- (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle
+{
+	if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
+		[_hiddenPopoverController dismissPopoverAnimated:NO];
+	}
+	
+	// We don't check to see if newStyle equals _dividerStyle, because it's a meta-setting.
+	// Aspects could have been changed since it was set.
+	_dividerStyle = newStyle;
+	
+	// Reconfigure general appearance and behaviour.
+	float cornerRadius;
+	if (_dividerStyle == MGSplitViewDividerStyleThin) {
+		cornerRadius = MG_DEFAULT_CORNER_RADIUS;
+		_splitWidth = MG_DEFAULT_SPLIT_WIDTH;
+		self.allowsDraggingDivider = NO;
+		
+	} else if (_dividerStyle == MGSplitViewDividerStylePaneSplitter) {
+		cornerRadius = MG_PANESPLITTER_CORNER_RADIUS;
+		_splitWidth = MG_PANESPLITTER_SPLIT_WIDTH;
+		self.allowsDraggingDivider = YES;
+	}
+	
+	// Update divider and corners.
+	[_dividerView setNeedsDisplay];
+	if (_cornerViews) {
+		for (MGSplitCornersView *corner in _cornerViews) {
+			corner.cornerRadius = cornerRadius;
+		}
+	}
+	
+	// Layout all views.
+	[self layoutSubviews];
+}
+
+
+- (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle animated:(BOOL)animate
+{
+	BOOL shouldAnimate = (animate && [self isShowingMaster]);
+	if (shouldAnimate) {
+		[UIView beginAnimations:@"DividerStyle" context:nil];
+	}
+	[self setDividerStyle:newStyle];
+	if (shouldAnimate) {
+		[UIView commitAnimations];
+	}
+}
+
+
+- (NSArray *)cornerViews
+{
+	if (_cornerViews) {
+		return [[_cornerViews retain] autorelease];
+	}
+	
+	return nil;
+}
+
+
+@synthesize showsMasterInPortrait;
+@synthesize showsMasterInLandscape;
+@synthesize vertical;
+@synthesize delegate;
+@synthesize viewControllers;
+@synthesize masterViewController;
+@synthesize detailViewController;
+@synthesize dividerView;
+@synthesize splitPosition;
+@synthesize splitWidth;
+@synthesize allowsDraggingDivider;
+@synthesize dividerStyle;
+
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MNEValueTrackingSlider.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,22 @@
+//
+// MNEValueTrackingSlider
+//
+// Copyright 2012 Michael Neuwert
+// "You can use the code in your own project and modify it as you like."
+// http://blog.neuwert-media.com/2012/04/customized-uislider-with-visual-value-tracking/
+//
+
+
+#import <Foundation/Foundation.h>
+
+@class SliderValuePopupView;
+
+@interface MNEValueTrackingSlider : UISlider {
+    SliderValuePopupView *valuePopupView;
+    NSString *textValue;
+}
+
+@property (nonatomic, readonly) CGRect thumbRect;
+@property (nonatomic, retain) NSString *textValue;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MNEValueTrackingSlider.m	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,200 @@
+//
+// MNEValueTrackingSlider
+//
+// Copyright 2012 Michael Neuwert
+// "You can use the code in your own project and modify it as you like."
+// http://blog.neuwert-media.com/2012/04/customized-uislider-with-visual-value-tracking/
+//
+
+
+#import "MNEValueTrackingSlider.h"
+
+#pragma mark -
+#pragma mark Private UIView subclass rendering the popup showing slider value
+@interface SliderValuePopupView : UIView
+@property (nonatomic, retain) UIFont *font;
+@property (nonatomic, copy) NSString *text;
+@property (nonatomic) float arrowOffset;
+@end
+
+@implementation SliderValuePopupView
+
+@synthesize font = _font;
+@synthesize text = _text;
+@synthesize arrowOffset = _arrowOffset;
+
+-(id) initWithFrame:(CGRect) frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        self.font = [UIFont boldSystemFontOfSize:18];
+    }
+    return self;
+}
+
+-(void) dealloc {
+    self.text = nil;
+    self.font = nil;
+    [super dealloc];
+}
+
+-(void) drawRect:(CGRect) rect {
+    // Create the path for the rounded rectangle
+    CGRect roundedRect = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, floorf(self.bounds.size.height * 0.8));
+    UIBezierPath *roundedRectPath = [UIBezierPath bezierPathWithRoundedRect:roundedRect cornerRadius:6.0];
+    roundedRectPath.lineWidth = 2.0f;
+
+    // Create the arrow path
+    UIBezierPath *arrowPath = [UIBezierPath bezierPath];
+    /*
+    // Make sure the arrow offset is nice
+    if (-self.arrowOffset + 1 > CGRectGetMidX(self.bounds) / 2)
+        self.arrowOffset = -CGRectGetMidX(self.bounds) / 2 + 1;
+    if (self.arrowOffset > CGRectGetMidX(self.bounds) / 2)
+        self.arrowOffset = CGRectGetMidX(self.bounds) / 2 -1;
+     */
+
+    CGFloat midX = CGRectGetMidX(self.bounds) + self.arrowOffset;
+    CGPoint p0 = CGPointMake(midX, CGRectGetMaxY(self.bounds));
+    [arrowPath moveToPoint:p0];
+    [arrowPath addLineToPoint:CGPointMake((midX - 10.0), CGRectGetMaxY(roundedRect))];
+    [arrowPath addLineToPoint:CGPointMake((midX + 10.0), CGRectGetMaxY(roundedRect))];
+    [arrowPath closePath];
+
+    // Attach the arrow path to the rounded rect
+    [roundedRectPath appendPath:arrowPath];
+
+    // Color various sections
+    [[UIColor blackColor] setFill];
+    [roundedRectPath fill];
+    [[UIColor whiteColor] setStroke];
+    [roundedRectPath stroke];
+    [[UIColor whiteColor] setFill];
+    [arrowPath fill];
+
+    // Draw the text
+    if (self.text) {
+        [[UIColor lightYellowColor] set];
+        CGSize s = [_text sizeWithFont:self.font];
+        CGFloat yOffset = (roundedRect.size.height - s.height) / 2;
+        CGRect textRect = CGRectMake(roundedRect.origin.x, yOffset, roundedRect.size.width, s.height);
+
+        [_text drawInRect:textRect
+                 withFont:self.font
+            lineBreakMode:UILineBreakModeWordWrap
+                alignment:UITextAlignmentCenter];
+    }
+}
+
+@end
+
+#pragma mark -
+#pragma mark MNEValueTrackingSlider implementations
+@implementation MNEValueTrackingSlider
+
+@synthesize thumbRect, textValue;
+
+#pragma mark Private methods
+
+-(void) _constructSlider {
+    valuePopupView = [[SliderValuePopupView alloc] initWithFrame:CGRectZero];
+    valuePopupView.backgroundColor = [UIColor clearColor];
+    valuePopupView.alpha = 0.0;
+    [self addSubview:valuePopupView];
+}
+
+-(void) _fadePopupViewInAndOut:(BOOL)aFadeIn {
+    [UIView beginAnimations:nil context:NULL];
+    [UIView setAnimationDuration:0.25];
+    if (aFadeIn) {
+        valuePopupView.alpha = 1.0;
+    } else {
+        valuePopupView.alpha = 0.0;
+    }
+    [UIView commitAnimations];
+}
+
+-(void) _positionAndUpdatePopupView {
+    CGRect _thumbRect = self.thumbRect;
+    CGRect popupRect = CGRectOffset(_thumbRect, 0, -floorf(_thumbRect.size.height * 1.5));
+    // (-100, -15) determines the size of the the rect
+    popupRect = CGRectInset(popupRect, -100, -15);
+
+    // this prevents drawing the popup outside the slider view
+    if (popupRect.origin.x < -self.frame.origin.x+5)
+        popupRect.origin.x = -self.frame.origin.x+5;
+    else if (popupRect.origin.x > self.superview.frame.size.width - popupRect.size.width - self.frame.origin.x - 5)
+        popupRect.origin.x = self.superview.frame.size.width - popupRect.size.width - self.frame.origin.x - 5;
+    //else if (CGRectGetMaxX(popupRect) > CGRectGetMaxX(self.superview.bounds))
+    //    popupRect.origin.x = CGRectGetMaxX(self.superview.bounds) - CGRectGetWidth(popupRect) - 1.0;
+
+    valuePopupView.arrowOffset = CGRectGetMidX(_thumbRect) - CGRectGetMidX(popupRect);
+
+    valuePopupView.frame = popupRect;
+    valuePopupView.text = self.textValue;
+    [valuePopupView setNeedsDisplay];
+}
+
+#pragma mark Memory management
+
+-(id) initWithFrame:(CGRect) frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self _constructSlider];
+    }
+    return self;
+}
+
+-(id) initWithCoder:(NSCoder *)aDecoder {
+    self = [super initWithCoder:aDecoder];
+    if (self) {
+        [self _constructSlider];
+    }
+    return self;
+}
+
+-(void) dealloc {
+    [valuePopupView release];
+    [textValue release];
+    [super dealloc];
+}
+
+#pragma mark -
+#pragma mark UIControl touch event tracking
+-(BOOL) beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event {
+    // Fade in and update the popup view
+    CGPoint touchPoint = [touch locationInView:self];
+    // Check if the knob is touched. Only in this case show the popup-view
+    if(CGRectContainsPoint(CGRectInset(self.thumbRect, -14.0, -12.0), touchPoint)) {
+        [self _positionAndUpdatePopupView];
+        [self _fadePopupViewInAndOut:YES];
+    }
+    return [super beginTrackingWithTouch:touch withEvent:event];
+}
+
+-(BOOL) continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event {
+    // Update the popup view as slider knob is being moved
+    [self _positionAndUpdatePopupView];
+    return [super continueTrackingWithTouch:touch withEvent:event];
+}
+
+-(void) cancelTrackingWithEvent:(UIEvent *)event {
+    [super cancelTrackingWithEvent:event];
+}
+
+-(void) endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event {
+    // Fade out the popoup view
+    [self _fadePopupViewInAndOut:NO];
+    [super endTrackingWithTouch:touch withEvent:event];
+}
+
+#pragma mark -
+#pragma mark Custom property accessors
+-(CGRect) thumbRect {
+    CGRect trackRect = [self trackRectForBounds:self.bounds];
+    CGRect thumbR = [self thumbRectForBounds:self.bounds
+                                         trackRect:trackRect
+                                             value:self.value];
+    return thumbR;
+}
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MXAudioPlayerFadeOperation.h	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,55 @@
+//  MXAudioPlayerFadeOperation.h
+//
+//  Created by Andrew Mackenzie-Ross on 30/11/10.
+//  mackross.net
+//
+
+#import <Foundation/Foundation.h>
+
+@class AVAudioPlayer;
+@interface MXAudioPlayerFadeOperation : NSOperation {
+  AVAudioPlayer *_audioPlayer;
+  NSTimeInterval _fadeDuration;
+  NSTimeInterval _delay;
+  float _finishVolume;
+  BOOL _pauseAfterFade;
+  BOOL _stopAfterFade;
+  BOOL _playBeforeFade;
+}
+
+// The AVAudioPlayer that the volume fade will be applied to. 
+// Retained until the fade is completed.
+// Must be set with init method.
+@property (nonatomic, retain, readonly) AVAudioPlayer *audioPlayer; 
+
+// The duration of the volume fade. 
+// Default value is 1.0
+@property (nonatomic, assign) NSTimeInterval fadeDuration; 
+
+// The delay before the volume fade begins. 
+// Default value is 0.0
+@property (nonatomic, assign) NSTimeInterval delay; 
+
+// The volume that will be faded to. 
+// Default value is 0.0
+@property (nonatomic, assign) float finishVolume; 
+
+// If YES, audio player will be sent a pause message when the fade has completed. 
+// Default value is NO, however, if finishVolume is 0.0, default is YES
+@property (nonatomic, assign) BOOL pauseAfterFade; 
+
+// If YES, when the fade has completed the audio player will be sent a stop message.
+// Default value is NO.
+@property (nonatomic, assign) BOOL stopAfterFade;
+
+// If YES, audio player will be sent a play message after the delay.
+// Default value is YES.
+@property (nonatomic, assign) BOOL playBeforeFade;
+
+// Init Methods
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player toVolume:(float)volume overDuration:(NSTimeInterval)duration withDelay:(NSTimeInterval)timeDelay;
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player toVolume:(float)volume overDuration:(NSTimeInterval)duration;
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player toVolume:(float)volume;
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MXAudioPlayerFadeOperation.m	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,133 @@
+//  MXAudioPlayerFadeOperation.m
+//
+//  Created by Andrew Mackenzie-Ross on 30/11/10.
+//  mackross.net.
+//
+
+#import "MXAudioPlayerFadeOperation.h"
+#import <AVFoundation/AVFoundation.h>
+
+#define SKVolumeChangesPerSecond 15
+
+@interface MXAudioPlayerFadeOperation ()
+@property (nonatomic, retain, readwrite) AVAudioPlayer *audioPlayer; 
+- (void)beginFadeOperation;
+- (void)finishFadeOperation;
+@end
+
+@implementation MXAudioPlayerFadeOperation
+#pragma mark -
+#pragma mark Properties
+@synthesize audioPlayer = _audioPlayer;
+@synthesize fadeDuration = _fadeDuration;
+@synthesize finishVolume = _finishVolume;
+@synthesize playBeforeFade = _playBeforeFade;
+@synthesize pauseAfterFade = _pauseAfterFade;
+@synthesize stopAfterFade = _stopAfterFade;
+@synthesize delay = _delay;
+
+#pragma mark -
+#pragma mark Accessors
+- (AVAudioPlayer *)audioPlayer {
+  AVAudioPlayer *result;
+  @synchronized(self) {
+    result = [_audioPlayer retain];
+  }
+  return [result autorelease];
+}
+
+- (void)setAudioPlayer:(AVAudioPlayer *)anAudioPlayer {
+  @synchronized(self) {
+    if (_audioPlayer != anAudioPlayer) {
+      [_audioPlayer release];
+      _audioPlayer = [anAudioPlayer retain];
+    }
+  }
+}
+
+#pragma mark -
+#pragma mark NSOperation
+-(id) initFadeWithAudioPlayer:(AVAudioPlayer*)player toVolume:(float)volume overDuration:(NSTimeInterval)duration withDelay:(NSTimeInterval)timeDelay {
+  if ((self = [super init])) {
+    self.audioPlayer = player;
+    [player prepareToPlay];
+    _fadeDuration = duration;
+    _finishVolume = volume;
+    _playBeforeFade = YES;
+    _stopAfterFade = NO;
+    _pauseAfterFade = (volume == 0.0) ? YES : NO;
+    _delay = timeDelay;
+  }
+  return self;
+}
+
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player toVolume:(float)volume overDuration:(NSTimeInterval)duration {
+  return [self initFadeWithAudioPlayer:player toVolume:volume overDuration:duration withDelay:0.0];
+}
+
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player toVolume:(float)volume {
+  return [self initFadeWithAudioPlayer:player toVolume:volume overDuration:1.0];
+}
+
+- (id)initFadeWithAudioPlayer:(AVAudioPlayer*)player {
+  return [self initFadeWithAudioPlayer:player toVolume:0.0];
+}
+
+- (id) init {
+  ALog(@"Failed to init class (%@) with AVAudioPlayer instance, use initFadeWithAudioPlayer:",[self class]);
+  return nil;
+}
+
+- (void)main {
+  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+  [NSThread sleepForTimeInterval:_delay];
+  if ([self.audioPlayer isKindOfClass:[AVAudioPlayer class]]) {
+    [self beginFadeOperation];
+  }
+  else {
+    ALog(@"AudioPlayerFadeOperation began with invalid AVAudioPlayer");
+  }
+  
+  [pool release];
+}
+
+- (void)beginFadeOperation {
+  if (![self.audioPlayer isPlaying] && _playBeforeFade) [self.audioPlayer play];
+  
+  if (_fadeDuration != 0.0) {
+    
+    NSTimeInterval sleepInterval = (1.0 / SKVolumeChangesPerSecond);
+    NSTimeInterval startTime = [[NSDate date] timeIntervalSinceReferenceDate];
+    NSTimeInterval now = startTime;
+    
+    float startVolume = [self.audioPlayer volume];
+    
+    while (now < (startTime + _fadeDuration)) {
+      float ratioOfFadeCompleted = (now - startTime)/_fadeDuration;
+      float volume = (_finishVolume * ratioOfFadeCompleted) + (startVolume * (1-ratioOfFadeCompleted));
+      [self.audioPlayer setVolume:volume];
+      [NSThread sleepForTimeInterval:sleepInterval];
+      now = [[NSDate date] timeIntervalSinceReferenceDate];
+    }
+    
+    [self.audioPlayer setVolume:_finishVolume];
+    [self finishFadeOperation];
+  }
+  else {
+    [self.audioPlayer setVolume:_finishVolume];
+    [self finishFadeOperation];
+  }
+}
+
+- (void)finishFadeOperation {
+  if ([self.audioPlayer isPlaying] && _pauseAfterFade) [self.audioPlayer pause];
+  if ([self.audioPlayer isPlaying] && _stopAfterFade) [self.audioPlayer stop];
+}
+
+- (void)dealloc {
+  releaseAndNil(_audioPlayer);
+  [super dealloc];
+}
+
+@end
+
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -39,7 +39,7 @@
 			</object>
 			<object class="IBUIView" id="191373211">
 				<reference key="NSNextResponder"/>
-				<int key="NSvFlags">292</int>
+				<int key="NSvFlags">294</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<object class="IBUIImageView" id="976741091">
@@ -56,8 +56,8 @@
 					</object>
 					<object class="IBUIButton" id="867308721">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{383, 389}, {263, 244}}</string>
+						<int key="NSvFlags">301</int>
+						<string key="NSFrame">{{383, 389}, {271, 244}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -91,10 +91,11 @@
 					</object>
 					<object class="IBUIButton" id="95106947">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{795, 317}, {18, 19}}</string>
+						<int key="NSvFlags">289</int>
+						<string key="NSFrame">{{986, 19}, {18, 19}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
 						<float key="IBUIAlpha">0.31690141558647156</float>
 						<int key="IBUITag">3</int>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -112,7 +113,7 @@
 					</object>
 					<object class="IBUIButton" id="898948205">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">265</int>
 						<string key="NSFrame">{{940, 686}, {64, 64}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -134,7 +135,7 @@
 					</object>
 					<object class="IBUIButton" id="894101036">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">268</int>
 						<string key="NSFrame">{{20, 686}, {64, 64}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -156,7 +157,7 @@
 					</object>
 					<object class="IBUIImageView" id="1019880682">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{242, 43}, {540, 300}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -168,8 +169,8 @@
 					</object>
 					<object class="IBUIButton" id="357438048">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{468, 686}, {89, 37}}</string>
+						<int key="NSvFlags">269</int>
+						<string key="NSFrame">{{565, 686}, {89, 37}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<int key="IBUITag">5</int>
@@ -186,6 +187,26 @@
 						</object>
 						<reference key="IBUINormalTitleShadowColor" ref="112471976"/>
 					</object>
+					<object class="IBUIButton" id="719094980">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">269</int>
+						<string key="NSFrame">{{383, 686}, {89, 37}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIOpaque">NO</bool>
+						<int key="IBUITag">6</int>
+						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+						<int key="IBUIContentHorizontalAlignment">0</int>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<reference key="IBUIFont" ref="917635782"/>
+						<int key="IBUIButtonType">1</int>
+						<string key="IBUINormalTitle">Simple</string>
+						<reference key="IBUIHighlightedTitleColor" ref="918890028"/>
+						<object class="NSColor" key="IBUINormalTitleColor">
+							<int key="NSColorSpace">1</int>
+							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+						</object>
+						<reference key="IBUINormalTitleShadowColor" ref="112471976"/>
+					</object>
 				</object>
 				<string key="NSFrameSize">{1024, 768}</string>
 				<reference key="NSSuperview"/>
@@ -255,6 +276,15 @@
 					</object>
 					<int key="connectionID">92</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchEventConnection" key="connection">
+						<string key="label">switchViews:</string>
+						<reference key="source" ref="719094980"/>
+						<reference key="destination" ref="372490531"/>
+						<int key="IBEventType">7</int>
+					</object>
+					<int key="connectionID">94</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -272,11 +302,12 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="976741091"/>
 							<reference ref="867308721"/>
-							<reference ref="95106947"/>
 							<reference ref="898948205"/>
 							<reference ref="894101036"/>
 							<reference ref="1019880682"/>
+							<reference ref="95106947"/>
 							<reference ref="357438048"/>
+							<reference ref="719094980"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -327,6 +358,11 @@
 						<reference key="object" ref="357438048"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">93</int>
+						<reference key="object" ref="719094980"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -349,18 +385,20 @@
 					<string>90.IBViewBoundsToFrameTransform</string>
 					<string>91.IBPluginDependency</string>
 					<string>91.IBViewBoundsToFrameTransform</string>
+					<string>93.IBPluginDependency</string>
+					<string>93.IBViewBoundsToFrameTransform</string>
 				</object>
 				<object class="NSMutableArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>MainMenuViewController</string>
 					<string>UIResponder</string>
-					<string>{{267, 388}, {1024, 768}}</string>
+					<string>{{89, 260}, {1024, 768}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABERQAAw56AAA</bytes>
+						<bytes key="NSTransformStruct">P4AAAL+AAABERsAAw6cAAA</bytes>
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
@@ -376,7 +414,11 @@
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">AUPqAABEK4AAA</bytes>
+						<bytes key="NSTransformStruct">P4AAAL+AAABD6gAAxDRAAA</bytes>
+					</object>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform">
+						<bytes key="NSTransformStruct">P4AAAL+AAABDuYAAxDRAAA</bytes>
 					</object>
 				</object>
 			</object>
@@ -396,7 +438,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">92</int>
+			<int key="maxID">94</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -420,6 +462,13 @@
 						<string key="minorKey">Classes/MainMenuViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UIButton</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPhone.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -12,7 +12,7 @@
 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="1"/>
+			<integer value="48"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -196,6 +196,25 @@
 						</object>
 						<reference key="IBUINormalTitleShadowColor" ref="112471976"/>
 					</object>
+					<object class="IBUIButton" id="274540289">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">292</int>
+						<string key="NSFrame">{{439, 68}, {29, 31}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIOpaque">NO</bool>
+						<int key="IBUITag">6</int>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<int key="IBUIContentHorizontalAlignment">0</int>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<reference key="IBUIFont" ref="917635782"/>
+						<int key="IBUIButtonType">2</int>
+						<reference key="IBUIHighlightedTitleColor" ref="918890028"/>
+						<object class="NSColor" key="IBUINormalTitleColor">
+							<int key="NSColorSpace">1</int>
+							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+						</object>
+						<reference key="IBUINormalTitleShadowColor" ref="112471976"/>
+					</object>
 				</object>
 				<string key="NSFrameSize">{480, 320}</string>
 				<reference key="NSSuperview"/>
@@ -265,6 +284,15 @@
 					</object>
 					<int key="connectionID">47</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchEventConnection" key="connection">
+						<string key="label">switchViews:</string>
+						<reference key="source" ref="274540289"/>
+						<reference key="destination" ref="372490531"/>
+						<int key="IBEventType">7</int>
+					</object>
+					<int key="connectionID">49</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -287,6 +315,7 @@
 							<reference ref="753723574"/>
 							<reference ref="124270424"/>
 							<reference ref="629390161"/>
+							<reference ref="274540289"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -336,6 +365,11 @@
 						<reference key="object" ref="629390161"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">48</int>
+						<reference key="object" ref="274540289"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -360,6 +394,8 @@
 					<string>43.IBViewBoundsToFrameTransform</string>
 					<string>46.IBPluginDependency</string>
 					<string>46.IBViewBoundsToFrameTransform</string>
+					<string>48.IBPluginDependency</string>
+					<string>48.IBViewBoundsToFrameTransform</string>
 				</object>
 				<object class="NSMutableArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
@@ -393,7 +429,11 @@
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABD0YAAwmgAAA</bytes>
+						<bytes key="NSTransformStruct">AUPbgABBUAAAA</bytes>
+					</object>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform">
+						<bytes key="NSTransformStruct">P4AAAL+AAABD3gAAwjwAAA</bytes>
 					</object>
 				</object>
 			</object>
@@ -413,7 +453,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">47</int>
+			<int key="maxID">49</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -437,6 +477,13 @@
 						<string key="minorKey">Classes/MainMenuViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UIButton</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 08/01/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @class GameConfigViewController;
 @class SettingsContainerViewController;
 @class AboutViewController;
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,22 +14,20 @@
  * 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 created on 08/01/2010.
  */
 
 
 #import "MainMenuViewController.h"
-#import "CreationChamber.h"
+#import <QuartzCore/QuartzCore.h>
 #import "GameConfigViewController.h"
 #import "SettingsContainerViewController.h"
 #import "AboutViewController.h"
 #import "SavedGamesViewController.h"
 #import "RestoreViewController.h"
 #import "MissionTrainingViewController.h"
-#import "GameInterfaceBridge.h"
 #import "Appirater.h"
 #import "ServerProtocolNetwork.h"
+#import "GameInterfaceBridge.h"
 
 
 @implementation MainMenuViewController
@@ -40,58 +38,9 @@
     return rotationManager(interfaceOrientation);
 }
 
-// check if some configuration files are already set; if they are present it means that the current copy must be updated
--(void) createNecessaryFiles {
-    DLog(@"Creating necessary files");
-    NSInteger index;
-    
-    // SAVES - just delete and overwrite
-    if ([[NSFileManager defaultManager] fileExistsAtPath:SAVES_DIRECTORY()])
-        [[NSFileManager defaultManager] removeItemAtPath:SAVES_DIRECTORY() error:NULL];
-    [[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY()
-                              withIntermediateDirectories:NO
-                                               attributes:nil
-                                                    error:NULL];
-
-    // SCREENSHOTS - just create it the first time
-    if ([[NSFileManager defaultManager] fileExistsAtPath:SCREENSHOTS_DIRECTORY()] == NO)
-        [[NSFileManager defaultManager] createDirectoryAtPath:SCREENSHOTS_DIRECTORY()
-                                  withIntermediateDirectories:NO
-                                                   attributes:nil
-                                                        error:NULL];
-
-    // SETTINGS - nsuserdefaults ftw
-    [CreationChamber createSettings];
-
-    // TEAMS - update exisiting teams with new format
-    NSArray *teamNames = [[NSArray alloc] initWithObjects:@"Edit Me!",@"Ninjas",@"Pirates",@"Robots",nil];
-    index = 0;
-    for (NSString *name in teamNames)
-        [CreationChamber createTeamNamed:name ofType:index++ controlledByAI:[name isEqualToString:@"Robots"]];
-    [teamNames release];
-
-    // SCHEMES - always overwrite and delete custom ones
-    if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES)
-        [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
-    NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate",
-                            @"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless",
-                            @"Thinking with Portals",@"King Mode",nil];
-    index = 0;
-    for (NSString *name in schemeNames)
-        [CreationChamber createSchemeNamed:name ofType:index++];
-    [schemeNames release];
-
-    // WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically)
-    NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate",
-                            @"Minefield",@"Thinking with Portals",nil];
-    index = 0;
-    for (NSString *name in weaponNames)
-        [CreationChamber createWeaponNamed:name ofType:index++];
-    [weaponNames release];
-}
-
 #pragma mark -
 -(void) viewDidLoad {
+    self.view.frame = [[UIScreen mainScreen] safeBounds];
     [super viewDidLoad];
 
     // get the app's version
@@ -106,15 +55,14 @@
         [userDefaults setObject:@"" forKey:@"savedGamePath"];
         // update the tracking version with the new one
         [userDefaults setObject:version forKey:@"HedgeVersion"];
+        [userDefaults synchronize];
 
-        [userDefaults synchronize];
-        [self createNecessaryFiles];
+        [CreationChamber createFirstLaunch];
     }
 
     // prompt for restoring any previous game
     NSString *saveString = [userDefaults objectForKey:@"savedGamePath"];
-    if (saveString != nil && [saveString isEqualToString:@""] == NO) {
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(launchRestoredGame) name:@"launchRestoredGame" object:nil];
+    if (saveString != nil && [saveString isEqualToString:@""] == NO && [[userDefaults objectForKey:@"saveIsValid"] boolValue]) {
         if (self.restoreViewController == nil) {
             NSString *xibName = [@"RestoreViewController-" stringByAppendingString:(IS_IPAD() ? @"iPad" : @"iPhone")];
             RestoreViewController *restored = [[RestoreViewController alloc] initWithNibName:xibName bundle:nil];
@@ -135,7 +83,7 @@
 }
 
 -(void) viewWillAppear:(BOOL)animated {
-    [AudioManagerController playBackgroundMusic];
+    [[AudioManagerController mainManager] playBackgroundMusic];
     [super viewWillAppear:animated];
 }
 
@@ -146,7 +94,7 @@
     NSString *xib = nil;
     NSString *debugStr = nil;
 
-    [AudioManagerController playClickSound];
+    [[AudioManagerController mainManager] playClickSound];
     switch (button.tag) {
         case 0:
             if (nil == self.gameConfigViewController) {
@@ -178,13 +126,29 @@
             scroll.text = debugStr;
             [debugStr release];
             scroll.editable = NO;
+            scroll.alpha = 0;
 
             UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
             [btn addTarget:scroll action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchUpInside];
+            [btn addTarget:btn action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchUpInside];
+            btn.frame = CGRectMake(self.view.frame.size.height-58, -6, 64, 64);
             btn.backgroundColor = [UIColor blackColor];
-            btn.frame = CGRectMake(self.view.frame.size.height-70, 0, 70, 70);
-            [scroll addSubview:btn];
+            btn.titleLabel.textColor = [UIColor whiteColor];
+            btn.titleLabel.textAlignment = UITextAlignmentCenter;
+            btn.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];
+            [btn setTitle:@"Close" forState:UIControlStateNormal];
+            btn.alpha = 0;
+            [btn.layer setCornerRadius:10.0f];
+            [btn.layer setMasksToBounds:YES];
+
             [self.view addSubview:scroll];
+            [self.view addSubview:btn];
+
+            [UIView beginAnimations:@"fadein" context:NULL];
+            [UIView setAnimationDuration:0.25f];
+            btn.alpha = 1;
+            scroll.alpha = 1;
+            [UIView commitAnimations];
             [scroll release];
 #else
             debugStr = debugStr; // prevent compiler warning
@@ -222,6 +186,10 @@
             }
             [self presentModalViewController:self.missionsViewController animated:YES];
             break;
+        case 6:
+            [GameInterfaceBridge registerCallingController:self];
+            [GameInterfaceBridge startSimpleGame];
+            break;
         default:
             alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"
                                                message:@"Sorry, this feature is not yet implemented"
@@ -235,12 +203,6 @@
 }
 
 #pragma mark -
--(void) launchRestoredGame {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    [GameInterfaceBridge startSaveGame:[[NSUserDefaults standardUserDefaults] objectForKey:@"savedGamePath"]];
-}
-
-#pragma mark -
 -(void) viewDidUnload {
     self.gameConfigViewController = nil;
     self.settingsViewController = nil;
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController-iPad.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -44,7 +44,7 @@
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<object class="IBUISegmentedControl" id="88728219">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">289</int>
+						<int key="NSvFlags">261</int>
 						<string key="NSFrame">{{20, 166}, {280, 30}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -113,6 +113,33 @@
 						<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
 						<float key="IBUIRowHeight">44</float>
 					</object>
+					<object class="IBUIButton" id="426759828">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">301</int>
+						<string key="NSFrame">{{32, 32}, {256, 128}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIOpaque">NO</bool>
+						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+						<int key="IBUIContentHorizontalAlignment">0</int>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<object class="NSFont" key="IBUIFont">
+							<string key="NSName">Helvetica-Bold</string>
+							<double key="NSSize">15</double>
+							<int key="NSfFlags">16</int>
+						</object>
+						<object class="NSColor" key="IBUIHighlightedTitleColor">
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MQA</bytes>
+						</object>
+						<object class="NSColor" key="IBUINormalTitleColor">
+							<int key="NSColorSpace">1</int>
+							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+						</object>
+						<object class="NSColor" key="IBUINormalTitleShadowColor">
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MC41AA</bytes>
+						</object>
+					</object>
 				</object>
 				<string key="NSFrameSize">{320, 768}</string>
 				<reference key="NSSuperview"/>
@@ -177,6 +204,31 @@
 					</object>
 					<int key="connectionID">69</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">previewButton</string>
+						<reference key="source" ref="372490531"/>
+						<reference key="destination" ref="426759828"/>
+					</object>
+					<int key="connectionID">128</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchEventConnection" key="connection">
+						<string key="label">mapButtonPressed:</string>
+						<reference key="source" ref="426759828"/>
+						<reference key="destination" ref="372490531"/>
+						<int key="IBEventType">7</int>
+					</object>
+					<int key="connectionID">129</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">delegate</string>
+						<reference key="source" ref="426759828"/>
+						<reference key="destination" ref="372490531"/>
+					</object>
+					<int key="connectionID">130</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -205,6 +257,7 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="394383001"/>
 							<reference ref="88728219"/>
+							<reference ref="426759828"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -218,6 +271,11 @@
 						<reference key="object" ref="88728219"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">127</int>
+						<reference key="object" ref="426759828"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -228,6 +286,9 @@
 					<string>-2.CustomClassName</string>
 					<string>1.IBEditorWindowLastContentRect</string>
 					<string>1.IBPluginDependency</string>
+					<string>127.CustomClassName</string>
+					<string>127.IBPluginDependency</string>
+					<string>127.IBViewBoundsToFrameTransform</string>
 					<string>66.IBPluginDependency</string>
 					<string>66.IBViewBoundsToFrameTransform</string>
 					<string>7.IBPluginDependency</string>
@@ -239,6 +300,11 @@
 					<string>UIResponder</string>
 					<string>{{289, 181}, {320, 768}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<string>MapPreviewButtonView</string>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform">
+						<bytes key="NSTransformStruct">AUIAAABB0AAAA</bytes>
+					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">P4AAAL+AAABEMAAAxCmAAA</bytes>
@@ -265,7 +331,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">126</int>
+			<int key="maxID">130</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -326,7 +392,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -335,8 +400,7 @@
 							<string>UILabel</string>
 							<string>MapPreviewButtonView</string>
 							<string>UISegmentedControl</string>
-							<string>UILabel</string>
-							<string>UISlider</string>
+							<string>ValueTrackingSliderView</string>
 							<string>UITableView</string>
 						</object>
 					</object>
@@ -347,7 +411,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -366,12 +429,8 @@
 								<string key="candidateClassName">UISegmentedControl</string>
 							</object>
 							<object class="IBToOneOutletInfo">
-								<string key="name">sizeLabel</string>
-								<string key="candidateClassName">UILabel</string>
-							</object>
-							<object class="IBToOneOutletInfo">
 								<string key="name">slider</string>
-								<string key="candidateClassName">UISlider</string>
+								<string key="candidateClassName">ValueTrackingSliderView</string>
 							</object>
 							<object class="IBToOneOutletInfo">
 								<string key="name">tableView</string>
@@ -405,14 +464,22 @@
 				</object>
 				<object class="IBPartialClassDescription">
 					<string key="className">UILabel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="1034187891">
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="823133985">
 						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HWUtils.h</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
 					<string key="className">UITableView</string>
-					<reference key="sourceIdentifier" ref="1034187891"/>
+					<reference key="sourceIdentifier" ref="823133985"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">ValueTrackingSliderView</string>
+					<string key="superclassName">UISlider</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/MNEValueTrackingSlider.h</string>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController-iPhone.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -104,17 +104,30 @@
 							<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
 						</object>
 					</object>
-					<object class="IBUISlider" id="938256702">
+					<object class="IBUILabel" id="634417433">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{119, 207}, {149, 23}}</string>
+						<string key="NSFrame">{{71, 196}, {145, 44}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUIContentMode">7</int>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
 						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<float key="IBUIValue">0.05000000074505806</float>
-						<float key="IBUIMaxValue">0.05000000074505806</float>
+						<string key="IBUIText">Loading...</string>
+						<object class="NSFont" key="IBUIFont">
+							<string key="NSName">Helvetica-Bold</string>
+							<double key="NSSize">17</double>
+							<int key="NSfFlags">16</int>
+						</object>
+						<object class="NSColor" key="IBUITextColor">
+							<int key="NSColorSpace">2</int>
+							<bytes key="NSRGB">MC45NDExNzY1MzM3IDAuODE1Njg2MzQ1MSAwAA</bytes>
+						</object>
+						<nil key="IBUIHighlightedColor"/>
+						<int key="IBUIBaselineAdjustment">1</int>
+						<float key="IBUIMinimumFontSize">10</float>
+						<int key="IBUITextAlignment">1</int>
 					</object>
 					<object class="IBUIButton" id="326163764">
 						<reference key="NSNextResponder" ref="191373211"/>
@@ -143,56 +156,6 @@
 							<bytes key="NSWhite">MC41AA</bytes>
 						</object>
 					</object>
-					<object class="IBUILabel" id="634417433">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{9, 221}, {97, 35}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<string key="IBUIText">Loading...</string>
-						<object class="NSFont" key="IBUIFont">
-							<string key="NSName">Helvetica-Bold</string>
-							<double key="NSSize">17</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<object class="NSColor" key="IBUITextColor">
-							<int key="NSColorSpace">2</int>
-							<bytes key="NSRGB">MC45NDExNzY1MzM3IDAuODE1Njg2MzQ1MSAwAA</bytes>
-						</object>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUITextAlignment">1</int>
-					</object>
-					<object class="IBUILabel" id="743202682">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{109, 237}, {169, 29}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClipsSubviews">YES</bool>
-						<int key="IBUIContentMode">7</int>
-						<bool key="IBUIUserInteractionEnabled">NO</bool>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<string key="IBUIText">Label</string>
-						<object class="NSFont" key="IBUIFont">
-							<string key="NSName">Helvetica-Oblique</string>
-							<double key="NSSize">22</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<object class="NSColor" key="IBUITextColor">
-							<int key="NSColorSpace">2</int>
-							<bytes key="NSRGB">MC45NDExNzY1MzM3IDAuODE1Njg2MzQ1MSAwAA</bytes>
-						</object>
-						<nil key="IBUIHighlightedColor"/>
-						<int key="IBUIBaselineAdjustment">1</int>
-						<float key="IBUIMinimumFontSize">10</float>
-						<int key="IBUITextAlignment">1</int>
-					</object>
 					<object class="IBUITableView" id="565214171">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">274</int>
@@ -215,6 +178,18 @@
 						<float key="IBUISectionHeaderHeight">10</float>
 						<float key="IBUISectionFooterHeight">10</float>
 					</object>
+					<object class="IBUISlider" id="938256702">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">292</int>
+						<string key="NSFrame">{{52, 239}, {184, 23}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIOpaque">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<int key="IBUIContentHorizontalAlignment">0</int>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<float key="IBUIValue">0.05000000074505806</float>
+						<float key="IBUIMaxValue">0.05000000074505806</float>
+					</object>
 				</object>
 				<string key="NSFrameSize">{480, 276}</string>
 				<reference key="NSSuperview"/>
@@ -254,14 +229,6 @@
 					<int key="connectionID">16</int>
 				</object>
 				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">sizeLabel</string>
-						<reference key="source" ref="372490531"/>
-						<reference key="destination" ref="743202682"/>
-					</object>
-					<int key="connectionID">18</int>
-				</object>
-				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchEventConnection" key="connection">
 						<string key="label">sliderChanged:</string>
 						<reference key="source" ref="938256702"/>
@@ -298,14 +265,6 @@
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">slider</string>
-						<reference key="source" ref="372490531"/>
-						<reference key="destination" ref="938256702"/>
-					</object>
-					<int key="connectionID">23</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
 						<string key="label">dataSource</string>
 						<reference key="source" ref="565214171"/>
 						<reference key="destination" ref="372490531"/>
@@ -345,6 +304,14 @@
 					</object>
 					<int key="connectionID">37</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">slider</string>
+						<reference key="source" ref="372490531"/>
+						<reference key="destination" ref="938256702"/>
+					</object>
+					<int key="connectionID">38</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -362,11 +329,10 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="326163764"/>
 							<reference ref="565214171"/>
-							<reference ref="938256702"/>
-							<reference ref="743202682"/>
 							<reference ref="574494641"/>
 							<reference ref="88728219"/>
 							<reference ref="634417433"/>
+							<reference ref="938256702"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -387,23 +353,16 @@
 						<reference key="parent" ref="191373211"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">8</int>
-						<reference key="object" ref="938256702"/>
-						<reference key="parent" ref="191373211"/>
-					</object>
-					<object class="IBObjectRecord">
 						<int key="objectID">9</int>
 						<reference key="object" ref="326163764"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">17</int>
-						<reference key="object" ref="743202682"/>
-						<reference key="parent" ref="191373211"/>
-					</object>
-					<object class="IBObjectRecord">
 						<int key="objectID">25</int>
 						<reference key="object" ref="565214171"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+						</object>
 						<reference key="parent" ref="191373211"/>
 						<string key="objectName">Table View (Themes)</string>
 					</object>
@@ -417,6 +376,11 @@
 						<reference key="object" ref="634417433"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">8</int>
+						<reference key="object" ref="938256702"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -429,15 +393,15 @@
 					<string>1.IBPluginDependency</string>
 					<string>11.IBPluginDependency</string>
 					<string>11.IBViewBoundsToFrameTransform</string>
-					<string>17.IBPluginDependency</string>
-					<string>17.IBViewBoundsToFrameTransform</string>
 					<string>25.IBPluginDependency</string>
 					<string>25.IBViewBoundsToFrameTransform</string>
 					<string>35.IBPluginDependency</string>
 					<string>35.IBViewBoundsToFrameTransform</string>
 					<string>7.IBPluginDependency</string>
 					<string>7.IBViewBoundsToFrameTransform</string>
+					<string>8.CustomClassName</string>
 					<string>8.IBPluginDependency</string>
+					<string>8.IBViewBoundsToFrameTransform</string>
 					<string>9.CustomClassName</string>
 					<string>9.IBPluginDependency</string>
 					<string>9.IBViewBoundsToFrameTransform</string>
@@ -450,11 +414,7 @@
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABB+AAAw4QAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABCyAAAw2YAAA</bytes>
+						<bytes key="NSTransformStruct">AUKOAABDRAAAA</bytes>
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
@@ -468,7 +428,11 @@
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">P4AAAL+AAABBUAAAwigAAA</bytes>
 					</object>
+					<string>MNEValueTrackingSlider</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform">
+						<bytes key="NSTransformStruct">P4AAAL+AAABCWAAAw4IAAA</bytes>
+					</object>
 					<string>MapPreviewButtonView</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
@@ -492,12 +456,20 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">37</int>
+			<int key="maxID">38</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<object class="IBPartialClassDescription">
+					<string key="className">MNEValueTrackingSlider</string>
+					<string key="superclassName">UISlider</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/MNEValueTrackingSlider.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">MapConfigViewController</string>
 					<string key="superclassName">UIViewController</string>
 					<object class="NSMutableDictionary" key="actions">
@@ -553,7 +525,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -562,8 +533,7 @@
 							<string>UILabel</string>
 							<string>MapPreviewButtonView</string>
 							<string>UISegmentedControl</string>
-							<string>UILabel</string>
-							<string>UISlider</string>
+							<string>MNEValueTrackingSlider</string>
 							<string>UITableView</string>
 						</object>
 					</object>
@@ -574,7 +544,6 @@
 							<string>maxLabel</string>
 							<string>previewButton</string>
 							<string>segmentedControl</string>
-							<string>sizeLabel</string>
 							<string>slider</string>
 							<string>tableView</string>
 						</object>
@@ -593,12 +562,8 @@
 								<string key="candidateClassName">UISegmentedControl</string>
 							</object>
 							<object class="IBToOneOutletInfo">
-								<string key="name">sizeLabel</string>
-								<string key="candidateClassName">UILabel</string>
-							</object>
-							<object class="IBToOneOutletInfo">
 								<string key="name">slider</string>
-								<string key="candidateClassName">UISlider</string>
+								<string key="candidateClassName">MNEValueTrackingSlider</string>
 							</object>
 							<object class="IBToOneOutletInfo">
 								<string key="name">tableView</string>
@@ -631,15 +596,19 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="290282013">
+					<string key="className">UIButton</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="67684033">
 						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">ExtraCategories.h</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<reference key="sourceIdentifier" ref="67684033"/>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">UITableView</string>
-					<reference key="sourceIdentifier" ref="290282013"/>
+					<reference key="sourceIdentifier" ref="67684033"/>
 				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 22/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 #import "MapPreviewButtonView.h"
+#import "MNEValueTrackingSlider.h"
 
 
 @interface MapConfigViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, MapPreviewViewDelegate> {
@@ -42,9 +41,8 @@
     MapPreviewButtonView *previewButton;
     UITableView *tableView;
     UILabel *maxLabel;
-    UILabel *sizeLabel;
     UISegmentedControl *segmentedControl;
-    UISlider *slider;
+    MNEValueTrackingSlider *slider;
 
     // internal objects
     NSIndexPath *lastIndexPath;
@@ -67,9 +65,8 @@
 @property (nonatomic,retain) IBOutlet MapPreviewButtonView *previewButton;
 @property (nonatomic,retain) IBOutlet UITableView *tableView;
 @property (nonatomic,retain) IBOutlet UILabel *maxLabel;
-@property (nonatomic,retain) IBOutlet UILabel *sizeLabel;
 @property (nonatomic,retain) IBOutlet UISegmentedControl *segmentedControl;
-@property (nonatomic,retain) IBOutlet UISlider *slider;
+@property (nonatomic,retain) IBOutlet MNEValueTrackingSlider *slider;
 
 @property (nonatomic,retain) NSIndexPath *lastIndexPath;
 @property (nonatomic,retain) NSArray *dataSourceArray;
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,15 +14,11 @@
  * 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 created on 22/04/2010.
  */
 
 
 #import "MapConfigViewController.h"
 #import <QuartzCore/QuartzCore.h>
-#import "SchemeWeaponConfigViewController.h"
-#import "GameConfigViewController.h"
 
 
 #define scIndex         self.segmentedControl.selectedSegmentIndex
@@ -30,7 +26,7 @@
 
 @implementation MapConfigViewController
 @synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand,
-            missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy,
+            missionCommand, tableView, maxLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy,
             oldPage, oldValue;
 
 
@@ -39,7 +35,7 @@
 }
 
 -(IBAction) mapButtonPressed:(id) sender {
-    [AudioManagerController playClickSound];
+    [[AudioManagerController mainManager] playClickSound];
     [self updatePreview];
 }
 
@@ -118,7 +114,7 @@
 
 -(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *CellIdentifier = @"Cell";
-    NSInteger row = [indexPath row];
+    NSUInteger row = [indexPath row];
 
     UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (cell == nil)
@@ -241,7 +237,7 @@
             break;
         case 2:
             if (self.segmentedControl.selectedSegmentIndex == 0) {
-                labelText = NSLocalizedString(@"Small",@"");
+                labelText = NSLocalizedString(@"Large",@"");
             } else {
                 labelText = NSLocalizedString(@"Small Floating Islands",@"");
             }
@@ -259,7 +255,7 @@
             break;
         case 4:
             if (self.segmentedControl.selectedSegmentIndex == 0) {
-                labelText = NSLocalizedString(@"Large",@"");
+                labelText = NSLocalizedString(@"Small",@"");
             } else {
                 labelText = NSLocalizedString(@"Medium Tunnels",@"");
             }
@@ -282,7 +278,7 @@
             break;
     }
 
-    self.sizeLabel.text = labelText;
+    self.slider.textValue = labelText;
     self.templateFilterCommand = templateCommand;
     self.mazeSizeCommand = mazeCommand;
 }
@@ -294,7 +290,7 @@
         [self updatePreview];
         oldValue = num;
     }
-    [AudioManagerController playClickSound];
+    [[AudioManagerController mainManager] playClickSound];
 }
 
 // perform actions based on the activated section, then call updatePreview to visually update the selection
@@ -303,7 +299,7 @@
     NSString *mapgen, *staticmap, *mission;
     NSInteger newPage = self.segmentedControl.selectedSegmentIndex;
 
-    [AudioManagerController playSelectSound];
+    [[AudioManagerController mainManager] playSelectSound];
     switch (newPage) {
         case 0: // Random
             mapgen = @"e$mapgen 0";
@@ -311,7 +307,7 @@
             mission = @"";
             [self sliderChanged:nil];
             self.slider.enabled = YES;
-            [SchemeWeaponConfigViewController fillInstanceSections];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"fillsections" object:nil];
             break;
 
         case 1: // Map
@@ -320,8 +316,7 @@
             staticmap = @"map Bamboo";
             mission = @"";
             self.slider.enabled = NO;
-            self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
-            [SchemeWeaponConfigViewController fillInstanceSections];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"fillsections" object:nil];
             break;
 
         case 2: // Maze
@@ -330,7 +325,7 @@
             mission = @"";
             [self sliderChanged:nil];
             self.slider.enabled = YES;
-            [SchemeWeaponConfigViewController fillInstanceSections];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"fillsections" object:nil];
             break;
 
         case 3: // Mission
@@ -339,8 +334,7 @@
             staticmap = @"map Bamboo";
             mission = @"";
             self.slider.enabled = NO;
-            self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
-            [SchemeWeaponConfigViewController emptyInstanceSections];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"emptysections" object:nil];
             break;
 
         default:
@@ -407,32 +401,13 @@
     return dataSourceArray;
 }
 
--(MapPreviewButtonView *)previewButton {
-    if (previewButton == nil) {
-        MapPreviewButtonView *preview = [[MapPreviewButtonView alloc] initWithFrame:CGRectMake(32, 26, 256, 128)];
-        preview.delegate = self;
-        [preview addTarget:self action:@selector(mapButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
-        [self.view addSubview:preview];
-        self.previewButton = preview;
-        [preview release];
-    }
-    return previewButton;
-}
-
 -(void) viewDidLoad {
     [super viewDidLoad];
-
     srandom(time(NULL));
-
-    /*
-    CGSize screenSize = [[UIScreen mainScreen] bounds].size;
-    self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
-    */
     
     // initialize some "default" values
     self.slider.value = 0.05f;
     self.slider.enabled = NO;
-    self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
     self.oldValue = 5;
     self.busy = NO;
     self.oldPage = self.segmentedControl.selectedSegmentIndex;
@@ -451,6 +426,7 @@
         self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 10, 0);
 
         UILabel *backLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 14, 300, 190) andTitle:nil withBorderWidth:2.3f];
+        backLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         [self.view insertSubview:backLabel belowSubview:self.segmentedControl];
         [backLabel release];
     }
@@ -477,10 +453,8 @@
     self.staticMapCommand = nil;
     self.missionCommand = nil;
 
-    self.previewButton = nil;
     self.tableView = nil;
     self.maxLabel = nil;
-    self.sizeLabel = nil;
     self.segmentedControl = nil;
     self.slider = nil;
 
@@ -493,13 +467,12 @@
 
 -(void) didReceiveMemoryWarning {
     self.dataSourceArray = nil;
-    self.previewButton = nil;
     [super didReceiveMemoryWarning];
 
     if (self.view.superview == nil) {
+        self.previewButton = nil;
         self.tableView = nil;
         self.maxLabel = nil;
-        self.sizeLabel = nil;
         self.slider = nil;
     }
 
@@ -518,7 +491,6 @@
     releaseAndNil(previewButton);
     releaseAndNil(tableView);
     releaseAndNil(maxLabel);
-    releaseAndNil(sizeLabel);
     releaseAndNil(segmentedControl);
     releaseAndNil(slider);
 
--- a/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,14 +14,13 @@
  * 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 created on 26/09/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 #import "SDL_net.h"
 
+
 @protocol MapPreviewViewDelegate <NSObject>
 
 -(void) turnOnWidgets;
--- a/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,14 +14,10 @@
  * 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 created on 26/09/2010.
  */
 
 
 #import "MapPreviewButtonView.h"
-#import "MapConfigViewController.h"
-#import "UIImageExtra.h"
 #import <pthread.h>
 #import <QuartzCore/QuartzCore.h>
 
@@ -64,10 +60,10 @@
     return SDLNet_TCP_Send(csd, [string UTF8String], length);
 }
 
--(const uint8_t *)engineProtocol {
+-(void) engineProtocol:(uint8_t *)unpackedMap {
     IPaddress ip;
     BOOL serverQuit = NO;
-    static uint8_t map[128*32];
+    uint8_t packedMap[128*32];
     int port = [HWUtils randomPort];
 
     if (SDLNet_Init() < 0) {
@@ -89,7 +85,7 @@
 
     // launch the preview here so that we're sure the tcp channel is open
     pthread_t thread_id;
-    pthread_create(&thread_id, NULL, (void *)GenLandPreview, (void *)port);
+    pthread_create(&thread_id, NULL, (void *(*)(void *))GenLandPreview, (void *)port);
     pthread_detach(thread_id);
 
     DLog(@"Waiting for a client on port %d", port);
@@ -107,49 +103,45 @@
             [self sendToEngine:[dictForEngine objectForKey:@"mazeSizeCommand"]];
             [self sendToEngine:@"!"];
 
-            memset(map, 0, 128*32);
-            SDLNet_TCP_Recv(csd, map, 128*32);
+            memset(packedMap, 0, 128*32);
+            SDLNet_TCP_Recv(csd, packedMap, 128*32);
             SDLNet_TCP_Recv(csd, &maxHogs, sizeof(uint8_t));
 
             SDLNet_TCP_Close(csd);
             serverQuit = YES;
         }
     }
-
+    [HWUtils freePort:port];
     SDLNet_TCP_Close(sd);
     SDLNet_Quit();
-    return map;
+
+    // spread the packed bits in an array of bytes (one pixel per element, 0= transparent 1= color)
+    int k = 0;
+    memset(unpackedMap, 255, 128*32*8);     // 255 is white
+    for (int i = 0; i < 32*128; i++) {
+        for (int j = 7; j >= 0; j--) {
+            if (((packedMap[i] >> j) & 0x01) != 0)
+                unpackedMap[k] = 170;       // level of gray [0-255]
+            k++;
+        }
+    }
+    return;
 }
 
 -(void) drawingThread {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    const uint8_t *map = [self engineProtocol];
-    uint8_t mapExp[128*32*8];
+    uint8_t unpackedMap[128*32*8];
+    [self engineProtocol:unpackedMap];
 
-    // draw the buffer (1 pixel per component, 0= transparent 1= color)
-    int k = 0;
-    for (int i = 0; i < 32*128; i++) {
-        unsigned char byte = map[i];
-        for (int j = 0; j < 8; j++) {
-            // select the color based on the leftmost bit
-            if ((byte & 0x80) != 0)
-                mapExp[k] = 100;
-            else
-                mapExp[k] = 255;
-            // shift to next bit
-            byte <<= 1;
-            k++;
-        }
-    }
+    // http://developer.apple.com/mac/library/qa/qa2001/qa1037.html
     CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceGray();
-    CGContextRef bitmapImage = CGBitmapContextCreate(mapExp, 256, 128, 8, 256, colorspace, kCGImageAlphaNone);
+    CGContextRef bitmapImage = CGBitmapContextCreate(unpackedMap, 256, 128, 8, 256, colorspace, kCGImageAlphaNone);
     CGColorSpaceRelease(colorspace);
 
     CGImageRef previewCGImage = CGBitmapContextCreateImage(bitmapImage);
     CGContextRelease(bitmapImage);
     UIImage *previewImage = [[UIImage alloc] initWithCGImage:previewCGImage];
     CGImageRelease(previewCGImage);
-    previewCGImage = nil;
 
     // all these are performed on the main thread to prevent a leak
     [self performSelectorOnMainThread:@selector(setImageRounded:)
@@ -167,18 +159,6 @@
                         waitUntilDone:NO];
     
     [pool release];
-
-    /*
-    // http://developer.apple.com/mac/library/qa/qa2001/qa1037.html
-    UIGraphicsBeginImageContext(CGSizeMake(256,128));
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    UIGraphicsPushContext(context);
-    CGContextSetRGBFillColor(context, 0.5, 0.5, 0.7, 1.0);
-    CGContextFillRect(context,CGRectMake(xc,yc,1,1));
-    UIGraphicsPopContext();
-    UIImage *previewImage = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    */
 }
 
 -(void) updatePreviewWithSeed:(NSString *)seed {
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPad.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -42,6 +42,18 @@
 				<int key="NSvFlags">274</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="677142548">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">319</int>
+						<string key="NSFrameSize">{768, 768}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">mediumBackground~ipad.png</string>
+						</object>
+					</object>
 					<object class="IBUITableView" id="609221433">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">274</int>
@@ -66,7 +78,7 @@
 					</object>
 					<object class="IBUIImageView" id="776434219">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">269</int>
 						<string key="NSFrame">{{227, 496}, {314, 260}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIClipsSubviews">YES</bool>
@@ -75,7 +87,7 @@
 					</object>
 					<object class="IBUIButton" id="1038942684">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">268</int>
 						<string key="NSFrame">{{20, 684}, {64, 64}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -106,7 +118,7 @@
 					</object>
 					<object class="IBUIButton" id="1068873625">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">265</int>
 						<string key="NSFrame">{{606, 684}, {142, 64}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -128,7 +140,7 @@
 					</object>
 					<object class="IBUILabel" id="12882009">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">292</int>
+						<int key="NSvFlags">306</int>
 						<string key="NSFrame">{{5, 6}, {757, 72}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -257,6 +269,7 @@
 							<reference ref="1068873625"/>
 							<reference ref="12882009"/>
 							<reference ref="609221433"/>
+							<reference ref="677142548"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -299,6 +312,11 @@
 						<reference key="object" ref="12882009"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">23</int>
+						<reference key="object" ref="677142548"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -317,6 +335,8 @@
 					<string>18.IBViewBoundsToFrameTransform</string>
 					<string>21.IBPluginDependency</string>
 					<string>21.IBViewBoundsToFrameTransform</string>
+					<string>23.IBPluginDependency</string>
+					<string>23.IBViewBoundsToFrameTransform</string>
 					<string>9.IBPluginDependency</string>
 					<string>9.IBViewBoundsToFrameTransform</string>
 				</object>
@@ -344,6 +364,10 @@
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
+						<bytes key="NSTransformStruct">AUOEAABDoAAAA</bytes>
+					</object>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">P4AAAL+AAABCtgAAw+2AAA</bytes>
 					</object>
 				</object>
@@ -364,7 +388,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">22</int>
+			<int key="maxID">23</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -428,12 +452,20 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+					<string key="className">UIButton</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="957394895">
 						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HWUtils.h</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<reference key="sourceIdentifier" ref="957394895"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UITableView</string>
+					<reference key="sourceIdentifier" ref="957394895"/>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -689,11 +721,13 @@
 			<object class="NSArray" key="dict.sortedKeys">
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<string>backButton.png</string>
+				<string>mediumBackground~ipad.png</string>
 				<string>startGameButton.png</string>
 			</object>
 			<object class="NSMutableArray" key="dict.values">
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<string>{64, 64}</string>
+				<string>{768, 768}</string>
 				<string>{142, 64}</string>
 			</object>
 		</object>
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPhone.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -42,6 +42,18 @@
 				<int key="NSvFlags">274</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="474863980">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">292</int>
+						<string key="NSFrameSize">{480, 320}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">smallerBackground~iphone.png</string>
+						</object>
+					</object>
 					<object class="IBUITableView" id="609221433">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">274</int>
@@ -218,6 +230,7 @@
 							<reference ref="776434219"/>
 							<reference ref="1038942684"/>
 							<reference ref="1068873625"/>
+							<reference ref="474863980"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -255,6 +268,11 @@
 						<reference key="object" ref="1068873625"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">23</int>
+						<reference key="object" ref="474863980"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -271,6 +289,7 @@
 					<string>17.IBViewBoundsToFrameTransform</string>
 					<string>18.IBPluginDependency</string>
 					<string>18.IBViewBoundsToFrameTransform</string>
+					<string>23.IBPluginDependency</string>
 					<string>9.IBPluginDependency</string>
 					<string>9.IBViewBoundsToFrameTransform</string>
 				</object>
@@ -293,6 +312,7 @@
 						<bytes key="NSTransformStruct">P4AAAL+AAABB2AAAw2cAAA</bytes>
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">P4AAAL+AAABDUAAAw5UAAA</bytes>
 					</object>
@@ -314,7 +334,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">22</int>
+			<int key="maxID">23</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -378,12 +398,20 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
-					<string key="className">UILabel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+					<string key="className">UIButton</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="249392476">
 						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/HWUtils.h</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<reference key="sourceIdentifier" ref="249392476"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UITableView</string>
+					<reference key="sourceIdentifier" ref="249392476"/>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -639,11 +667,13 @@
 			<object class="NSArray" key="dict.sortedKeys">
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<string>backButton.png</string>
+				<string>smallerBackground~iphone.png</string>
 				<string>startGameButton.png</string>
 			</object>
 			<object class="NSMutableArray" key="dict.values">
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<string>{64, 64}</string>
+				<string>{480, 320}</string>
 				<string>{142, 64}</string>
 			</object>
 		</object>
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,10 +14,9 @@
  * 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 created on 03/10/2011.
  */
 
+
 #import <UIKit/UIKit.h>
 
 
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 03/10/2011.
  */
 
 
@@ -34,11 +32,6 @@
 #pragma mark -
 #pragma mark View management
 -(void) viewDidLoad {
-    NSString *imgName = (IS_IPAD()) ? @"mediumBackground~ipad.png" : @"smallerBackground~iphone.png";
-    UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
-    [img release];
-    
     self.previewImage.layer.borderColor = [[UIColor darkYellowColor] CGColor];
     self.previewImage.layer.borderWidth = 3.8f;
     self.previewImage.layer.cornerRadius = 14;
@@ -71,9 +64,10 @@
     UIButton *button = (UIButton *)sender;
 
     if (button.tag == 0) {
-        [AudioManagerController playBackSound];
+        [[AudioManagerController mainManager] playBackSound];
         [[self parentViewController] dismissModalViewControllerAnimated:YES];
     } else {
+        [GameInterfaceBridge registerCallingController:self];
         [GameInterfaceBridge startMissionGame:self.missionName];
     }
 }
@@ -92,13 +86,13 @@
         NSString *descComplete = [[NSString alloc] initWithContentsOfFile:descLocation encoding:NSUTF8StringEncoding error:NULL];
         [descLocation release];
         NSArray *descArray = [descComplete componentsSeparatedByString:@"\n"];
-        NSMutableArray *filteredArray = [[NSMutableArray alloc] initWithCapacity:[descArray count]];
+        NSMutableArray *filteredArray = [[NSMutableArray alloc] initWithCapacity:[descArray count]/3];
         [descComplete release];
         // sanity check to avoid having missions and descriptions conflicts
-        for (int i = 0; i < [self.listOfMissions count]; i++) {
+        for (NSUInteger i = 0; i < [self.listOfMissions count]; i++) {
             NSString *desc = [[self.listOfMissions objectAtIndex:i] stringByDeletingPathExtension];
             for (NSString *str in descArray)
-                if ([str hasPrefix:desc]) {
+                if ([str hasPrefix:desc] && [str hasSuffix:@"\""]) {
                     NSArray *descriptionText = [str componentsSeparatedByString:@"\""];
                     [filteredArray insertObject:[descriptionText objectAtIndex:1] atIndex:i];
                     break;
--- a/project_files/HedgewarsMobile/Classes/ObjcExports.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ObjcExports.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,25 +14,14 @@
  * 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 created on 30/10/2010.
  */
 
 
-@interface ObjcExports : NSObject {
-
-}
-
-+(void) setGrenadeTime:(NSInteger) value;
-+(NSInteger) grenadeTime;
-
-@end
-
-
 void clearView(void);
 BOOL isApplePhone(void);
 
-void startSpinningProgress(void);
-void stopSpinningProgress(void);
+void startLoadingIndicator(void);
+void stopLoadingIndicator(void);
+
 void saveBeganSynching(void);
 void saveFinishedSynching(void);
--- a/project_files/HedgewarsMobile/Classes/ObjcExports.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,78 +14,60 @@
  * 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 created on 30/10/2010.
  */
 
 
 #import "ObjcExports.h"
-#import "OverlayViewController.h"
-#import "AmmoMenuViewController.h"
-
-//FIXME: add a proper #import when this is exposed in SDL
-extern UIView *SDL_getUikitView(void *);
-
-// cache the grenade time
-static NSInteger grenadeTime;
-// the reference to the newMenu instance
-static OverlayViewController *overlay_instance;
-
-@implementation ObjcExports
-
-+(void) setGrenadeTime:(NSInteger) value {
-    grenadeTime = value;
-}
-
-+(NSInteger) grenadeTime {
-    return grenadeTime;
-}
-
-@end
-
 
 #pragma mark -
 #pragma mark functions called by pascal code
-BOOL inline isApplePhone() {
+BOOL inline isApplePhone(void) {
     return (IS_IPAD() == NO);
 }
 
-void startLoadingIndicator() {
+void startLoadingIndicator(void) {
     // this is the first ojbc function called by engine, so we have to initialize some variables here
-    overlay_instance = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
-    // in order to get rotation events we have to insert the view inside the first view of the second window
-    //TODO: when multihead make sure that overlay is displayed in the touch-enabled window
-    [SDL_getUikitView(HW_getSDLWindow()) addSubview:overlay_instance.view];
-    grenadeTime = 2;
 
     if ([HWUtils gameType] == gtSave) {
         [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
 
+        /*
         overlay_instance.view.backgroundColor = [UIColor blackColor];
         overlay_instance.view.alpha = 0.75;
         overlay_instance.view.userInteractionEnabled = NO;
+        */
     }
+    /*
     CGPoint center = overlay_instance.view.center;
-    CGPoint loaderCenter = ((IS_DUALHEAD() || [HWUtils gameType] == gtSave) ? center : CGPointMake(center.x, center.y * 5/3));
+    CGPoint loaderCenter = ([HWUtils gameType] == gtSave) ? center : CGPointMake(center.x, center.y * 5/3);
 
     overlay_instance.loadingIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
     overlay_instance.loadingIndicator.hidesWhenStopped = YES;
     overlay_instance.loadingIndicator.center = loaderCenter;
+    overlay_instance.loadingIndicator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin |
+                                                         UIViewAutoresizingFlexibleRightMargin |
+                                                         UIViewAutoresizingFlexibleTopMargin |
+                                                         UIViewAutoresizingFlexibleBottomMargin;
     [overlay_instance.loadingIndicator startAnimating];
     [overlay_instance.view addSubview:overlay_instance.loadingIndicator];
     [overlay_instance.loadingIndicator release];
+    */
 }
 
-void stopLoadingIndicator() {
-    HW_zoomSet(1.7);
+void stopLoadingIndicator(void) {
+    //HW_zoomSet(1.7);
     if ([HWUtils gameType] != gtSave) {
-        [overlay_instance.loadingIndicator stopAnimating];
-        [overlay_instance.loadingIndicator removeFromSuperview];
+        //[overlay_instance.loadingIndicator stopAnimating];
+        //[overlay_instance.loadingIndicator removeFromSuperview];
         [HWUtils setGameStatus:gsInGame];
     }
+    // mark the savefile as valid, eg it's been loaded correctly
+    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:@"saveIsValid"];
+    [[NSUserDefaults standardUserDefaults] synchronize];
 }
 
-void saveFinishedSynching() {
+void saveFinishedSynching(void) {
+    /*
     [UIView beginAnimations:@"fading from save synch" context:NULL];
     [UIView setAnimationDuration:1];
     overlay_instance.view.backgroundColor = [UIColor clearColor];
@@ -95,31 +77,12 @@
 
     [overlay_instance.loadingIndicator stopAnimating];
     [overlay_instance.loadingIndicator performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
+    */
 
     [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
     [HWUtils setGameStatus:gsInGame];
 }
 
-void clearView() {
-    // don't use any engine calls here as this function is called every time the ammomenu is opened
-    [UIView beginAnimations:@"remove button" context:NULL];
-    [UIView setAnimationDuration:ANIMATION_DURATION];
-    overlay_instance.confirmButton.alpha = 0;
-    overlay_instance.grenadeTimeSegment.alpha = 0;
-    [UIView commitAnimations];
-
-    if (overlay_instance.confirmButton)
-        [overlay_instance.confirmButton performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:ANIMATION_DURATION];
-    if (overlay_instance.grenadeTimeSegment) {
-        [overlay_instance.grenadeTimeSegment performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:ANIMATION_DURATION];
-        overlay_instance.grenadeTimeSegment.tag = 0;
-    }
-    grenadeTime = 2;
-}
-
-void updateVisualsNewTurn(void) {
-    [overlay_instance.amvc updateAmmoVisuals];
-}
 
 // dummy function to prevent linkage fail
 int SDL_main(int argc, char **argv) {
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 16/03/2010.
- */
-
-
-#import <UIKit/UIKit.h>
-
-@class InGameMenuViewController;
-@class HelpPageViewController;
-@class AmmoMenuViewController;
-
-@interface OverlayViewController : UIViewController {
-    // the timer that dims the overlay
-    NSTimer *dimTimer;
-
-    // the in-game menu
-    UIPopoverController *popoverController; // iPad only, never set on iPhone
-    InGameMenuViewController *popupMenu;
-    BOOL isPopoverVisible;
-
-    // the help menu
-    HelpPageViewController *helpPage;
-
-    // the objc ammomenu
-    AmmoMenuViewController *amvc;
-    
-    // ths touch section
-    CGFloat initialDistanceForPinching;
-    CGPoint startingPoint;
-    BOOL isAttacking;
-    
-    // dual head support
-    NSInteger initialScreenCount;
-
-    // various other widgets
-    UIActivityIndicatorView *loadingIndicator;
-    UIButton *confirmButton;
-    UISegmentedControl *grenadeTimeSegment;
-}
-
-@property (nonatomic,retain) id popoverController;
-@property (nonatomic,retain) InGameMenuViewController *popupMenu;
-@property (nonatomic,retain) HelpPageViewController *helpPage;
-@property (nonatomic,retain) AmmoMenuViewController *amvc;
-@property (nonatomic,retain) UIActivityIndicatorView *loadingIndicator;
-@property (nonatomic,retain) UIButton *confirmButton;
-@property (nonatomic,retain) UISegmentedControl *grenadeTimeSegment;
-
-@property (assign) NSInteger initialScreenCount;
-
-
-+(OverlayViewController *)mainOverlay;
-
--(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
--(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
--(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
--(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
-
--(IBAction) buttonReleased:(id) sender;
--(IBAction) buttonPressed:(id) sender;
-
--(void) showPopover;
--(void) dismissPopover;
--(void) dimOverlay;
--(void) activateOverlay;
--(void) removeOverlay;
-
-#define ANIMATION_DURATION 0.25
-#define CONFIRMATION_TAG 5959
-#define GRENADE_TAG 9595
-
-@end
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,606 +0,0 @@
-/*
- * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@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 created on 16/03/2010.
- */
-
-
-#import "OverlayViewController.h"
-#import "InGameMenuViewController.h"
-#import "HelpPageViewController.h"
-#import "AmmoMenuViewController.h"
-#import "CGPointUtils.h"
-#import "ObjcExports.h"
-
-
-#define HIDING_TIME_DEFAULT [NSDate dateWithTimeIntervalSinceNow:2.7]
-#define HIDING_TIME_NEVER   [NSDate dateWithTimeIntervalSinceNow:10000]
-#define doDim()             [dimTimer setFireDate: (IS_DUALHEAD()) ? HIDING_TIME_NEVER : HIDING_TIME_DEFAULT]
-#define doNotDim()          [dimTimer setFireDate:HIDING_TIME_NEVER]
-
-
-static OverlayViewController *mainOverlay;
-
-@implementation OverlayViewController
-@synthesize popoverController, popupMenu, helpPage, amvc, initialScreenCount, loadingIndicator,
-            confirmButton, grenadeTimeSegment;
-
-#pragma mark -
-#pragma mark rotation
-
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
-    return rotationManager(interfaceOrientation);
-}
-
-#pragma mark -
-#pragma mark View Management
--(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
-    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
-        isAttacking = NO;
-        isPopoverVisible = NO;
-        initialScreenCount = (IS_DUALHEAD() ? 2 : 1);
-        loadingIndicator = nil;
-        mainOverlay = self;
-    }
-    return self;
-}
-
-+(OverlayViewController *)mainOverlay {
-    return mainOverlay;
-}
-
--(void) viewDidLoad {
-    // fill all the screen available as sdlview disables autoresizing
-    CGRect rect = [[UIScreen mainScreen] bounds];
-    self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
-
-    // the timer used to dim the overlay
-    dimTimer = [[NSTimer alloc] initWithFireDate:(IS_DUALHEAD()) ? HIDING_TIME_NEVER : [NSDate dateWithTimeIntervalSinceNow:6]
-                                        interval:1000
-                                          target:self
-                                        selector:@selector(dimOverlay)
-                                        userInfo:nil
-                                         repeats:YES];
-    // add timer to runloop, otherwise it doesn't work
-    [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode];
-
-    // display the help page, required by the popover on ipad
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(showHelp:)
-                                                 name:@"show help ingame"
-                                               object:nil];
-
-    if (IS_IPAD()) {
-        [[NSNotificationCenter defaultCenter] addObserver:self
-                                                 selector:@selector(numberOfScreensIncreased)
-                                                     name:UIScreenDidConnectNotification
-                                                   object:nil];
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self
-                                                 selector:@selector(numberOfScreensDecreased)
-                                                     name:UIScreenDidDisconnectNotification
-                                                   object:nil];
-    }
-    
-    // present the overlay
-    self.view.alpha = 0;
-    [UIView beginAnimations:@"showing overlay" context:NULL];
-    [UIView setAnimationDuration:2];
-    self.view.alpha = 1;
-    [UIView commitAnimations];
-}
-
--(void) viewDidUnload {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-
-    [NSObject cancelPreviousPerformRequestsWithTarget:self
-                                             selector:@selector(unsetPreciseStatus)
-                                               object:nil];
-
-    // only objects initialized in viewDidLoad should be here
-    dimTimer = nil;
-    mainOverlay = nil;
-    self.helpPage = nil;
-    [self dismissPopover];
-    self.popoverController = nil;
-    self.amvc = nil;
-    self.loadingIndicator = nil;
-    MSG_DIDUNLOAD();
-    [super viewDidUnload];
-}
-
--(void) didReceiveMemoryWarning {
-    if (self.popupMenu.view.superview == nil)
-        self.popupMenu = nil;
-    if (self.helpPage.view.superview == nil)
-        self.helpPage = nil;
-    if (self.amvc.view.superview == nil)
-        self.amvc = nil;
-    if (self.loadingIndicator.superview == nil)
-        self.loadingIndicator = nil;
-    if (self.confirmButton.superview == nil)
-        self.confirmButton = nil;
-    if (self.grenadeTimeSegment.superview == nil)
-        self.grenadeTimeSegment = nil;
-    if (IS_IPAD())
-        if (((UIPopoverController *)self.popoverController).contentViewController.view.superview == nil)
-            self.popoverController = nil;
-
-    MSG_MEMCLEAN();
-    [super didReceiveMemoryWarning];
-}
-
--(void) dealloc {
-    releaseAndNil(popupMenu);
-    releaseAndNil(helpPage);
-    releaseAndNil(popoverController);
-    releaseAndNil(amvc);
-    releaseAndNil(loadingIndicator);
-    releaseAndNil(confirmButton);
-    releaseAndNil(grenadeTimeSegment);
-    // dimTimer is autoreleased
-    [super dealloc];
-}
-
--(void) numberOfScreensIncreased {
-    if (self.initialScreenCount == 1) {
-        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"New display detected"
-                                                        message:NSLocalizedString(@"Hedgewars supports multi-monitor configurations, but the screen has to be connected before launching the game.",@"")
-                                                       delegate:nil
-                                              cancelButtonTitle:@"Ok"
-                                              otherButtonTitles:nil];
-        [alert show];
-        [alert release];
-        HW_pause();
-    }
-}
-
--(void) numberOfScreensDecreased {
-    if (self.initialScreenCount == 2) {
-        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oh noes! Display disconnected"
-                                                        message:NSLocalizedString(@"A monitor has been disconnected while playing and this has ended the match! You need to restart the game if you wish to use the second display again.",@"")
-                                                       delegate:nil
-                                              cancelButtonTitle:@"Ok"
-                                              otherButtonTitles:nil];
-        [alert show];
-        [alert release];
-        HW_terminate(NO);
-    }
-}
-
-#pragma mark -
-#pragma mark overlay appearance
-// nice transition for dimming, should be called only by the timer himself
--(void) dimOverlay {
-    if ([HWUtils isGameRunning]) {
-        [UIView beginAnimations:@"overlay dim" context:NULL];
-        [UIView setAnimationDuration:0.6];
-        self.view.alpha = 0.2;
-        [UIView commitAnimations];
-    }
-}
-
-// set the overlay visible and put off the timer for enough time
--(void) activateOverlay {
-    self.view.alpha = 1;
-    doNotDim();
-}
-
--(void) removeOverlay {
-    [self.popupMenu performSelectorOnMainThread:@selector(dismiss) withObject:nil waitUntilDone:YES];
-    [self.popoverController performSelectorOnMainThread:@selector(dismissPopoverAnimated:) withObject:nil waitUntilDone:YES];
-    [self.view performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:YES];
-    [self performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:YES];
-    mainOverlay = nil;
-}
-
-#pragma mark -
-#pragma mark overlay user interaction
-// dim the overlay when there's no more input for a certain amount of time
--(IBAction) buttonReleased:(id) sender {
-    if ([HWUtils isGameRunning] == NO)
-        return;
-
-    UIButton *theButton = (UIButton *)sender;
-
-    switch (theButton.tag) {
-        case 0:
-        case 1:
-        case 2:
-        case 3:
-            [NSObject cancelPreviousPerformRequestsWithTarget:self
-                                                     selector:@selector(unsetPreciseStatus)
-                                                       object:nil];
-            HW_walkingKeysUp();
-            break;
-        case 4:
-        case 5:
-        case 6:
-            HW_otherKeysUp();
-            break;
-        default:
-            DLog(@"Nope");
-            break;
-    }
-
-    isAttacking = NO;
-    doDim();
-}
-
-// issue certain action based on the tag of the button
--(IBAction) buttonPressed:(id) sender {
-    [self activateOverlay];
-    
-    if ([HWUtils isGameRunning] == NO)
-        return;
-    
-    if (isPopoverVisible)
-        [self dismissPopover];
-    
-    UIButton *theButton = (UIButton *)sender;
-    switch (theButton.tag) {
-        case 0:
-            if (isAttacking == NO)
-                HW_walkLeft();
-            break;
-        case 1:
-            if (isAttacking == NO)
-                HW_walkRight();
-            break;
-        case 2:
-            [self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
-            HW_preciseSet(!HW_isWeaponRope());
-            HW_aimUp();
-            break;
-        case 3:
-            [self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
-            HW_preciseSet(!HW_isWeaponRope());
-            HW_aimDown();
-            break;
-        case 4:
-            HW_shoot();
-            isAttacking = YES;
-            break;
-        case 5:
-            HW_jump();
-            break;
-        case 6:
-            HW_backjump();
-            break;
-        case 10:
-            [AudioManagerController playClickSound];
-            clearView();
-            HW_pause();
-            if (self.amvc.isVisible && IS_DUALHEAD() == NO) {
-                doDim();
-                [self.amvc disappear];
-            }
-            clearView();
-            [self showPopover];
-            break;
-        case 11:
-            [AudioManagerController playClickSound];
-            clearView();
-            
-            if (IS_DUALHEAD() || [[[NSUserDefaults standardUserDefaults] objectForKey:@"classic_menu"] boolValue] == NO) {
-                if (self.amvc == nil)
-                    self.amvc = [[AmmoMenuViewController alloc] init];
-
-                if (self.amvc.isVisible) {
-                    doDim();
-                    [self.amvc disappear];
-                } else {
-                    if (HW_isAmmoMenuNotAllowed() == NO) {
-                        doNotDim();
-                        [self.amvc appearInView:self.view];
-                    }
-                }
-            } else
-                HW_ammoMenu();
-            break;
-        default:
-            DLog(@"Nope");
-            break;
-    }
-}
-
--(void) unsetPreciseStatus {
-    HW_preciseSet(NO);
-}
-
--(void) sendHWClick {
-    HW_click();
-    clearView();
-    doDim();
-}
-
--(void) setGrenadeTime:(id) sender {
-    UISegmentedControl *theSegment = (UISegmentedControl *)sender;
-    if ([ObjcExports grenadeTime] != theSegment.selectedSegmentIndex) {
-        HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1);
-        [ObjcExports setGrenadeTime:theSegment.selectedSegmentIndex];
-    }
-}
-
-#pragma mark -
-#pragma mark in-game menu and help page
--(void) showHelp:(id) sender {
-    if (self.helpPage == nil) {
-        NSString *xibName = (IS_IPAD() ? @"HelpPageInGameViewController-iPad" : @"HelpPageInGameViewController-iPhone");
-        self.helpPage = [[HelpPageViewController alloc] initWithNibName:xibName bundle:nil];
-    }
-    self.helpPage.view.alpha = 0;
-    [self.view addSubview:helpPage.view];
-    [UIView beginAnimations:@"helpingame" context:NULL];
-    self.helpPage.view.alpha = 1;
-    [UIView commitAnimations];
-    doNotDim();
-}
-
-// show up a popover containing a popupMenuViewController; we hook it with setPopoverContentSize
-// on iphone instead just use the tableViewController directly (and implement manually all animations)
--(IBAction) showPopover{
-    CGRect screen = [[UIScreen mainScreen] bounds];
-    isPopoverVisible = YES;
-
-    if (IS_IPAD()) {
-        if (self.popupMenu == nil)
-            self.popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStylePlain];
-        if (self.popoverController == nil) {
-            self.popoverController = [[UIPopoverController alloc] initWithContentViewController:self.popupMenu];
-            [self.popoverController setPopoverContentSize:CGSizeMake(220, 200) animated:YES];
-            [self.popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]];
-        }
-
-        [self.popoverController presentPopoverFromRect:CGRectMake(screen.size.height / 2, screen.size.width / 2, 1, 1)
-                                           inView:self.view
-                         permittedArrowDirections:UIPopoverArrowDirectionAny
-                                         animated:YES];
-    } else {
-        if (self.popupMenu == nil)
-            self.popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
-        [self.view addSubview:popupMenu.view];
-        [self.popupMenu present];
-    }
-    self.popupMenu.tableView.scrollEnabled = NO;
-}
-
-// on ipad just dismiss it, on iphone transtion to the right
--(void) dismissPopover {
-    if (YES == isPopoverVisible) {
-        isPopoverVisible = NO;
-        if (HW_isPaused())
-            HW_pauseToggle();
-
-        [self.popupMenu dismiss];
-        if (IS_IPAD())
-            [self.popoverController dismissPopoverAnimated:YES];
-
-        [self buttonReleased:nil];
-    }
-}
-
-#pragma mark -
-#pragma mark Custom touch event handling
--(BOOL) shouldIgnoreTouch:(NSSet *)allTouches {
-    if ([HWUtils isGameRunning] == NO)
-        return YES;
-
-    // ignore activity near the dpad and buttons
-    CGPoint touchPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
-    CGSize screen = [[UIScreen mainScreen] bounds].size;
-
-    if ((touchPoint.x < 160 && touchPoint.y > screen.width - 155 ) || 
-        (touchPoint.x > screen.height - 135 && touchPoint.y > screen.width - 140))
-        return YES;
-    return NO;
-}
-
--(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
-    NSSet *allTouches = [event allTouches];
-    UITouch *first, *second;
-
-    if ([self shouldIgnoreTouch:allTouches] == YES)
-        return;
-
-    // hide in-game menu
-    if (isPopoverVisible)
-        [self dismissPopover];
-
-    if (self.amvc.isVisible && IS_DUALHEAD() == NO) {
-        doDim();
-        [self.amvc disappear];
-    }
-    // reset default dimming
-    doDim();
-
-    HW_setPianoSound([allTouches count]);
-
-    switch ([allTouches count]) {
-        case 1:
-            startingPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
-            if (2 == [[[allTouches allObjects] objectAtIndex:0] tapCount])
-                HW_zoomReset();
-            break;
-        case 2:
-            if (2 == [[[allTouches allObjects] objectAtIndex:0] tapCount])
-                HW_screenshot();
-            else {
-                // pinching
-                first = [[allTouches allObjects] objectAtIndex:0];
-                second = [[allTouches allObjects] objectAtIndex:1];
-                initialDistanceForPinching = distanceBetweenPoints([first locationInView:self.view], [second locationInView:self.view]);
-            }
-            break;
-        default:
-            break;
-    }
-}
-
--(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
-    NSSet *allTouches = [event allTouches];
-    if ([self shouldIgnoreTouch:allTouches] == YES)
-        return;
-
-    CGRect screen = [[UIScreen mainScreen] bounds];
-    CGPoint currentPosition = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
-
-    switch ([allTouches count]) {
-        case 1:
-            // if we're in the menu we just click in the point
-            if (HW_isAmmoMenuOpen()) {
-                HW_setCursor(HWXZ(currentPosition.x), HWYZ(currentPosition.y));
-                // this click doesn't need any wrapping because the ammoMenu already limits the cursor
-                HW_click();
-            } else
-                // if weapon requires a further click, ask for tapping again
-                if (HW_isWeaponRequiringClick()) {
-                    // here don't have to wrap thanks to isCursorVisible magic
-                    HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
-
-                    // draw the button at the last touched point (which is the current position)
-                    if (self.confirmButton == nil) {
-                        UIButton *tapAgain = [UIButton buttonWithType:UIButtonTypeRoundedRect];
-                        [tapAgain addTarget:self action:@selector(sendHWClick) forControlEvents:UIControlEventTouchUpInside];
-                        [tapAgain setTitle:NSLocalizedString(@"Set!",@"on the overlay") forState:UIControlStateNormal];
-                        self.confirmButton = tapAgain;
-                    }
-                    self.confirmButton.alpha = 0;
-                    self.confirmButton.frame = CGRectMake(currentPosition.x - 75, currentPosition.y + 25, 150, 40);
-                    [self.view addSubview:self.confirmButton];
-
-                    // animation ftw!
-                    [UIView beginAnimations:@"inserting button" context:NULL];
-                    [UIView setAnimationDuration:ANIMATION_DURATION];
-                    self.confirmButton.alpha = 1;
-                    [UIView commitAnimations];
-
-                    // keep the overlay active, or the button will fade
-                    [self activateOverlay];
-                    doNotDim();
-                } else
-                    if (HW_isWeaponTimerable()) {
-                        if (self.grenadeTimeSegment.tag != 0) {
-                            [UIView beginAnimations:@"removing segmented control" context:NULL];
-                            [UIView setAnimationDuration:ANIMATION_DURATION];
-                            self.grenadeTimeSegment.alpha = 0;
-                            [UIView commitAnimations];
-
-                            [self.grenadeTimeSegment performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:ANIMATION_DURATION];
-                            self.grenadeTimeSegment.tag = 0;
-                        } else {
-                            if (self.grenadeTimeSegment == nil) {
-                                NSArray *items = [[NSArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",nil];
-                                UISegmentedControl *grenadeSegment = [[UISegmentedControl alloc] initWithItems:items];
-                                [items release];
-                                [grenadeSegment addTarget:self action:@selector(setGrenadeTime:) forControlEvents:UIControlEventValueChanged];
-                                self.grenadeTimeSegment = grenadeSegment;
-                                [grenadeSegment release];
-                            }
-                            self.grenadeTimeSegment.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width, 250, 50);
-                            self.grenadeTimeSegment.selectedSegmentIndex = [ObjcExports grenadeTime];
-                            self.grenadeTimeSegment.alpha = 1;
-                            [self.view addSubview:self.grenadeTimeSegment];
-
-                            [UIView beginAnimations:@"inserting segmented control" context:NULL];
-                            [UIView setAnimationDuration:ANIMATION_DURATION];
-                            [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
-                            self.grenadeTimeSegment.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width - 100, 250, 50);
-                            [UIView commitAnimations];
-
-                            self.grenadeTimeSegment.tag++;
-                            [self activateOverlay];
-                            doNotDim();
-                        }
-                    } else
-                        if (HW_isWeaponSwitch())
-                            HW_tab();
-            break;
-        case 2:
-            HW_allKeysUp();
-            break;
-        default:
-            break;
-    }
-
-    initialDistanceForPinching = 0;
-}
-
--(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
-    [self touchesEnded:touches withEvent:event];
-}
-
--(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
-    NSSet *allTouches = [event allTouches];
-    if ([self shouldIgnoreTouch:allTouches] == YES)
-        return;
-
-    CGRect screen = [[UIScreen mainScreen] bounds];
-    int x, y, dx, dy;
-    UITouch *touch, *first, *second;
-
-    switch ([allTouches count]) {
-        case 1:
-            touch = [[allTouches allObjects] objectAtIndex:0];
-            CGPoint currentPosition = [touch locationInView:self.view];
-
-            if (HW_isAmmoMenuOpen()) {
-                // no zoom consideration for this
-                HW_setCursor(HWXZ(currentPosition.x), HWYZ(currentPosition.y));
-            } else
-                if (HW_isWeaponRequiringClick()) {
-                    // moves the cursor around wrt zoom
-                    HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
-                } else {
-                    // panning \o/
-                    dx = startingPoint.x - currentPosition.x;
-                    dy = currentPosition.y - startingPoint.y;
-                    HW_getCursor(&x, &y);
-                    // momentum (or something like that)
-                    /*if (abs(dx) > 40)
-                        dx *= log(abs(dx)/4);
-                    if (abs(dy) > 40)
-                        dy *= log(abs(dy)/4);*/
-                    HW_setCursor(x + dx/HW_zoomFactor(), y + dy/HW_zoomFactor());
-                    startingPoint = currentPosition;
-                }
-            break;
-        case 2:
-            first = [[allTouches allObjects] objectAtIndex:0];
-            second = [[allTouches allObjects] objectAtIndex:1];
-            CGFloat currentDistanceOfPinching = distanceBetweenPoints([first locationInView:self.view], [second locationInView:self.view]);
-            const int pinchDelta = 40;
-
-            if (0 != initialDistanceForPinching) {
-                if (currentDistanceOfPinching - initialDistanceForPinching > pinchDelta) {
-                    HW_zoomIn();
-                    initialDistanceForPinching = currentDistanceOfPinching;
-                }
-                else if (initialDistanceForPinching - currentDistanceOfPinching > pinchDelta) {
-                    HW_zoomOut();
-                    initialDistanceForPinching = currentDistanceOfPinching;
-                }
-            } else
-                initialDistanceForPinching = currentDistanceOfPinching;
-            break;
-        default:
-            break;
-    }
-}
-
-@end
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.xib	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1014 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
-	<data>
-		<int key="IBDocument.SystemTarget">1056</int>
-		<string key="IBDocument.SystemVersion">10H574</string>
-		<string key="IBDocument.InterfaceBuilderVersion">823</string>
-		<string key="IBDocument.AppKitVersion">1038.35</string>
-		<string key="IBDocument.HIToolboxVersion">461.00</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-			<string key="NS.object.0">132</string>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="1"/>
-		</object>
-		<object class="NSArray" key="IBDocument.PluginDependencies">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.Metadata">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys" id="0">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-			</object>
-		</object>
-		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="IBProxyObject" id="372490531">
-				<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-			<object class="IBProxyObject" id="975951072">
-				<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-			<object class="IBUIView" id="191373211">
-				<reference key="NSNextResponder"/>
-				<int key="NSvFlags">274</int>
-				<object class="NSMutableArray" key="NSSubviews">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBUIButton" id="584263820">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">268</int>
-						<string key="NSFrame">{{0, 229}, {50, 50}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<object class="NSFont" key="IBUIFont" id="969592940">
-							<string key="NSName">Helvetica-Bold</string>
-							<double key="NSSize">15</double>
-							<int key="NSfFlags">16</int>
-						</object>
-						<object class="NSColor" key="IBUIHighlightedTitleColor" id="708011311">
-							<int key="NSColorSpace">3</int>
-							<bytes key="NSWhite">MQA</bytes>
-						</object>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<object class="NSColor" key="IBUINormalTitleShadowColor" id="280149554">
-							<int key="NSColorSpace">3</int>
-							<bytes key="NSWhite">MC41AA</bytes>
-						</object>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">arrowLeft.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="123494776">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">268</int>
-						<string key="NSFrame">{{87, 229}, {50, 50}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">1</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">arrowRight.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="590902961">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">265</int>
-						<string key="NSFrame">{{412, 236}, {64, 64}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">5</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">joyButtonBackJump.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="132251648">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">265</int>
-						<string key="NSFrame">{{365, 203}, {64, 64}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">6</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">joyButtonForwardJump.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="752933969">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">265</int>
-						<string key="NSFrame">{{354, 256}, {64, 64}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">4</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">joyButtonAttack.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="261686746">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">268</int>
-						<string key="NSFrame">{{44, 187}, {50, 50}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">2</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">arrowUp.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="81315603">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">268</int>
-						<string key="NSFrame">{{44, 270}, {50, 50}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">3</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">arrowDown.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="309477778">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">289</int>
-						<string key="NSFrame">{{341, 0}, {64, 50}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">10</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">cornerButton.png</string>
-						</object>
-					</object>
-					<object class="IBUIButton" id="50885250">
-						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">289</int>
-						<string key="NSFrame">{{402, 0}, {78, 50}}</string>
-						<reference key="NSSuperview" ref="191373211"/>
-						<bool key="IBUIOpaque">NO</bool>
-						<bool key="IBUIMultipleTouchEnabled">YES</bool>
-						<int key="IBUITag">11</int>
-						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-						<int key="IBUIContentHorizontalAlignment">0</int>
-						<int key="IBUIContentVerticalAlignment">0</int>
-						<reference key="IBUIFont" ref="969592940"/>
-						<reference key="IBUIHighlightedTitleColor" ref="708011311"/>
-						<object class="NSColor" key="IBUINormalTitleColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
-						</object>
-						<reference key="IBUINormalTitleShadowColor" ref="280149554"/>
-						<object class="NSCustomResource" key="IBUINormalImage">
-							<string key="NSClassName">NSImage</string>
-							<string key="NSResourceName">ammoButton.png</string>
-						</object>
-					</object>
-				</object>
-				<string key="NSFrameSize">{480, 320}</string>
-				<reference key="NSSuperview"/>
-				<object class="NSColor" key="IBUIBackgroundColor">
-					<int key="NSColorSpace">3</int>
-					<bytes key="NSWhite">MSAwAA</bytes>
-				</object>
-				<bool key="IBUIOpaque">NO</bool>
-				<bool key="IBUIClipsSubviews">YES</bool>
-				<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
-				<bool key="IBUIMultipleTouchEnabled">YES</bool>
-				<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
-					<int key="interfaceOrientation">3</int>
-				</object>
-				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-			</object>
-		</object>
-		<object class="IBObjectContainer" key="IBDocument.Objects">
-			<object class="NSMutableArray" key="connectionRecords">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">view</string>
-						<reference key="source" ref="372490531"/>
-						<reference key="destination" ref="191373211"/>
-					</object>
-					<int key="connectionID">3</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="584263820"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">8</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="584263820"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">9</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="584263820"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">10</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="584263820"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">11</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="123494776"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">13</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="123494776"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">14</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="123494776"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">15</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="123494776"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">16</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="261686746"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">18</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="261686746"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">19</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="261686746"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">20</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="261686746"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">21</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="81315603"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">23</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="81315603"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">24</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="81315603"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">25</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="81315603"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">26</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="590902961"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">44</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="590902961"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">45</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="590902961"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">46</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="590902961"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">47</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="752933969"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">49</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="752933969"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">50</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="752933969"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">51</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="752933969"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">52</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="132251648"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">54</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="132251648"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">55</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="132251648"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">1</int>
-					</object>
-					<int key="connectionID">56</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="132251648"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">8</int>
-					</object>
-					<int key="connectionID">57</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="309477778"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">60</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonPressed:</string>
-						<reference key="source" ref="50885250"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">7</int>
-					</object>
-					<int key="connectionID">68</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">buttonReleased:</string>
-						<reference key="source" ref="50885250"/>
-						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">9</int>
-					</object>
-					<int key="connectionID">69</int>
-				</object>
-			</object>
-			<object class="IBMutableOrderedSet" key="objectRecords">
-				<object class="NSArray" key="orderedObjects">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<object class="IBObjectRecord">
-						<int key="objectID">0</int>
-						<reference key="object" ref="0"/>
-						<reference key="children" ref="1000"/>
-						<nil key="parent"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">1</int>
-						<reference key="object" ref="191373211"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="590902961"/>
-							<reference ref="81315603"/>
-							<reference ref="584263820"/>
-							<reference ref="261686746"/>
-							<reference ref="123494776"/>
-							<reference ref="132251648"/>
-							<reference ref="752933969"/>
-							<reference ref="50885250"/>
-							<reference ref="309477778"/>
-						</object>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-1</int>
-						<reference key="object" ref="372490531"/>
-						<reference key="parent" ref="0"/>
-						<string key="objectName">File's Owner</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">-2</int>
-						<reference key="object" ref="975951072"/>
-						<reference key="parent" ref="0"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">4</int>
-						<reference key="object" ref="584263820"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">left</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">12</int>
-						<reference key="object" ref="123494776"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">right</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">17</int>
-						<reference key="object" ref="261686746"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">up</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">22</int>
-						<reference key="object" ref="81315603"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">down</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">43</int>
-						<reference key="object" ref="590902961"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">push2</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">48</int>
-						<reference key="object" ref="752933969"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">push1</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">53</int>
-						<reference key="object" ref="132251648"/>
-						<reference key="parent" ref="191373211"/>
-						<string key="objectName">push3</string>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">58</int>
-						<reference key="object" ref="309477778"/>
-						<reference key="parent" ref="191373211"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">67</int>
-						<reference key="object" ref="50885250"/>
-						<reference key="parent" ref="191373211"/>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="flattenedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="NSArray" key="dict.sortedKeys">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>-1.CustomClassName</string>
-					<string>-2.CustomClassName</string>
-					<string>1.IBEditorWindowLastContentRect</string>
-					<string>1.IBPluginDependency</string>
-					<string>12.IBPluginDependency</string>
-					<string>12.IBViewBoundsToFrameTransform</string>
-					<string>17.IBPluginDependency</string>
-					<string>22.IBPluginDependency</string>
-					<string>4.IBPluginDependency</string>
-					<string>43.IBPluginDependency</string>
-					<string>48.IBPluginDependency</string>
-					<string>53.IBPluginDependency</string>
-					<string>58.IBPluginDependency</string>
-					<string>67.IBPluginDependency</string>
-				</object>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-					<string>OverlayViewController</string>
-					<string>UIResponder</string>
-					<string>{{690, 375}, {480, 320}}</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<object class="NSAffineTransform">
-						<bytes key="NSTransformStruct">P4AAAL+AAABCkAAAw5SAAA</bytes>
-					</object>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-				</object>
-			</object>
-			<object class="NSMutableDictionary" key="unlocalizedProperties">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="activeLocalization"/>
-			<object class="NSMutableDictionary" key="localizations">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<reference key="dict.sortedKeys" ref="0"/>
-				<object class="NSMutableArray" key="dict.values">
-					<bool key="EncodedWithXMLCoder">YES</bool>
-				</object>
-			</object>
-			<nil key="sourceID"/>
-			<int key="maxID">72</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">OverlayViewController</string>
-					<string key="superclassName">UIViewController</string>
-					<object class="NSMutableDictionary" key="actions">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>buttonPressed:</string>
-							<string>buttonReleased:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>id</string>
-							<string>id</string>
-						</object>
-					</object>
-					<object class="NSMutableDictionary" key="actionInfosByName">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>buttonPressed:</string>
-							<string>buttonReleased:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBActionInfo">
-								<string key="name">buttonPressed:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">buttonReleased:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">Classes/OverlayViewController.h</string>
-					</object>
-				</object>
-			</object>
-			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="917531033">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIButton</string>
-					<string key="superclassName">UIControl</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIButton.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIControl</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIResponder</string>
-					<string key="superclassName">NSObject</string>
-					<reference key="sourceIdentifier" ref="917531033"/>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchBar</string>
-					<string key="superclassName">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UISearchDisplayController</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIView</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">UIViewController</string>
-					<string key="superclassName">UIResponder</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBFrameworkSource</string>
-						<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
-					</object>
-				</object>
-			</object>
-		</object>
-		<int key="IBDocument.localizationMode">0</int>
-		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
-			<integer value="1056" key="NS.object.0"/>
-		</object>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
-			<integer value="3100" key="NS.object.0"/>
-		</object>
-		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
-		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
-		<int key="IBDocument.defaultPropertyAccessControl">3</int>
-		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<bool key="EncodedWithXMLCoder">YES</bool>
-			<object class="NSArray" key="dict.sortedKeys">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>ammoButton.png</string>
-				<string>arrowDown.png</string>
-				<string>arrowLeft.png</string>
-				<string>arrowRight.png</string>
-				<string>arrowUp.png</string>
-				<string>cornerButton.png</string>
-				<string>joyButtonAttack.png</string>
-				<string>joyButtonBackJump.png</string>
-				<string>joyButtonForwardJump.png</string>
-			</object>
-			<object class="NSMutableArray" key="dict.values">
-				<bool key="EncodedWithXMLCoder">YES</bool>
-				<string>{78, 50}</string>
-				<string>{50, 50}</string>
-				<string>{50, 50}</string>
-				<string>{50, 50}</string>
-				<string>{50, 50}</string>
-				<string>{60, 50}</string>
-				<string>{64, 64}</string>
-				<string>{64, 64}</string>
-				<string>{64, 64}</string>
-			</object>
-		</object>
-		<string key="IBCocoaTouchPluginVersion">132</string>
-	</data>
-</archive>
--- a/project_files/HedgewarsMobile/Classes/PascalImports.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/PascalImports.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 07/01/2010.
  */
 
 
@@ -27,7 +25,7 @@
 #endif
 
     /* add C declarations below for all exported Pascal functions/procedure
-     * that you want to use
+     * that you want to use in your non-Pascal code
      */
 
     void Game(const char *args[]);
@@ -35,69 +33,17 @@
     void LoadLocaleWrapper(const char *filename);
 
     void HW_versionInfo(int *protoNum, char **versionStr);
-
-    void HW_click(void);
-    void HW_ammoMenu(void);
-    
-    void HW_zoomSet(float value);
-    void HW_zoomIn(void);
-    void HW_zoomOut(void);
-    void HW_zoomReset(void);
-    float HW_zoomFactor(void);
-    int  HW_zoomLevel(void);
-
-    void HW_walkingKeysUp(void);
-    void HW_otherKeysUp(void);
-    void HW_allKeysUp(void);
-
-    void HW_walkLeft(void);
-    void HW_walkRight(void);
-    void HW_aimUp(void);
-    void HW_aimDown(void);
-    void HW_preciseSet(BOOL status);
-
-    void HW_shoot(void);
-    void HW_jump(void);
-    void HW_backjump(void);
-
-    void HW_chat(void);
-    void HW_chatEnd(void);
-    void HW_tab(void);
-    void HW_screenshot(void);
-
-    void HW_pause(void);
-    void HW_pauseToggle(void);
-    BOOL HW_isPaused(void);
-
     void *HW_getSDLWindow(void);
     void HW_terminate(BOOL andCloseFrontend);
 
-    void HW_setCursor(int x, int y);
-    void HW_getCursor(int *x, int *y);
-
-    BOOL HW_isAmmoMenuOpen(void);
-    BOOL HW_isAmmoMenuNotAllowed(void);
-    BOOL HW_isWeaponRequiringClick(void);
-    BOOL HW_isWeaponTimerable(void);
-    BOOL HW_isWeaponSwitch(void);
-    BOOL HW_isWeaponRope(void);
-
-    void HW_setGrenadeTime(int time);
-    void HW_setPianoSound(int snd);
-    
-    void HW_setWeapon(int whichone);
-    BOOL HW_isWeaponAnEffect(int whichone);
     char *HW_getWeaponNameByIndex(int whichone);
-    char *HW_getWeaponCaptionByIndex(int whichone);
-    char *HW_getWeaponDescriptionByIndex(int whichone);
-
-    void HW_getAmmoDelays(unsigned char *pointer);
-    int  HW_getAmmoCounts(int *pointer);
-    
+    //char *HW_getWeaponCaptionByIndex(int whichone);
+    //char *HW_getWeaponDescriptionByIndex(int whichone);
     int  HW_getNumberOfWeapons(void);
-    int  HW_getTurnsForCurrentTeam(void);
     int  HW_getMaxNumberOfHogs(void);
     int  HW_getMaxNumberOfTeams(void);
+
+    void HW_memoryWarningCallback(void);
     
 #ifdef __cplusplus
 }
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController-iPad.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController-iPad.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -42,6 +42,18 @@
 				<int key="NSvFlags">274</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="138553579">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">319</int>
+						<string key="NSFrameSize">{540, 640}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">smallerBackground~ipad.png</string>
+						</object>
+					</object>
 					<object class="IBUIButton" id="155385540">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">302</int>
@@ -90,7 +102,7 @@
 					</object>
 					<object class="IBUILabel" id="655269955">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">315</int>
+						<int key="NSvFlags">295</int>
 						<string key="NSFrame">{{216, 35}, {108, 29}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -115,7 +127,7 @@
 					</object>
 					<object class="IBUILabel" id="19933541">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">307</int>
+						<int key="NSvFlags">282</int>
 						<string key="NSFrame">{{80, 375}, {380, 96}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -141,7 +153,7 @@
 					</object>
 					<object class="IBUILabel" id="151967545">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">307</int>
+						<int key="NSvFlags">306</int>
 						<string key="NSFrame">{{80, 87}, {380, 96}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -163,7 +175,7 @@
 					</object>
 					<object class="IBUIImageView" id="129485928">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">300</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{150, 191}, {240, 160}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -234,6 +246,7 @@
 							<reference ref="19933541"/>
 							<reference ref="151967545"/>
 							<reference ref="129485928"/>
+							<reference ref="138553579"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -278,6 +291,11 @@
 						<reference key="object" ref="151967545"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">24</int>
+						<reference key="object" ref="138553579"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -300,12 +318,14 @@
 					<string>20.IBViewBoundsToFrameTransform</string>
 					<string>23.IBPluginDependency</string>
 					<string>23.IBViewBoundsToFrameTransform</string>
+					<string>24.IBPluginDependency</string>
+					<string>24.IBViewBoundsToFrameTransform</string>
 				</object>
 				<object class="NSMutableArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>RestoreViewController</string>
 					<string>UIResponder</string>
-					<string>{{566, 244}, {540, 640}}</string>
+					<string>{{650, 289}, {540, 640}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
@@ -331,6 +351,8 @@
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">P4AAAL+AAABCoAAAw9uAAA</bytes>
 					</object>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform"/>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -349,7 +371,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">23</int>
+			<int key="maxID">24</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -373,6 +395,13 @@
 						<string key="minorKey">Classes/RestoreViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -608,8 +637,17 @@
 		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
 		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<string key="NS.key.0">denied.png</string>
-			<string key="NS.object.0">{240, 160}</string>
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>denied.png</string>
+				<string>smallerBackground~ipad.png</string>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>{240, 160}</string>
+				<string>{540, 640}</string>
+			</object>
 		</object>
 		<string key="IBCocoaTouchPluginVersion">132</string>
 	</data>
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController-iPhone.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController-iPhone.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -42,6 +42,18 @@
 				<int key="NSvFlags">274</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="396922791">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">319</int>
+						<string key="NSFrameSize">{480, 320}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">smallerBackground~iphone.png</string>
+						</object>
+					</object>
 					<object class="IBUIImageView" id="508553704">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">300</int>
@@ -211,6 +223,7 @@
 							<reference ref="785455561"/>
 							<reference ref="531154203"/>
 							<reference ref="472385208"/>
+							<reference ref="396922791"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -250,6 +263,11 @@
 						<reference key="object" ref="923913762"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">15</int>
+						<reference key="object" ref="396922791"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -262,6 +280,8 @@
 					<string>1.IBPluginDependency</string>
 					<string>10.IBPluginDependency</string>
 					<string>10.IBViewBoundsToFrameTransform</string>
+					<string>15.IBPluginDependency</string>
+					<string>15.IBViewBoundsToFrameTransform</string>
 					<string>5.IBPluginDependency</string>
 					<string>5.IBViewBoundsToFrameTransform</string>
 					<string>6.IBPluginDependency</string>
@@ -282,6 +302,8 @@
 						<bytes key="NSTransformStruct">AUOKgABDZQAAA</bytes>
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform"/>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">AUGgAABBoAAAA</bytes>
 					</object>
@@ -315,7 +337,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">14</int>
+			<int key="maxID">15</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -339,6 +361,13 @@
 						<string key="minorKey">Classes/RestoreViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -574,8 +603,17 @@
 		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
 		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<string key="NS.key.0">denied.png</string>
-			<string key="NS.object.0">{240, 160}</string>
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>denied.png</string>
+				<string>smallerBackground~iphone.png</string>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>{240, 160}</string>
+				<string>{480, 320}</string>
+			</object>
 		</object>
 		<string key="IBCocoaTouchPluginVersion">132</string>
 	</data>
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 28/05/2011.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 28/05/2011.
  */
 
 
@@ -24,21 +22,20 @@
 
 @implementation RestoreViewController
 
-// Override to allow orientations other than the default portrait orientation.
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
-
 -(IBAction) buttonReleased:(id) sender {
     UIButton *theButton = (UIButton *)sender;
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 
     if (theButton.tag != 0) {
-        [AudioManagerController playClickSound];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"launchRestoredGame" object:nil];
+        [[AudioManagerController mainManager] playClickSound];
+        [GameInterfaceBridge registerCallingController:self.parentViewController];
+        [GameInterfaceBridge startSaveGame:[[NSUserDefaults standardUserDefaults] objectForKey:@"savedGamePath"]];
     } else {
-        [AudioManagerController playBackSound];
+        [[AudioManagerController mainManager] playBackSound];
         [defaults setObject:@"" forKey:@"savedGamePath"];
         [defaults synchronize];
     }
@@ -46,14 +43,6 @@
 }
 
 -(void) viewDidLoad {
-    NSString *imgName;
-    if (IS_IPAD())
-        imgName = @"smallerBackground~ipad.png";
-    else
-        imgName = @"smallerBackground~iphone.png";
-    UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
-    [img release];
     [super viewDidLoad];
 }
 
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,10 @@
  * 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 created on 22/09/2010.
  */
 
 
 #import <UIKit/UIKit.h>
-#import "EditableCellView.h"
 
 
 @interface SavedGamesViewController : UIViewController <UITableViewDelegate, UITableViewDataSource,
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 22/09/2010.
  */
 
 
@@ -41,13 +39,16 @@
 }
 
 -(void) viewDidLoad {
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
-        self.tableView.backgroundView = nil;
+    [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]];
 
     NSString *imgName = (IS_IPAD()) ? @"mediumBackground~ipad.png" : @"smallerBackground~iphone.png";
     UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
+    UIImageView *background = [[UIImageView alloc] initWithImage:img];
     [img release];
+    background.frame = self.view.frame;
+    background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view insertSubview:background atIndex:0];
+    [background release];
 
     if (self.listOfSavegames == nil)
         [self updateTable];
@@ -65,7 +66,7 @@
     UIButton *button = (UIButton *)sender;
 
     if (button.tag == 0) {
-        [AudioManagerController playBackSound];
+        [[AudioManagerController mainManager] playBackSound];
         [self.tableView setEditing:NO animated:YES];
         [[self parentViewController] dismissModalViewControllerAnimated:YES];
     } else {
@@ -189,6 +190,7 @@
     self.numberOfItems++;
     [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
 
+    [GameInterfaceBridge registerCallingController:self];
     [GameInterfaceBridge startSaveGame:currentFilePath];
     [currentFilePath release];
 }
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib	Sun Oct 28 13:28:23 2012 +0100
@@ -12,7 +12,7 @@
 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="4"/>
+			<integer value="7"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -78,8 +78,8 @@
 						<string key="NSFrame">{{0, 44}, {768, 724}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<object class="NSColor" key="IBUIBackgroundColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MCAwIDAgMAA</bytes>
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MCAwAA</bytes>
 						</object>
 						<bool key="IBUIClipsSubviews">YES</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -273,42 +273,14 @@
 					<string key="className">SavedGamesViewController</string>
 					<string key="superclassName">UIViewController</string>
 					<object class="NSMutableDictionary" key="actions">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>buttonPressed:</string>
-							<string>clearAll:</string>
-							<string>toggleEdit:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>id</string>
-							<string>id</string>
-							<string>id</string>
-						</object>
+						<string key="NS.key.0">buttonPressed:</string>
+						<string key="NS.object.0">id</string>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>buttonPressed:</string>
-							<string>clearAll:</string>
-							<string>toggleEdit:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBActionInfo">
-								<string key="name">buttonPressed:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">clearAll:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">toggleEdit:</string>
-								<string key="candidateClassName">id</string>
-							</object>
+						<string key="NS.key.0">buttonPressed:</string>
+						<object class="IBActionInfo" key="NS.object.0">
+							<string key="name">buttonPressed:</string>
+							<string key="candidateClassName">id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="outlets">
@@ -327,6 +299,13 @@
 						<string key="minorKey">Classes/SavedGamesViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UITableView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 19/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @class SingleSchemeViewController;
 
 @interface SchemeSettingsViewController : UITableViewController {
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,15 +14,13 @@
  * 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 created on 19/04/2010.
  */
 
 
 #import "SchemeSettingsViewController.h"
-#import "CreationChamber.h"
 #import "SingleSchemeViewController.h"
 
+
 @implementation SchemeSettingsViewController
 @synthesize listOfSchemes;
 
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 13/06/2010.
  */
 
 
@@ -23,8 +21,6 @@
 
 
 @interface SchemeWeaponConfigViewController : UIViewController <UITableViewDelegate,UITableViewDataSource> {
-    UITableView *tableView;
-
     NSArray *listOfSchemes;
     NSArray *listOfWeapons;
     NSArray *listOfScripts;
@@ -42,7 +38,6 @@
     BOOL sectionsHidden;
 }
 
-@property (nonatomic,retain) UITableView *tableView;
 @property (nonatomic,retain) NSArray *listOfSchemes;
 @property (nonatomic,retain) NSArray *listOfWeapons;
 @property (nonatomic,retain) NSArray *listOfScripts;
@@ -56,7 +51,7 @@
 @property (nonatomic,retain) UISegmentedControl *topControl;
 @property (nonatomic,assign) BOOL sectionsHidden;
 
-+(void) fillInstanceSections;
-+(void) emptyInstanceSections;
+-(void) fillSections;
+-(void) emptySections;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 13/06/2010.
  */
 
 
@@ -24,11 +22,10 @@
 
 
 #define LABEL_TAG 57423
-
-static SchemeWeaponConfigViewController *controllerInstance;
+#define TABLE_TAG 45657
 
 @implementation SchemeWeaponConfigViewController
-@synthesize tableView, listOfSchemes, listOfWeapons, listOfScripts, lastIndexPath_sc, lastIndexPath_we, lastIndexPath_lu,
+@synthesize listOfSchemes, listOfWeapons, listOfScripts, lastIndexPath_sc, lastIndexPath_we, lastIndexPath_lu,
             selectedScheme, selectedWeapon, selectedScript, scriptCommand, topControl, sectionsHidden;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
@@ -75,7 +72,8 @@
 
 -(NSArray *)listOfScripts {
     if (listOfScripts == nil)
-        self.listOfScripts = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCRIPTS_DIRECTORY() error:NULL];
+        self.listOfScripts = [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCRIPTS_DIRECTORY() error:NULL]
+                              filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF ENDSWITH '.lua'"]];
     return listOfScripts;
 }
 
@@ -91,7 +89,6 @@
         controller.tintColor = [UIColor lightGrayColor];
         controller.selectedSegmentIndex = 0;
         self.topControl = controller;
-        [controller addTarget:self.tableView action:@selector(reloadData) forControlEvents:UIControlEventValueChanged];
         [controller release];
     }
     return topControl;
@@ -102,16 +99,29 @@
 -(void) viewDidLoad {
     self.sectionsHidden = NO;
 
-    UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)
+    NSInteger topOffset = IS_IPAD() ? 45 : 0;
+    NSInteger bottomOffset = IS_IPAD() ? 3 : 0;
+    UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,
+                                                                            topOffset,
+                                                                            self.view.frame.size.width,
+                                                                            self.view.frame.size.height - topOffset - bottomOffset)
                                                            style:UITableViewStyleGrouped];
     aTableView.delegate = self;
     aTableView.dataSource = self;
     if (IS_IPAD()) {
-        [aTableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]];
-        aTableView.layer.borderColor = [[UIColor darkYellowColor] CGColor];
-        aTableView.layer.borderWidth = 2.7f;
-        aTableView.layer.cornerRadius = 8;
-        aTableView.contentInset = UIEdgeInsetsMake(5, 0, 5, 0);
+        [aTableView setBackgroundColorForAnyTable:[UIColor clearColor]];
+        UILabel *background = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)
+                                                    andTitle:nil
+                                             withBorderWidth:2.7f];
+        background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        [self.view insertSubview:background atIndex:0];
+        [background release];
+
+        self.topControl.frame = CGRectMake(0, 4, self.view.frame.size.width * 80/100, 30);
+        self.topControl.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
+        self.topControl.center = CGPointMake(self.view.frame.size.width/2, 24);
+        [self.topControl addTarget:aTableView action:@selector(reloadData) forControlEvents:UIControlEventValueChanged];
+        [self.view addSubview:self.topControl];
     } else {
         UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"];
         UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage];
@@ -121,20 +131,30 @@
         [aTableView setBackgroundColorForAnyTable:[UIColor clearColor]];
     }
 
+    aTableView.tag = TABLE_TAG;
     aTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
     aTableView.separatorColor = [UIColor whiteColor];
     aTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
-    self.tableView = aTableView;
+    aTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:aTableView];
     [aTableView release];
-    [self.view addSubview:self.tableView];
 
     [super viewDidLoad];
-    controllerInstance = self;
+
+    // display or hide the lists, driven by MapConfigViewController
+    [[NSNotificationCenter defaultCenter] addObserver:self
+                                             selector:@selector(fillSections)
+                                                 name:@"fillsections"
+                                               object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self
+                                             selector:@selector(emptySections)
+                                                 name:@"emptysections"
+                                               object:nil];
 }
 
 #pragma mark -
 #pragma mark Table view data source
--(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
+-(NSInteger) numberOfSectionsInTableView:(UITableView *)aTableView {
     return (self.sectionsHidden ? 0 : 1);
 }
 
@@ -183,11 +203,9 @@
             self.lastIndexPath_we = indexPath;
         }
     } else {
-        cell.textLabel.text = [[self.listOfScripts objectAtIndex:row] stringByDeletingPathExtension];
-        NSString *str = [NSString stringWithFormat:@"%@/%@",SCRIPTS_DIRECTORY(),[self.listOfScripts objectAtIndex:row]];
-        NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:str];
-        cell.detailTextLabel.text = [dict objectForKey:@"description"];
-        [dict release];
+        cell.textLabel.text = [[[self.listOfScripts objectAtIndex:row] stringByDeletingPathExtension]
+                               stringByReplacingOccurrencesOfString:@"_" withString:@" "];
+        //cell.detailTextLabel.text = ;
         if ([[self.listOfScripts objectAtIndex:row] isEqualToString:self.selectedScript]) {
             UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
             cell.accessoryView = checkbox;
@@ -204,16 +222,46 @@
     return cell;
 }
 
--(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
-    return 50.0;
+-(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger) section {
+    return IS_IPAD() ? 0 : 50;
+}
+
+-(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger) section {
+    if (IS_IPAD())
+        return nil;
+    UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 30)];
+    theView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    self.topControl.frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
+    self.topControl.center = CGPointMake(self.view.frame.size.width/2, 24);
+    [self.topControl addTarget:aTableView action:@selector(reloadData) forControlEvents:UIControlEventValueChanged];
+    [theView addSubview:self.topControl];
+    return [theView autorelease];
+}
+
+-(CGFloat) tableView:(UITableView *)aTableView heightForFooterInSection:(NSInteger) section {
+    return 40;
 }
 
--(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
-    UIView *theView = [[[UIView alloc] init] autorelease];
-    self.topControl.frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
-    self.topControl.center = CGPointMake(self.view.frame.size.width/2, 24);
-    [theView addSubview:self.topControl];
-    return theView;
+-(UIView *)tableView:(UITableView *)aTableView viewForFooterInSection:(NSInteger) section {
+    NSInteger height = 40;
+    UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, height)];
+    footer.backgroundColor = [UIColor clearColor];
+    footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+
+    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width*80/100, height)];
+    label.center = CGPointMake(aTableView.frame.size.width/2, height/2);
+    label.textAlignment = UITextAlignmentCenter;
+    label.font = [UIFont italicSystemFontOfSize:12];
+    label.textColor = [UIColor whiteColor];
+    label.numberOfLines = 2;
+    label.backgroundColor = [UIColor clearColor];
+    label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
+
+    label.text = NSLocalizedString(@"Setting a Style might force a particular Scheme or Weapon configuration.",@"");
+
+    [footer addSubview:label];
+    [label release];
+    return [footer autorelease];
 }
 
 #pragma mark -
@@ -249,9 +297,9 @@
             if ([[settings objectForKey:@"sync_ws"] boolValue]) {
                 for (NSString *str in self.listOfWeapons) {
                     if ([str isEqualToString:self.selectedScheme]) {
-                        int index = [self.listOfSchemes indexOfObject:str];
+                        int row = [self.listOfSchemes indexOfObject:str];
                         self.selectedWeapon = str;
-                        self.lastIndexPath_we = [NSIndexPath indexPathForRow:index inSection:1];
+                        self.lastIndexPath_we = [NSIndexPath indexPathForRow:row inSection:1];
                         break;
                     }
                 }
@@ -264,29 +312,30 @@
             self.selectedScript = [self.listOfScripts objectAtIndex:newRow];
 
             // some styles disable or force the choice of a particular scheme/weaponset
-            NSString *path = [[NSString alloc] initWithFormat:@"%@/%@",SCRIPTS_DIRECTORY(),self.selectedScript];
-            NSDictionary *scriptDict = [[NSDictionary alloc] initWithContentsOfFile:path];
+            NSString *path = [[NSString alloc] initWithFormat:@"%@/%@.cfg",SCRIPTS_DIRECTORY(),[self.selectedScript stringByDeletingPathExtension]];
+            NSString *configFile = [[NSString alloc] initWithContentsOfFile:path];
             [path release];
-            self.scriptCommand = [scriptDict objectForKey:@"command"];
-            NSString *scheme = [scriptDict objectForKey:@"scheme"];
-            if ([scheme isEqualToString:@""]) {
+            NSArray *scriptOptions = [configFile componentsSeparatedByString:@"\n"];
+            [configFile release];
+
+            self.scriptCommand = [NSString stringWithFormat:@"escript Scripts/Multiplayer/%@",self.selectedScript];
+            NSString *scheme = [scriptOptions objectAtIndex:0];
+            if ([scheme isEqualToString:@"locked"]) {
                 self.selectedScheme = @"Default.plist";
                 [self.topControl setEnabled:NO forSegmentAtIndex:0];
             } else {
-                self.selectedScheme = scheme;
+                self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme];
                 [self.topControl setEnabled:YES forSegmentAtIndex:0];
             }
 
-            NSString *weapon = [scriptDict objectForKey:@"weapon"];
-            if ([weapon isEqualToString:@""]) {
+            NSString *weapon = [scriptOptions objectAtIndex:1];
+            if ([weapon isEqualToString:@"locked"]) {
                 self.selectedWeapon = @"Default.plist";
                 [self.topControl setEnabled:NO forSegmentAtIndex:1];
             } else {
-                self.selectedWeapon = weapon;
+                self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon];
                 [self.topControl setEnabled:YES forSegmentAtIndex:1];
             }
-
-            [scriptDict release];
         }
 
         [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
@@ -295,33 +344,37 @@
 }
 
 #pragma mark -
-#pragma mark called externally to empty or fill the sections completely
-+(void) fillInstanceSections {
-    if (controllerInstance.sectionsHidden == YES) {
-        controllerInstance.sectionsHidden = NO;
+#pragma mark called by an NSNotification to empty or fill the sections completely
+-(void) fillSections {
+    if (self.sectionsHidden == YES) {
+        self.sectionsHidden = NO;
         NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)];
-        [controllerInstance.tableView insertSections:sections withRowAnimation:UITableViewRowAnimationFade];
-        controllerInstance.tableView.scrollEnabled = YES;
-
-        [[controllerInstance.view viewWithTag:LABEL_TAG] removeFromSuperview];
+        UITableView *aTableView = (UITableView *)[self.view viewWithTag:TABLE_TAG];
+        [aTableView insertSections:sections withRowAnimation:UITableViewRowAnimationFade];
+        aTableView.scrollEnabled = YES;
+        [[self.view viewWithTag:LABEL_TAG] removeFromSuperview];
     }
 }
 
-+(void) emptyInstanceSections {
-    if (controllerInstance.sectionsHidden == NO) {
-        controllerInstance.sectionsHidden = YES;
+-(void) emptySections {
+    if (self.sectionsHidden == NO) {
+        self.sectionsHidden = YES;
         NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)];
-        [controllerInstance.tableView deleteSections:sections withRowAnimation:UITableViewRowAnimationFade];
-        controllerInstance.tableView.scrollEnabled = NO;
+        UITableView *aTableView = (UITableView *)[self.view viewWithTag:TABLE_TAG];
+        [aTableView deleteSections:sections withRowAnimation:UITableViewRowAnimationFade];
+        aTableView.scrollEnabled = NO;
 
-        CGRect frame = CGRectMake(0, 0, controllerInstance.view.frame.size.width * 80/100, 60);
+        CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 60);
         UILabel *theLabel = [[UILabel alloc] initWithFrame:frame
                                                   andTitle:NSLocalizedString(@"Missions don't need further configuration",@"")];
-        theLabel.center = CGPointMake(controllerInstance.view.frame.size.width/2, controllerInstance.view.frame.size.height/2);
+        theLabel.center = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2);
         theLabel.numberOfLines = 2;
         theLabel.tag = LABEL_TAG;
+        theLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth |
+                                    UIViewAutoresizingFlexibleTopMargin |
+                                    UIViewAutoresizingFlexibleBottomMargin;
 
-        [controllerInstance.view addSubview:theLabel];
+        [self.view addSubview:theLabel];
         [theLabel release];
     }
 }
@@ -330,7 +383,6 @@
 #pragma mark Memory management
 -(void) didReceiveMemoryWarning {
     if ([HWUtils isGameLaunched]) {
-        self.tableView = nil;
         self.lastIndexPath_sc = nil;
         self.lastIndexPath_we = nil;
         self.lastIndexPath_lu = nil;
@@ -348,7 +400,7 @@
 }
 
 -(void) viewDidUnload {
-    self.tableView = nil;
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
     self.listOfSchemes = nil;
     self.listOfWeapons = nil;
     self.listOfScripts = nil;
@@ -365,7 +417,6 @@
 }
 
 -(void) dealloc {
-    releaseAndNil(tableView);
     releaseAndNil(listOfSchemes);
     releaseAndNil(listOfWeapons);
     releaseAndNil(listOfScripts);
--- a/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,14 +14,12 @@
  * 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 created on 16/12/2010.
  */
 
 
 #import <Foundation/Foundation.h>
 #import "SDL_net.h"
-//#import "EngineProtocolNetwork.h"
+
 
 @interface ServerProtocolNetwork : NSObject {
     NSInteger serverPort;
@@ -37,6 +35,6 @@
 -(id) init:(NSInteger) onPort withAddress:(NSString *)address;
 -(id) initOnPort:(NSInteger) port;
 -(id) initToAddress:(NSString *)address;
-+(ServerProtocolNetwork *)openServerConnection;
++(id) openServerConnection;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,11 @@
  * 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 created on 10/01/2010.
  */
 
 
 #import "ServerProtocolNetwork.h"
-#import "hwconsts.h"
+
 
 #define BUFFER_SIZE 256
 
@@ -32,7 +30,7 @@
 #pragma mark -
 #pragma mark init and class methods
 -(id) init:(NSInteger) onPort withAddress:(NSString *)address {
-    if (self = [super init]) {
+    if ((self = [super init])) {
         self.serverPort = onPort;
         self.serverAddress = address;
     }
@@ -58,8 +56,8 @@
     [super dealloc];
 }
 
-+(ServerProtocolNetwork *)openServerConnection {
-    ServerProtocolNetwork *connection = [[ServerProtocolNetwork alloc] init];
++(id) openServerConnection {
+    id connection = [[self alloc] init];
     [NSThread detachNewThreadSelector:@selector(serverProtocol)
                              toTarget:connection
                            withObject:nil];
--- a/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 27/03/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 27/03/2010.
  */
 
 
@@ -26,15 +24,14 @@
 #import "SchemeSettingsViewController.h"
 #import "SupportViewController.h"
 
+
 @implementation SettingsBaseViewController
 @synthesize tabController, targetController, controllerNames, lastIndexPath;
 
-
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
-
 #pragma mark -
 #pragma mark View lifecycle
 -(void) viewDidLoad {
@@ -135,10 +132,20 @@
 }
 
 -(void) dismissSplitView {
-    [AudioManagerController playBackSound];
+    [[AudioManagerController mainManager] playBackSound];
     [[[HedgewarsAppDelegate sharedAppDelegate] mainViewController] dismissModalViewControllerAnimated:YES];
 }
 
+-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
+    if (IS_IPAD() == NO)
+        return;
+
+    if (self.targetController != nil) {
+        CGRect screenRect = [[UIScreen mainScreen] safeBounds];
+        self.view.frame = CGRectMake(0, 0, 320, screenRect.size.height);
+    }
+}
+
 #pragma mark -
 #pragma mark Table view data source
 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
@@ -233,7 +240,7 @@
         nextController.navigationItem.hidesBackButton = YES;
         [nextController viewWillAppear:NO];
         [targetController.navigationController pushViewController:nextController animated:NO];
-        [AudioManagerController playClickSound];
+        [[AudioManagerController mainManager] playClickSound];
     }
 }
 
--- a/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,23 +14,21 @@
  * 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 created on 27/03/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @class SettingsBaseViewController;
+@class MGSplitViewController;
 
 @interface SettingsContainerViewController : UIViewController {
     SettingsBaseViewController *baseController;
-    UINavigationController *activeController;
-    UISplitViewController *splitViewRootController;
+    MGSplitViewController *splitViewRootController;
 }
 
 @property (nonatomic,retain) SettingsBaseViewController *baseController;
-@property (nonatomic,retain) UINavigationController *activeController;
-@property (nonatomic,retain) UISplitViewController *splitViewRootController;
+@property (nonatomic,retain) MGSplitViewController *splitViewRootController;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,26 +14,24 @@
  * 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 created on 27/03/2010.
  */
 
 
 #import "SettingsContainerViewController.h"
 #import "SettingsBaseViewController.h"
+#import "MGSplitViewController.h"
 
 
 @implementation SettingsContainerViewController
-@synthesize baseController, activeController, splitViewRootController;
+@synthesize baseController, splitViewRootController;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
-
 -(void) viewDidLoad {
-    CGRect rect = [[UIScreen mainScreen] bounds];
-    self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
+    CGRect screenRect = [[UIScreen mainScreen] safeBounds];
+    self.view.frame = screenRect;
 
     if (IS_IPAD()) {
         // the contents on the right of the splitview, setting targetController to nil to avoid creating the table
@@ -48,11 +46,11 @@
         UINavigationController *leftNavController = [[UINavigationController alloc] initWithRootViewController:leftController];
         [leftController release];
 
-        self.activeController = rightNavController;
-        self.splitViewRootController = [[UISplitViewController alloc] init];
+        self.splitViewRootController = [[MGSplitViewController alloc] init];
         self.splitViewRootController.delegate = nil;
-        self.splitViewRootController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
+        self.splitViewRootController.view.frame = screenRect;
         self.splitViewRootController.viewControllers = [NSArray arrayWithObjects: leftNavController, rightNavController, nil];
+        self.splitViewRootController.showsMasterInPortrait = YES;
         [leftNavController release];
         [rightNavController release];
 
@@ -65,7 +63,7 @@
             [sbvc release];
         }
         self.baseController.targetController = nil;
-        self.baseController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
+        self.baseController.view.frame = screenRect;
 
         [self.view addSubview:self.baseController.view];
     }
@@ -78,8 +76,6 @@
 -(void) didReceiveMemoryWarning {
     if (self.baseController.view.superview == nil)
         self.baseController = nil;
-    if (self.activeController.view.superview == nil)
-        self.activeController = nil;
     if (self.splitViewRootController.view.superview == nil)
         self.splitViewRootController = nil;
     MSG_MEMCLEAN();
@@ -88,7 +84,6 @@
 
 -(void) viewDidUnload {
     self.baseController = nil;
-    self.activeController = nil;
     self.splitViewRootController = nil;
     MSG_DIDUNLOAD();
     [super viewDidUnload];
@@ -96,7 +91,6 @@
 
 -(void) dealloc {
     releaseAndNil(baseController);
-    releaseAndNil(activeController);
     releaseAndNil(splitViewRootController);
     [super dealloc];
 }
@@ -107,28 +101,42 @@
 // every time we add a uiviewcontroller programmatically we need to take care of propgating such messages
 // see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
 -(void) viewWillAppear:(BOOL)animated {
-    [self.activeController viewWillAppear:animated];
+    [self.splitViewRootController.detailViewController viewWillAppear:animated];
     [self.baseController viewWillAppear:animated];
     [super viewWillAppear:animated];
 }
 
 -(void) viewWillDisappear:(BOOL)animated {
-    [self.activeController viewWillDisappear:animated];
+    [self.splitViewRootController.detailViewController viewWillDisappear:animated];
     [self.baseController viewWillDisappear:animated];
     [super viewWillDisappear:animated];
 }
 
 -(void) viewDidAppear:(BOOL)animated {
-    [self.activeController viewDidAppear:animated];
+    [self.splitViewRootController.detailViewController viewDidAppear:animated];
     [self.baseController viewDidAppear:animated];
-    [super viewDidLoad];
+    [super viewDidAppear:animated];
 }
 
 -(void) viewDidDisappear:(BOOL)animated {
-    [self.activeController viewDidDisappear:animated];
+    [self.splitViewRootController.detailViewController viewDidDisappear:animated];
     [self.baseController viewDidDisappear:animated];
-    [super viewDidUnload];
+    [super viewDidDisappear:animated];
+}
+
+-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
+    [self.splitViewRootController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
+    [self.baseController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
 }
 
+-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
+    [self.splitViewRootController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+    [self.baseController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+}
+
+-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
+    [self.splitViewRootController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+    [self.baseController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+}
 
 @end
--- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,11 @@
  * 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 created on 23/05/2010.
  */
 
 
 #import <UIKit/UIKit.h>
-#import "EditableCellView.h"
+
 
 @interface SingleSchemeViewController : UITableViewController <EditableCellViewDelegate> {
     NSString *schemeName;
--- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 23/05/2010.
  */
 
 
@@ -87,6 +85,13 @@
     [schemeFile release];
 }
 
+// force a redraw of the game mod section to reposition the slider
+-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
+    if (IS_IPAD() == NO)
+        return;
+    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationFade];
+}
+
 #pragma mark -
 #pragma mark editableCellView delegate
 // set the new value
@@ -166,11 +171,7 @@
                 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
                                                reuseIdentifier:CellIdentifier1] autorelease];
 
-                int offset = 0;
-                if (IS_IPAD())
-                    offset = 50;
-
-                UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(offset+260, 12, offset+150, 23)];
+                UISlider *slider = [[UISlider alloc] init];
                 [slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged];
                 [cell.contentView addSubview:slider];
                 [slider release];
@@ -204,6 +205,20 @@
             cellSlider.maximumValue = [[detail objectForKey:@"max"] floatValue];
             cellSlider.minimumValue = [[detail objectForKey:@"min"] floatValue];
             cellSlider.value = [[[self.schemeDictionary objectForKey:@"basic"] objectAtIndex:row] floatValue];
+            // redraw the slider here
+            NSInteger hOffset = 260;
+            NSInteger vOffset = 12;
+            NSInteger sliderLength = 150;
+            if (IS_IPAD()) {
+                hOffset = 310;
+                sliderLength = 230;
+                if (IS_ON_PORTRAIT()) {
+                    hOffset = 50;
+                    vOffset = 40;
+                    sliderLength = 285;
+                }
+            }
+            cellSlider.frame = CGRectMake(hOffset, vOffset, sliderLength, 23);
 
             NSString *prestring = nil;
             checkValueString(prestring,cellLabel.text,cellSlider);
@@ -321,11 +336,13 @@
     return sectionTitle;
 }
 
--(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-    if ([indexPath section] == 2)
+-(CGFloat) tableView:(UITableView *)aTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    if ([indexPath section] == 0)
+        return aTableView.rowHeight;
+    else if ([indexPath section] == 1)
+        return IS_ON_PORTRAIT() ? 72 : aTableView.rowHeight;
+    else
         return 56;
-    else
-        return self.tableView.rowHeight;
 }
 
 #pragma mark -
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,11 @@
  * 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 created on 02/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
-#import "EditableCellView.h"
+
 
 @class HogHatViewController;
 @class GravesViewController;
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,15 +14,13 @@
  * 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 created on 19/06/2010.
  */
 
 
 #import <UIKit/UIKit.h>
-#import "EditableCellView.h"
 #import "WeaponCellView.h"
 
+
 @interface SingleWeaponViewController : UITableViewController <EditableCellViewDelegate, WeaponButtonControllerDelegate> {
     NSString *weaponName;
     NSString *description;
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 19/06/2010.
  */
 
 
@@ -34,7 +32,7 @@
 -(void) viewDidLoad {
     [super viewDidLoad];
     
-    NSString *trFilePath = [NSString stringWithFormat:@"%@/en.txt",LOCALE_DIRECTORY()];
+    NSString *trFilePath = [NSString stringWithFormat:@"%@/%@.txt",LOCALE_DIRECTORY(),[[NSLocale preferredLanguages] objectAtIndex:0]];
     // fill the data structure that we are going to read
     LoadLocaleWrapper([trFilePath UTF8String]);
     
@@ -189,7 +187,7 @@
     if (0 == [indexPath section])
         return aTableView.rowHeight;
     else
-        return 120;
+        return IS_ON_PORTRAIT() ? 208 : 120;
 }
 
 -(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
--- a/project_files/HedgewarsMobile/Classes/SquareButtonView.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SquareButtonView.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 20/04/2010.
  */
 
 
@@ -23,15 +21,16 @@
 
 
 @interface SquareButtonView : UIButton {
-    NSInteger colorIndex;
+    NSMutableDictionary *ownerDictionary;
+    NSUInteger colorIndex;
     NSUInteger selectedColor;
     NSArray *colorArray;
-    NSMutableDictionary *ownerDictionary;
 }
 
+@property (nonatomic,retain) NSMutableDictionary *ownerDictionary;
 @property (nonatomic,retain) NSArray *colorArray;
-@property (nonatomic) NSUInteger selectedColor;
-@property (nonatomic,retain) NSMutableDictionary *ownerDictionary;
+@property (nonatomic,assign) NSUInteger selectedColor;
+@property (nonatomic,assign) NSUInteger colorIndex;
 
 -(void) nextColor;
 -(void) selectColor:(NSUInteger) color;
--- a/project_files/HedgewarsMobile/Classes/SquareButtonView.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SquareButtonView.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 20/04/2010.
  */
 
 
@@ -24,12 +22,12 @@
 
 
 @implementation SquareButtonView
-@synthesize colorArray, selectedColor, ownerDictionary;
+@synthesize ownerDictionary, colorIndex, selectedColor, colorArray;
 
 -(id) initWithFrame:(CGRect)frame {
     if ((self = [super initWithFrame:frame])) {
-        colorIndex = -1;
-        selectedColor = 0;
+        self.colorIndex = 0;
+        self.selectedColor = 0;
 
         self.colorArray = [HWUtils teamColors];
 
@@ -49,24 +47,21 @@
 }
 
 -(void) nextColor {
-    colorIndex++;
+    self.colorIndex++;
 
-    if (colorIndex >= [colorArray count])
-        colorIndex = 0;
+    if (self.colorIndex >= [self.colorArray count])
+        self.colorIndex = 0;
 
-    NSUInteger color = [[self.colorArray objectAtIndex:colorIndex] unsignedIntValue];
-    self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f
-                                           green:((color & 0x0000FF00) >> 8)/255.0f
-                                            blue: (color & 0x000000FF)/255.0f
-                                           alpha:1.0f];
-
-    [ownerDictionary setObject:[NSNumber numberWithInt:color] forKey:@"color"];
+    NSNumber *colorNumber = [self.colorArray objectAtIndex:colorIndex];
+    [self.ownerDictionary setObject:colorNumber forKey:@"color"];
+    NSUInteger color = [colorNumber unsignedIntValue];
+    [self selectColor:color];
 }
 
 -(void) selectColor:(NSUInteger) color {
-    if (color != selectedColor) {
-        selectedColor = color;
-        colorIndex = [self.colorArray indexOfObject:[NSNumber numberWithUnsignedInt:color]];
+    if (color != self.selectedColor) {
+        self.selectedColor = color;
+        self.colorIndex = [self.colorArray indexOfObject:[NSNumber numberWithUnsignedInt:color]];
 
         self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f
                                                green:((color & 0x0000FF00) >> 8)/255.0f
--- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,17 +14,16 @@
  * 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 created on 30/12/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
-@interface StatsPageViewController : UITableViewController {
+
+@interface StatsPageViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
     NSArray *statsArray;
 }
 
 @property (nonatomic,retain) NSArray *statsArray;
 
-@end
\ No newline at end of file
+@end
--- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,11 @@
  * 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 created on 30/12/2010.
  */
 
 
 #import "StatsPageViewController.h"
-#import <QuartzCore/QuartzCore.h>
+
 
 @implementation StatsPageViewController
 @synthesize statsArray;
@@ -30,26 +28,25 @@
 }
 
 -(void) viewDidLoad {
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
-        self.tableView.backgroundView = nil;
-
-    NSString *imgName;
-    if (IS_IPAD())
-        imgName = @"mediumBackground~ipad.png";
-    else
-        imgName = @"smallerBackground~iphone.png";
+    UITableView *aTableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
+    [aTableView setBackgroundColorForAnyTable:[UIColor clearColor]];
 
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)]) {
-        UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:imgName];
-        UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage];
-        [backgroundImage release];
-        [self.tableView setBackgroundView:background];
-        [background release];
-    } else
-        self.view.backgroundColor = [UIColor blackColor];
+    NSString *imgName = (IS_IPAD()) ? @"mediumBackground~ipad.png" : @"smallerBackground~iphone.png";
+    UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
+    UIImageView *background = [[UIImageView alloc] initWithImage:img];
+    [img release];
+    background.frame = self.view.frame;
+    background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view insertSubview:background atIndex:0];
+    [background release];
 
-    self.tableView.separatorColor = [UIColor darkYellowColor];
-    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    aTableView.separatorColor = [UIColor darkYellowColor];
+    aTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    aTableView.delegate = self;
+    aTableView.dataSource = self;
+
+    [self.view addSubview:aTableView];
+    [aTableView release];
 
     [super viewDidLoad];
 }
@@ -60,7 +57,7 @@
     return 3;
 }
 
--(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+-(NSInteger) tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {
     if (section == 0)
         return 1;
     else if (section == 1)
@@ -118,17 +115,20 @@
     return cell;
 }
 
--(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
+-(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section {
     return 160;
 }
 
--(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
+-(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section {
     if (section == 0) {
-        UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 160)];
+        UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, 160)];
+        header.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+
         UIImage *img = [[UIImage alloc] initWithContentsOfFile:@"smallerTitle.png"];
         UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
         [img release];
-        imgView.center = CGPointMake(self.tableView.frame.size.height/2, 160/2);
+        imgView.center = CGPointMake(aTableView.frame.size.width/2, 160/2);
+        imgView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         [header addSubview:imgView];
         [imgView release];
 
@@ -137,28 +137,18 @@
         return nil;
 }
 
--(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
-    return self.tableView.rowHeight + 30;
+-(CGFloat) tableView:(UITableView *)aTableView heightForFooterInSection:(NSInteger)section {
+    return aTableView.rowHeight + 30;
 }
 
--(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
+-(UIView *)tableView:(UITableView *)aTableView viewForFooterInSection:(NSInteger)section {
     if (section == 2) {
-
-        UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height * 70 / 100, self.tableView.rowHeight)];
+        UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 70 / 100, aTableView.rowHeight)];
         footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
 
-        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.height * 70 / 100, self.tableView.rowHeight)];
+        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.width * 70 / 100, aTableView.rowHeight)
+                                                  andTitle:NSLocalizedString(@"Done",@"")];
         button.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-        [button setTitle:NSLocalizedString(@"Done",@"") forState:UIControlStateNormal];
-        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-        [button setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
-
-        button.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
-        button.backgroundColor = [UIColor blackColorTransparent];
-        [button.layer setBorderWidth:1];
-        [button.layer setBorderColor:[[UIColor darkYellowColor] CGColor]];
-        [button.layer setCornerRadius:9.0f];
-        [button.layer setMasksToBounds:YES];
         [button addTarget:self action:@selector(dismissView) forControlEvents:UIControlEventTouchUpInside];
         [footer addSubview:button];
         [button release];
@@ -171,7 +161,7 @@
 #pragma mark -
 #pragma mark button delegate
 -(void) dismissView {
-    [AudioManagerController playClickSound];
+    [[AudioManagerController mainManager] playClickSound];
     [self dismissModalViewControllerAnimated:YES];
 }
 
--- a/project_files/HedgewarsMobile/Classes/SupportViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SupportViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 19/09/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @interface SupportViewController : UITableViewController {
     NSArray *waysToSupport;
 }
--- a/project_files/HedgewarsMobile/Classes/SupportViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SupportViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 19/09/2010.
  */
 
 
@@ -143,14 +141,18 @@
 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
     if (section == 1) {
         UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 240)];
+        footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+
         UIImage *img = [[UIImage alloc] initWithContentsOfFile:@"surprise.png"];
         UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
         [img release];
         imgView.center = CGPointMake(self.tableView.frame.size.width/2, 120);
+        imgView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         [footer addSubview:imgView];
         [imgView release];
         
         UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 20)];
+        label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         label.textAlignment = UITextAlignmentCenter;
         label.text = @" ♥ THANK YOU ♥ ";
         label.backgroundColor = [UIColor clearColor];
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 20/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 20/04/2010.
  */
 
 
@@ -56,6 +54,7 @@
     aTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
     aTableView.separatorColor = [UIColor whiteColor];
     aTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    aTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     self.tableView = aTableView;
     [aTableView release];
 
@@ -69,7 +68,7 @@
         self.cachedContentsOfDir = contentsOfDir;
         NSArray *colors = [HWUtils teamColors];
         NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[contentsOfDir count]];
-        for (int i = 0; i < [contentsOfDir count]; i++) {
+        for (NSUInteger i = 0; i < [contentsOfDir count]; i++) {
             NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                          [contentsOfDir objectAtIndex:i],@"team",
                                          [NSNumber numberWithInt:4],@"number",
@@ -178,16 +177,18 @@
     return 45.0;
 }
 
--(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
-    CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
+-(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section {
+    CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 70/100, 30);
     NSString *text = (section == 0) ? NSLocalizedString(@"Playing Teams",@"") : NSLocalizedString(@"Available Teams",@"");
     UILabel *theLabel = [[UILabel alloc] initWithFrame:frame andTitle:text];
     theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
+    theLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
 
-    UIView *theView = [[[UIView alloc] init] autorelease];
+    UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, 30)];
+    theView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
     [theView addSubview:theLabel];
     [theLabel release];
-    return theView;
+    return [theView autorelease];
 }
 
 -(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
@@ -198,6 +199,7 @@
     NSInteger height = IS_IPAD() ? 40 : 20;
     UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, height)];
     footer.backgroundColor = [UIColor clearColor];
+    footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
 
     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width*80/100, height)];
     label.center = CGPointMake(aTableView.frame.size.width/2, height/2);
@@ -205,12 +207,14 @@
     label.font = [UIFont italicSystemFontOfSize:12];
     label.textColor = [UIColor whiteColor];
     label.numberOfLines = 2;
+    label.backgroundColor = [UIColor clearColor];
+    label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
+
     if (section == 0)
         label.text = NSLocalizedString(@"Tap to add hogs or change color, touch and hold to remove a team.",@"");
     else
         label.text = NSLocalizedString(@"The robot badge indicates an AI-controlled team.",@"");
 
-    label.backgroundColor = [UIColor clearColor];
     [footer addSubview:label];
     [label release];
     return [footer autorelease];
@@ -220,8 +224,8 @@
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    NSInteger row = [indexPath row];
-    NSInteger section = [indexPath section];
+    NSUInteger row = [indexPath row];
+    NSUInteger section = [indexPath section];
 
     if (section == 1 && [self.listOfAllTeams count] > row) {
         [self.listOfSelectedTeams addObject:[self.listOfAllTeams objectAtIndex:row]];
@@ -250,7 +254,7 @@
 }
 
 -(void) holdAction:(NSString *)content onTable:(UITableView *)aTableView {
-    NSInteger row;
+    NSUInteger row;
     for (row = 0; row < [self.listOfSelectedTeams count]; row++) {
         NSDictionary *dict = [self.listOfSelectedTeams objectAtIndex:row];
         if ([content isEqualToString:[[dict objectForKey:@"team"] stringByDeletingPathExtension]])
--- a/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 02/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @class SingleTeamViewController;
 
 @interface TeamSettingsViewController : UITableViewController {
--- a/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,19 +14,16 @@
  * 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 created on 02/04/2010.
  */
 
 
 #import "TeamSettingsViewController.h"
-#import "CreationChamber.h"
 #import "SingleTeamViewController.h"
 
+
 @implementation TeamSettingsViewController
 @synthesize listOfTeams;
 
-
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 08/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/VoicesViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/VoicesViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,14 +14,13 @@
  * 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 created on 02/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 #import "SDL_mixer.h"
 
+
 @interface VoicesViewController : UITableViewController {
     NSMutableDictionary *teamDictionary;
 
--- a/project_files/HedgewarsMobile/Classes/VoicesViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/VoicesViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 02/04/2010.
  */
 
 
--- a/project_files/HedgewarsMobile/Classes/WeaponCellView.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/WeaponCellView.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,13 +14,12 @@
  * 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 created on 03/07/2010.
  */
 
 
 #import <UIKit/UIKit.h>
 
+
 @protocol WeaponButtonControllerDelegate <NSObject>
 
 -(void) updateValues:(NSArray *)withArray atIndex:(NSInteger) index;
--- a/project_files/HedgewarsMobile/Classes/WeaponCellView.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/WeaponCellView.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,8 +14,6 @@
  * 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 created on 07/03/2010.
  */
 
 
@@ -105,6 +103,7 @@
         helpLabel.textColor = [UIColor darkGrayColor];
         helpLabel.textAlignment = UITextAlignmentRight;
         helpLabel.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]];
+        helpLabel.adjustsFontSizeToFitWidth = YES;
 
         [self.contentView addSubview:weaponName];
         [self.contentView addSubview:weaponIcon];
@@ -132,42 +131,58 @@
 -(void) layoutSubviews {
     [super layoutSubviews];
 
-    CGRect contentRect = self.contentView.bounds;
-    CGFloat shiftSliders = contentRect.origin.x;
-    CGFloat shiftLabel = 0;
+    CGFloat hOffset = 80;
+    CGFloat hOffsetWhenLandscape = 234;
+    CGFloat vOffset = 40;
+    CGFloat vOffsetWhenPortrait = 0;
+    CGFloat helpLabelOffset = 0;
+    CGFloat helpLabelLength = 0;
+    CGFloat sliderLength = 150;
 
     if (IS_IPAD()) {
-        shiftSliders += 65;
-        shiftLabel += 165;
-    } else
-        shiftSliders -= 13;
+        if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
+            sliderLength = 190;
+            hOffsetWhenLandscape = 0;
+            vOffsetWhenPortrait = 80;
+            hOffset = 120;
+            helpLabelOffset = -35;
+            helpLabelLength = 200;
+        } else {
+            hOffset = 145;
+            helpLabelOffset = 35;
+            helpLabelLength = 350;
+        }
+    } else {
+        helpLabelLength = 250;
+        hOffset = 67;
+    }
 
     weaponIcon.frame = CGRectMake(5, 5, 32, 32);
     weaponName.frame = CGRectMake(45, 8, 200, 25);
     
-    helpLabel.frame = CGRectMake(shiftLabel + 200, 8, 250, 15);
+    helpLabel.frame = CGRectMake(200 + helpLabelOffset, 11, helpLabelLength, 20);
 
     // second line
-    initialImg.frame = CGRectMake(shiftSliders + 20, 40, 32, 32);
-    initialLab.frame = CGRectMake(shiftSliders + 56, 40, 20, 32);
+    initialImg.frame = CGRectMake(hOffset - 60, vOffset, 32, 32);
+    initialLab.frame = CGRectMake(hOffset - 23, vOffset, 20, 32);
     initialLab.text = ((int)initialSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)initialSli.value];
-    initialSli.frame = CGRectMake(shiftSliders + 80, 40, 150, 32);
+    initialSli.frame = CGRectMake(hOffset, vOffset, sliderLength, 32);
 
-    probabilityImg.frame = CGRectMake(shiftSliders + 255, 40, 32, 32);
-    probabilityLab.frame = CGRectMake(shiftSliders + 291, 40, 20, 32);
+    probabilityImg.frame = CGRectMake(hOffset + hOffsetWhenLandscape - 60, vOffset + vOffsetWhenPortrait, 32, 32);
+    probabilityLab.frame = CGRectMake(hOffset + hOffsetWhenLandscape - 23, vOffset + vOffsetWhenPortrait, 20, 32);
     probabilityLab.text = ((int)probabilitySli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)probabilitySli.value];
-    probabilitySli.frame = CGRectMake(shiftSliders + 314, 40, 150, 32);
+    probabilitySli.frame = CGRectMake(hOffset + hOffsetWhenLandscape, vOffset + vOffsetWhenPortrait, sliderLength, 32);
 
     // third line
-    delayImg.frame = CGRectMake(shiftSliders + 20, 80, 32, 32);
-    delayLab.frame = CGRectMake(shiftSliders + 56, 80, 20, 32);
+    delayImg.frame = CGRectMake(hOffset - 60, vOffset + 40, 32, 32);
+    delayLab.frame = CGRectMake(hOffset - 23, vOffset + 40, 20, 32);
     delayLab.text = ((int)delaySli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)delaySli.value];
-    delaySli.frame = CGRectMake(shiftSliders + 80, 80, 150, 32);
+    delaySli.frame = CGRectMake(hOffset, vOffset + 40, sliderLength, 32);
 
-    crateImg.frame = CGRectMake(shiftSliders + 255, 80, 32, 32);
-    crateLab.frame = CGRectMake(shiftSliders + 291, 80, 20, 32);
+    crateImg.frame = CGRectMake(hOffset + hOffsetWhenLandscape - 60, vOffset + 40 + vOffsetWhenPortrait, 32, 32);
+    crateLab.frame = CGRectMake(hOffset + hOffsetWhenLandscape - 23, vOffset + 40 + vOffsetWhenPortrait, 20, 32);
     crateLab.text = ((int)crateSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)crateSli.value];
-    crateSli.frame = CGRectMake(shiftSliders + 314, 80, 150, 32);
+    crateSli.frame = CGRectMake(hOffset + hOffsetWhenLandscape, vOffset + 40 + vOffsetWhenPortrait, sliderLength, 32);
 }
 
 /*
@@ -200,16 +215,25 @@
     
     switch (slider.tag) {
         case 100:
-            str = NSLocalizedString(@"Initial quantity ",@"ammo selection");
+            str = NSLocalizedString(@"Initial quantity",@"ammo selection");
             break;
         case 200:
-            str = NSLocalizedString(@"Presence probability in crates ",@"ammo selection");
+            if (IS_ON_PORTRAIT())
+                str = NSLocalizedString(@"Probability in crates",@"ammo selection");
+            else
+                str = NSLocalizedString(@"Presence probability in crates",@"ammo selection");
             break;
         case 300:
-            str = NSLocalizedString(@"Number of turns before you can use this weapon ",@"ammo selection");
+            if (IS_ON_PORTRAIT())
+                str = NSLocalizedString(@"Weapon delay",@"ammo selection");
+            else
+                str = NSLocalizedString(@"Turns before this weapon becomes usable",@"ammo selection");
             break;
         case 400:
-            str = NSLocalizedString(@"Quantity that you will find in a crate ",@"ammo selection");
+            if (IS_ON_PORTRAIT())
+                str = NSLocalizedString(@"Quantity per crate",@"ammo selection");
+            else
+                str = NSLocalizedString(@"Quantity you will find in a crate",@"ammo selection");
             break;
         default:
             DLog(@"Nope");
--- a/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.h	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.h	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,12 +14,12 @@
  * 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 created on 19/04/2010.
  */
 
 
 #import <UIKit/UIKit.h>
+
+
 @class SingleWeaponViewController;
 
 @interface WeaponSettingsViewController : UITableViewController {
--- a/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m	Sun Oct 28 13:28:23 2012 +0100
@@ -1,6 +1,6 @@
 /*
  * Hedgewars-iOS, a Hedgewars port for iOS devices
- * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@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
@@ -14,15 +14,13 @@
  * 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 created on 19/04/2010.
  */
 
 
 #import "WeaponSettingsViewController.h"
-#import "CreationChamber.h"
 #import "SingleWeaponViewController.h"
 
+
 @implementation WeaponSettingsViewController
 @synthesize listOfWeapons;
 
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Oct 28 13:28:23 2012 +0100
@@ -31,24 +31,21 @@
 		610782961440EE5C00645B29 /* basicFlags.plist in Resources */ = {isa = PBXBuildFile; fileRef = 610782931440EE5C00645B29 /* basicFlags.plist */; };
 		610782971440EE5C00645B29 /* credits.plist in Resources */ = {isa = PBXBuildFile; fileRef = 610782941440EE5C00645B29 /* credits.plist */; };
 		610782981440EE5C00645B29 /* gameMods.plist in Resources */ = {isa = PBXBuildFile; fileRef = 610782951440EE5C00645B29 /* gameMods.plist */; };
+		610C8E3714E018D200CF5C4C /* MNEValueTrackingSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 610C8E3614E018D200CF5C4C /* MNEValueTrackingSlider.m */; };
 		610D5FB21270E2660033333A /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43411E290650040BA66 /* Icon-Small@2x.png */; };
 		610D5FB31270E26C0033333A /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43611E290650040BA66 /* Icon@2x.png */; };
-		61188BF212A6FE530026C5DA /* ammoButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D399129B350700911D8D /* ammoButton@2x.png */; };
-		61188BF312A6FE540026C5DA /* arrowDown@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D39A129B350700911D8D /* arrowDown@2x.png */; };
-		61188BF412A6FE560026C5DA /* arrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D39B129B350700911D8D /* arrowLeft@2x.png */; };
-		61188BF512A6FE570026C5DA /* arrowRight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D39C129B350700911D8D /* arrowRight@2x.png */; };
-		61188BF612A6FE590026C5DA /* arrowUp@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D39D129B350700911D8D /* arrowUp@2x.png */; };
+		61156521147F48B6006729A9 /* About.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61156520147F48B6006729A9 /* About.strings */; };
+		61156523147F48B7006729A9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61156522147F48B7006729A9 /* Localizable.strings */; };
+		61156525147F48B8006729A9 /* Scheme.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61156524147F48B8006729A9 /* Scheme.strings */; };
+		61177C02148B8BB100686905 /* uLandGenMaze.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61177C00148B8BB100686905 /* uLandGenMaze.pas */; };
+		61177C03148B8BB100686905 /* uLandOutline.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61177C01148B8BB100686905 /* uLandOutline.pas */; };
 		61188BF712A6FE5A0026C5DA /* backButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6172FED31298CE6600D73365 /* backButton@2x.png */; };
 		61188BF812A6FE5C0026C5DA /* background@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 6172FED61298CF9800D73365 /* background@2x~iphone.png */; };
 		61188BF912A6FE5D0026C5DA /* checkbox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 615FEAD912A2A4C10098EE92 /* checkbox@2x.png */; };
-		61188BFA12A6FE5E0026C5DA /* cornerButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D39E129B350700911D8D /* cornerButton@2x.png */; };
 		61188BFB12A6FE610026C5DA /* Default-ipad-Landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 6183D83C11E2BCE200A88903 /* Default-ipad-Landscape.png */; };
 		61188BFC12A6FE630026C5DA /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6172FEA21298C7F900D73365 /* Default@2x.png */; };
 		61188BFD12A6FE730026C5DA /* fb@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D383129B346A00911D8D /* fb@2x.png */; };
 		61188BFE12A6FE7C0026C5DA /* irc@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D384129B347700911D8D /* irc@2x.png */; };
-		61188BFF12A6FE7E0026C5DA /* joyButtonAttack@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D392129B34E900911D8D /* joyButtonAttack@2x.png */; };
-		61188C0012A6FE810026C5DA /* joyButtonBackJump@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D393129B34E900911D8D /* joyButtonBackJump@2x.png */; };
-		61188C0112A6FE820026C5DA /* joyButtonForwardJump@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6103D394129B34E900911D8D /* joyButtonForwardJump@2x.png */; };
 		61188C0212A6FE840026C5DA /* localplayButton@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 615FEADE12A2A6640098EE92 /* localplayButton@2x~iphone.png */; };
 		61188C0312A6FE860026C5DA /* netplayButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040D11DF59D10068B24D /* netplayButton.png */; };
 		61188C0412A6FE880026C5DA /* savesButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6172FEC81298CE4800D73365 /* savesButton@2x.png */; };
@@ -60,22 +57,13 @@
 		611D7A50142FDCD3006E0798 /* uTouch.pas in Sources */ = {isa = PBXBuildFile; fileRef = 611D7A4F142FDCD3006E0798 /* uTouch.pas */; };
 		611D9BFB12497E9800008271 /* SavedGamesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 611D9BF912497E9800008271 /* SavedGamesViewController.m */; };
 		611D9BFC12497E9800008271 /* SavedGamesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 611D9BFA12497E9800008271 /* SavedGamesViewController.xib */; };
-		611E0EE711FB20610077A41E /* ammoButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 611E0EE511FB20610077A41E /* ammoButton.png */; };
-		611E0EE811FB20610077A41E /* cornerButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 611E0EE611FB20610077A41E /* cornerButton.png */; };
 		611E12FF117BBBDA0044B62F /* Entitlements-Development.plist in Resources */ = {isa = PBXBuildFile; fileRef = 611E12FE117BBBDA0044B62F /* Entitlements-Development.plist */; };
-		611EE974122A9C4100DF6938 /* clickSound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 611EE973122A9C4100DF6938 /* clickSound.wav */; };
-		611EE9DA122AA10A00DF6938 /* selSound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 611EE9D8122AA10A00DF6938 /* selSound.wav */; };
-		611EEAEE122B2A4D00DF6938 /* HelpPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */; };
-		611EEAEF122B2A4D00DF6938 /* HelpPageLobbyViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController-iPad.xib */; };
-		611EEBC1122B34A800DF6938 /* helpingame.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEBC0122B34A800DF6938 /* helpingame.png */; };
-		611EEBC4122B355700DF6938 /* helpbottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEBC2122B355700DF6938 /* helpbottom.png */; };
-		611EEBC5122B355700DF6938 /* helpright.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEBC3122B355700DF6938 /* helpright.png */; };
-		611EEC31122B54D700DF6938 /* helpplain.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEC30122B54D700DF6938 /* helpplain.png */; };
+		611EE974122A9C4100DF6938 /* clickSound.caf in Resources */ = {isa = PBXBuildFile; fileRef = 611EE973122A9C4100DF6938 /* clickSound.caf */; };
+		611EE9DA122AA10A00DF6938 /* selSound.caf in Resources */ = {isa = PBXBuildFile; fileRef = 611EE9D8122AA10A00DF6938 /* selSound.caf */; };
 		611F4D4B11B27A9900F9759A /* uScript.pas in Sources */ = {isa = PBXBuildFile; fileRef = 611F4D4A11B27A9900F9759A /* uScript.pas */; };
 		61272339117DF778005B90CF /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61272338117DF778005B90CF /* MobileCoreServices.framework */; };
 		6129B9F711EFB04D0017E305 /* denied.png in Resources */ = {isa = PBXBuildFile; fileRef = 6129B9F611EFB04D0017E305 /* denied.png */; };
 		612CABAB1391CE68005E9596 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 612CABAA1391CE68005E9596 /* AVFoundation.framework */; };
-		612CABC81391D3CC005E9596 /* hwclassic.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 612CABC71391D3CC005E9596 /* hwclassic.mp3 */; };
 		61370653117B1D50004EE44A /* Entitlements-Distribution.plist in Resources */ = {isa = PBXBuildFile; fileRef = 61370652117B1D50004EE44A /* Entitlements-Distribution.plist */; };
 		61399013125D19C0003C2DC0 /* uMobile.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61399012125D19C0003C2DC0 /* uMobile.pas */; };
 		6147DAD31253DCDE0010357E /* savesButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 6147DAD21253DCDE0010357E /* savesButton.png */; };
@@ -83,8 +71,15 @@
 		615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD96112073B4D00F2FF04 /* startGameButton.png */; };
 		615AD9E9120764CA00F2FF04 /* backButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD9E8120764CA00F2FF04 /* backButton.png */; };
 		615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD9EA1207654E00F2FF04 /* helpButton.png */; };
+		615BE3D4155C5DDF003CA34D /* uInputHandler.pas in Sources */ = {isa = PBXBuildFile; fileRef = 615BE3D3155C5DDF003CA34D /* uInputHandler.pas */; };
+		615E755A14E41E8C00FBA131 /* MXAudioPlayerFadeOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 615E755914E41E8C00FBA131 /* MXAudioPlayerFadeOperation.m */; };
+		615E76BC14E4421200FBA131 /* MGSplitCornersView.m in Sources */ = {isa = PBXBuildFile; fileRef = 615E76B714E4421200FBA131 /* MGSplitCornersView.m */; };
+		615E76BD14E4421200FBA131 /* MGSplitDividerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 615E76B914E4421200FBA131 /* MGSplitDividerView.m */; };
+		615E76BE14E4421200FBA131 /* MGSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 615E76BB14E4421200FBA131 /* MGSplitViewController.m */; };
 		615FEAE212A2A6640098EE92 /* localplayButton~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 615FEADF12A2A6640098EE92 /* localplayButton~ipad.png */; };
 		615FEAE312A2A6640098EE92 /* localplayButton~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 615FEAE012A2A6640098EE92 /* localplayButton~iphone.png */; };
+		616065A8159A71FD00CFAEF4 /* hwclassic.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 616065A7159A71FD00CFAEF4 /* hwclassic.mp3 */; };
+		616245D114E6160200CC97FB /* libFreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6162456714E6159C00CC97FB /* libFreetype.a */; };
 		6163EE7E11CC2600001C0453 /* SingleWeaponViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */; };
 		6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E111CA9BA200D6E256 /* FlagsViewController.m */; };
 		6165920E11CA9BA200D6E256 /* FortsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E311CA9BA200D6E256 /* FortsViewController.m */; };
@@ -97,8 +92,6 @@
 		6165921511CA9BA200D6E256 /* MainMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F111CA9BA200D6E256 /* MainMenuViewController.m */; };
 		6165921611CA9BA200D6E256 /* MapConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F311CA9BA200D6E256 /* MapConfigViewController.m */; };
 		6165921711CA9BA200D6E256 /* SettingsBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F511CA9BA200D6E256 /* SettingsBaseViewController.m */; };
-		6165921811CA9BA200D6E256 /* OverlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F711CA9BA200D6E256 /* OverlayViewController.m */; };
-		6165921911CA9BA200D6E256 /* InGameMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F911CA9BA200D6E256 /* InGameMenuViewController.m */; };
 		6165921A11CA9BA200D6E256 /* SchemeSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591FB11CA9BA200D6E256 /* SchemeSettingsViewController.m */; };
 		6165921B11CA9BA200D6E256 /* SchemeWeaponConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591FD11CA9BA200D6E256 /* SchemeWeaponConfigViewController.m */; };
 		6165921C11CA9BA200D6E256 /* SingleSchemeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591FF11CA9BA200D6E256 /* SingleSchemeViewController.m */; };
@@ -114,7 +107,6 @@
 		6165923211CA9BD500D6E256 /* UIImageExtra.m in Sources */ = {isa = PBXBuildFile; fileRef = 6165922D11CA9BD500D6E256 /* UIImageExtra.m */; };
 		6165925311CA9CB400D6E256 /* MainMenuViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924B11CA9CB400D6E256 /* MainMenuViewController-iPad.xib */; };
 		6165925511CA9CB400D6E256 /* MapConfigViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924D11CA9CB400D6E256 /* MapConfigViewController-iPad.xib */; };
-		6165925811CA9CB400D6E256 /* OverlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165925011CA9CB400D6E256 /* OverlayViewController.xib */; };
 		6165929E11CA9E2F00D6E256 /* HedgewarsAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6165929D11CA9E2F00D6E256 /* HedgewarsAppDelegate.m */; };
 		6167A6761391514600AA6D07 /* RestoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6167A6741391514600AA6D07 /* RestoreViewController.m */; };
 		6167A6771391514600AA6D07 /* RestoreViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6167A6751391514600AA6D07 /* RestoreViewController-iPhone.xib */; };
@@ -149,7 +141,6 @@
 		6174F7C912CD62E300205D6F /* smallerTitle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6174F7C712CD62E300205D6F /* smallerTitle@2x.png */; };
 		61798816114AA34C00BA94A9 /* hwengine.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987E7114AA34C00BA94A9 /* hwengine.pas */; };
 		61798818114AA34C00BA94A9 /* hwLibrary.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987E9114AA34C00BA94A9 /* hwLibrary.pas */; };
-		6179881B114AA34C00BA94A9 /* PascalExports.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987EC114AA34C00BA94A9 /* PascalExports.pas */; };
 		6179881C114AA34C00BA94A9 /* SDLh.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987ED114AA34C00BA94A9 /* SDLh.pas */; };
 		6179881F114AA34C00BA94A9 /* uAI.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987F1114AA34C00BA94A9 /* uAI.pas */; };
 		61798820114AA34C00BA94A9 /* uAIActions.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987F2114AA34C00BA94A9 /* uAIActions.pas */; };
@@ -179,16 +170,15 @@
 		6179883C114AA34C00BA94A9 /* uVisualGears.pas in Sources */ = {isa = PBXBuildFile; fileRef = 6179880E114AA34C00BA94A9 /* uVisualGears.pas */; };
 		6179883D114AA34C00BA94A9 /* uWorld.pas in Sources */ = {isa = PBXBuildFile; fileRef = 6179880F114AA34C00BA94A9 /* uWorld.pas */; };
 		61798935114AB25F00BA94A9 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61798934114AB25F00BA94A9 /* AudioToolbox.framework */; };
-		61808A5D128C930A005D0E2F /* backSound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 611EE9D7122AA10A00DF6938 /* backSound.wav */; };
-		61842B24122B619D0096E335 /* HelpPageInGameViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61842B23122B619D0096E335 /* HelpPageInGameViewController-iPad.xib */; };
-		61842B3E122B65BD0096E335 /* helpabove.png in Resources */ = {isa = PBXBuildFile; fileRef = 61842B3D122B65BD0096E335 /* helpabove.png */; };
-		61842B40122B66280096E335 /* helpleft.png in Resources */ = {isa = PBXBuildFile; fileRef = 61842B3F122B66280096E335 /* helpleft.png */; };
+		61808A5D128C930A005D0E2F /* backSound.caf in Resources */ = {isa = PBXBuildFile; fileRef = 611EE9D7122AA10A00DF6938 /* backSound.caf */; };
 		61889985129995B500D55FD6 /* title~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 61889984129995B500D55FD6 /* title~ipad.png */; };
 		61915D5B143A4E2C00299991 /* MissionTrainingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61915D59143A4E2C00299991 /* MissionTrainingViewController.m */; };
 		61915D5C143A4E2C00299991 /* MissionTrainingViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61915D5A143A4E2C00299991 /* MissionTrainingViewController-iPhone.xib */; };
+		619349C8160BAF3E00A08518 /* uAILandMarks.pas in Sources */ = {isa = PBXBuildFile; fileRef = 619349C5160BAF3E00A08518 /* uAILandMarks.pas */; };
+		619349C9160BAF3E00A08518 /* uGearsHandlers.pas in Sources */ = {isa = PBXBuildFile; fileRef = 619349C6160BAF3E00A08518 /* uGearsHandlers.pas */; };
+		619349CA160BAF3E00A08518 /* uGearsHandlersRope.pas in Sources */ = {isa = PBXBuildFile; fileRef = 619349C7160BAF3E00A08518 /* uGearsHandlersRope.pas */; };
 		6195981F1364BCEF00B429B6 /* libTremor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6195981D1364BCD200B429B6 /* libTremor.a */; };
 		619599451364C83D00B429B6 /* libLua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 619599441364C82B00B429B6 /* libLua.a */; };
-		619599C01364E66B00B429B6 /* libFreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 619599BF1364E65900B429B6 /* libFreetype.a */; };
 		6199E81612463EA800DADF8C /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6199E81512463EA800DADF8C /* CFNetwork.framework */; };
 		6199E81A12463EC400DADF8C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6199E81912463EC400DADF8C /* SystemConfiguration.framework */; };
 		6199E839124647DE00DADF8C /* SupportViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6199E837124647DE00DADF8C /* SupportViewController.m */; };
@@ -196,6 +186,11 @@
 		619C5AF4124F7E3100D041AE /* LuaPas.pas in Sources */ = {isa = PBXBuildFile; fileRef = 619C5AF3124F7E3100D041AE /* LuaPas.pas */; };
 		619C5BA2124FA59000D041AE /* MapPreviewButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */; };
 		61A1188511683A8C00359010 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A117FE1168322700359010 /* CoreGraphics.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+		61A19AFC14D20170004B1E6D /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19AEA14D2010A004B1E6D /* libSDL2.a */; };
+		61A19B7714D20B7A004B1E6D /* libSDL2_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19B6614D20B6C004B1E6D /* libSDL2_image.a */; };
+		61A19BC714D20CE7004B1E6D /* libSDL2_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19BC614D20CDA004B1E6D /* libSDL2_ttf.a */; };
+		61A19BFA14D20D95004B1E6D /* libSDL2_net.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19BF914D20D83004B1E6D /* libSDL2_net.a */; };
+		61A19C2414D20F5A004B1E6D /* libSDL2_mixer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19C2314D20F51004B1E6D /* libSDL2_mixer.a */; };
 		61A4A39412A5CCC2004D81E6 /* uCommandHandlers.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61A4A38912A5CCC2004D81E6 /* uCommandHandlers.pas */; };
 		61A4A39512A5CCC2004D81E6 /* uCommands.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61A4A38A12A5CCC2004D81E6 /* uCommands.pas */; };
 		61A4A39612A5CCC2004D81E6 /* uDebug.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61A4A38B12A5CCC2004D81E6 /* uDebug.pas */; };
@@ -213,23 +208,17 @@
 		61A670C212747DBD00B06CE7 /* MapConfigViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924E11CA9CB400D6E256 /* MapConfigViewController-iPhone.xib */; };
 		61A976B3136F668500DD9878 /* uCursor.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61A976B2136F668500DD9878 /* uCursor.pas */; };
 		61AC067412B2E32D000B52A2 /* Appirater.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AC067312B2E32D000B52A2 /* Appirater.m */; };
-		61B3D71C11EA6F2700EC7420 /* uKeys.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987FE114AA34C00BA94A9 /* uKeys.pas */; };
 		61B7A33812CC21080086B604 /* StatsPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B7A33712CC21080086B604 /* StatsPageViewController.m */; };
-		61B7A61512FA13B00051E14E /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B7A54E12FA129F0051E14E /* libSDL.a */; };
-		61B7A61612FA13B00051E14E /* libSDL_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B7A55812FA12AD0051E14E /* libSDL_image.a */; };
-		61B7A61712FA13B00051E14E /* libSDL_mixer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B7A56012FA12BF0051E14E /* libSDL_mixer.a */; };
-		61B7A61812FA13B00051E14E /* libSDL_net.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B7A56812FA12D00051E14E /* libSDL_net.a */; };
-		61B7A61912FA13B00051E14E /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B7A59012FA13330051E14E /* libSDL_ttf.a */; };
 		61B9A86814423A9D001541C1 /* GameConfigViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61B9A86714423A9D001541C1 /* GameConfigViewController-iPad.xib */; };
 		61C079E411F35A300072BF46 /* EditableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C079E311F35A300072BF46 /* EditableCellView.m */; };
 		61C28D3F142D380400DA16C2 /* AudioManagerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C28D3E142D380400DA16C2 /* AudioManagerController.m */; };
 		61CADE331402EE290030C3EB /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61CADE321402EE290030C3EB /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+		61D08D7414AEA7FE0007C078 /* uGearsHedgehog.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61D08D7114AEA7FE0007C078 /* uGearsHedgehog.pas */; };
+		61D08D7514AEA7FE0007C078 /* uGearsList.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61D08D7214AEA7FE0007C078 /* uGearsList.pas */; };
+		61D08D7614AEA7FE0007C078 /* uGearsUtils.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61D08D7314AEA7FE0007C078 /* uGearsUtils.pas */; };
 		61D0BDF91457508C0011A899 /* ExtraCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D0BDF81457508C0011A899 /* ExtraCategories.m */; };
 		61D205A1127CDD1100ABD83E /* ObjcExports.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D205A0127CDD1100ABD83E /* ObjcExports.m */; };
 		61D3D2A51290E03A003CE7C3 /* irc.png in Resources */ = {isa = PBXBuildFile; fileRef = 61D3D2A41290E03A003CE7C3 /* irc.png */; };
-		61DE8F221257EB1100B80214 /* AmmoMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */; };
-		61DF0EDC1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61DF0EDB1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib */; };
-		61DF0F211284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61DF0F201284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib */; };
 		61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; };
 		61E2E12E12BAAEE30051B659 /* ServerProtocolNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 61E2E12D12BAAEE30051B659 /* ServerProtocolNetwork.m */; };
 		61E2F7441283752C00E12521 /* fb.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E2F7421283752C00E12521 /* fb.png */; };
@@ -237,13 +226,6 @@
 		61E5D68D12AB006F00566F29 /* uLandPainted.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E5D68C12AB006F00566F29 /* uLandPainted.pas */; };
 		61EBA62A11DFF2BC0048B68A /* title~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62811DFF2BC0048B68A /* title~iphone.png */; };
 		61EDB5B0135B3F97009B29A6 /* GameInterfaceBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EDB5AF135B3F97009B29A6 /* GameInterfaceBridge.m */; };
-		61EF920E11DF57AC003441C4 /* arrowDown.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920511DF57AC003441C4 /* arrowDown.png */; };
-		61EF920F11DF57AC003441C4 /* arrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920611DF57AC003441C4 /* arrowLeft.png */; };
-		61EF921011DF57AC003441C4 /* arrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920711DF57AC003441C4 /* arrowRight.png */; };
-		61EF921111DF57AC003441C4 /* arrowUp.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920811DF57AC003441C4 /* arrowUp.png */; };
-		61EF921211DF57AC003441C4 /* joyButtonAttack.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920911DF57AC003441C4 /* joyButtonAttack.png */; };
-		61EF921311DF57AC003441C4 /* joyButtonBackJump.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920A11DF57AC003441C4 /* joyButtonBackJump.png */; };
-		61EF921411DF57AC003441C4 /* joyButtonForwardJump.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920B11DF57AC003441C4 /* joyButtonForwardJump.png */; };
 		61F2E7CE1205EDE0005734F7 /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F2E7CC1205EDE0005734F7 /* AboutViewController.m */; };
 		61F2E7CF1205EDE0005734F7 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61F2E7CD1205EDE0005734F7 /* AboutViewController.xib */; };
 		61F2E7EC12060E31005734F7 /* checkbox.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F2E7EB12060E31005734F7 /* checkbox.png */; };
@@ -273,6 +255,13 @@
 /* End PBXBuildRule section */
 
 /* Begin PBXContainerItemProxy section */
+		6162456614E6159C00CC97FB /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 619599BA1364E65900B429B6 /* Freetype.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = D2AAC07E0554694100DB518D;
+			remoteInfo = libFreetype;
+		};
 		6195981C1364BCD200B429B6 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = 619598181364BCD200B429B6 /* Tremor.xcodeproj */;
@@ -287,53 +276,46 @@
 			remoteGlobalIDString = D2AAC07E0554694100DB518D;
 			remoteInfo = libLua;
 		};
-		619599BE1364E65900B429B6 /* PBXContainerItemProxy */ = {
+		61A19AE914D2010A004B1E6D /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
-			containerPortal = 619599BA1364E65900B429B6 /* Freetype.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = D2AAC07E0554694100DB518D;
-			remoteInfo = libFreetype;
-		};
-		61B7A54D12FA129F0051E14E /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 617988D3114AAA3900BA94A9 /* SDLiPhoneOS.xcodeproj */;
+			containerPortal = 61A19AE314D2010A004B1E6D /* SDL.xcodeproj */;
 			proxyType = 2;
 			remoteGlobalIDString = FD6526630DE8FCCB002AD96B;
-			remoteInfo = StaticLibiPhoneOS;
+			remoteInfo = libSDL;
 		};
-		61B7A54F12FA129F0051E14E /* PBXContainerItemProxy */ = {
+		61A19AEB14D2010A004B1E6D /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
-			containerPortal = 617988D3114AAA3900BA94A9 /* SDLiPhoneOS.xcodeproj */;
+			containerPortal = 61A19AE314D2010A004B1E6D /* SDL.xcodeproj */;
 			proxyType = 2;
 			remoteGlobalIDString = 006E982211955059001DE610;
 			remoteInfo = testsdl;
 		};
-		61B7A55712FA12AD0051E14E /* PBXContainerItemProxy */ = {
+		61A19B6514D20B6C004B1E6D /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
-			containerPortal = 6127232E117DF752005B90CF /* SDL_image.xcodeproj */;
+			containerPortal = 61A19B6114D20B6C004B1E6D /* SDL_image.xcodeproj */;
 			proxyType = 2;
 			remoteGlobalIDString = BE1FA74107AF4C45004B6283;
+			remoteInfo = libSDL_image;
+		};
+		61A19BC514D20CDA004B1E6D /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = BE48FD6E07AFA17000BB41DA;
 			remoteInfo = "Static Library";
 		};
-		61B7A55F12FA12BF0051E14E /* PBXContainerItemProxy */ = {
+		61A19BF814D20D83004B1E6D /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
-			containerPortal = 6179898B114AB3FA00BA94A9 /* SDL_mixer.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BE1FA95407AF96B2004B6283;
-			remoteInfo = "Static Library";
-		};
-		61B7A56712FA12D00051E14E /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 618E27B612A2C30700C20EF0 /* SDL_net.xcodeproj */;
+			containerPortal = 61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */;
 			proxyType = 2;
 			remoteGlobalIDString = BE48FF6F07AFA9A900BB41DA;
 			remoteInfo = "Static Library";
 		};
-		61B7A58F12FA13330051E14E /* PBXContainerItemProxy */ = {
+		61A19C2214D20F51004B1E6D /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
-			containerPortal = 61798A0B114AB65600BA94A9 /* SDL_ttf.xcodeproj */;
+			containerPortal = 61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */;
 			proxyType = 2;
-			remoteGlobalIDString = BE48FD6E07AFA17000BB41DA;
+			remoteGlobalIDString = BE1FA95407AF96B2004B6283;
 			remoteInfo = "Static Library";
 		};
 		928301590F10E41300CC5A3C /* PBXContainerItemProxy */ = {
@@ -357,55 +339,74 @@
 		6103D383129B346A00911D8D /* fb@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fb@2x.png"; path = "Resources/Icons/fb@2x.png"; sourceTree = "<group>"; };
 		6103D384129B347700911D8D /* irc@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "irc@2x.png"; path = "Resources/Icons/irc@2x.png"; sourceTree = "<group>"; };
 		6103D385129B348200911D8D /* tw@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "tw@2x.png"; path = "Resources/Icons/tw@2x.png"; sourceTree = "<group>"; };
-		6103D392129B34E900911D8D /* joyButtonAttack@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "joyButtonAttack@2x.png"; path = "Resources/Overlay/joyButtonAttack@2x.png"; sourceTree = "<group>"; };
-		6103D393129B34E900911D8D /* joyButtonBackJump@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "joyButtonBackJump@2x.png"; path = "Resources/Overlay/joyButtonBackJump@2x.png"; sourceTree = "<group>"; };
-		6103D394129B34E900911D8D /* joyButtonForwardJump@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "joyButtonForwardJump@2x.png"; path = "Resources/Overlay/joyButtonForwardJump@2x.png"; sourceTree = "<group>"; };
-		6103D399129B350700911D8D /* ammoButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ammoButton@2x.png"; path = "Resources/Overlay/ammoButton@2x.png"; sourceTree = "<group>"; };
-		6103D39A129B350700911D8D /* arrowDown@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrowDown@2x.png"; path = "Resources/Overlay/arrowDown@2x.png"; sourceTree = "<group>"; };
-		6103D39B129B350700911D8D /* arrowLeft@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrowLeft@2x.png"; path = "Resources/Overlay/arrowLeft@2x.png"; sourceTree = "<group>"; };
-		6103D39C129B350700911D8D /* arrowRight@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrowRight@2x.png"; path = "Resources/Overlay/arrowRight@2x.png"; sourceTree = "<group>"; };
-		6103D39D129B350700911D8D /* arrowUp@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrowUp@2x.png"; path = "Resources/Overlay/arrowUp@2x.png"; sourceTree = "<group>"; };
-		6103D39E129B350700911D8D /* cornerButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "cornerButton@2x.png"; path = "Resources/Overlay/cornerButton@2x.png"; sourceTree = "<group>"; };
 		61077E86143FB09800645B29 /* MissionTrainingViewController-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "MissionTrainingViewController-iPad.xib"; sourceTree = "<group>"; };
 		61078029143FCCC800645B29 /* startGameButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "startGameButton@2x.png"; path = "Resources/Frontend/startGameButton@2x.png"; sourceTree = "<group>"; };
 		610782931440EE5C00645B29 /* basicFlags.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = basicFlags.plist; path = Resources/basicFlags.plist; sourceTree = "<group>"; };
 		610782941440EE5C00645B29 /* credits.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = credits.plist; path = Resources/credits.plist; sourceTree = "<group>"; };
 		610782951440EE5C00645B29 /* gameMods.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = gameMods.plist; path = Resources/gameMods.plist; sourceTree = "<group>"; };
+		610C8E3514E018D200CF5C4C /* MNEValueTrackingSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MNEValueTrackingSlider.h; path = Classes/MNEValueTrackingSlider.h; sourceTree = "<group>"; };
+		610C8E3614E018D200CF5C4C /* MNEValueTrackingSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MNEValueTrackingSlider.m; path = Classes/MNEValueTrackingSlider.m; sourceTree = "<group>"; };
+		6115651A147F48AE006729A9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Locale/English.lproj/About.strings; sourceTree = "<group>"; };
+		6115651B147F48AE006729A9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Locale/English.lproj/Localizable.strings; sourceTree = "<group>"; };
+		6115651C147F48AE006729A9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Locale/English.lproj/Scheme.strings; sourceTree = "<group>"; };
+		61156526147F49E1006729A9 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Locale/Spanish.lproj/About.strings; sourceTree = "<group>"; };
+		61156527147F4A2E006729A9 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Locale/Spanish.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61156528147F4A3C006729A9 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Locale/Spanish.lproj/Scheme.strings; sourceTree = "<group>"; };
+		6115652B147F4C45006729A9 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = Locale/French.lproj/Scheme.strings; sourceTree = "<group>"; };
+		6115652C147F4C4C006729A9 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = Locale/French.lproj/Localizable.strings; sourceTree = "<group>"; };
+		6115652D147F4C52006729A9 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = Locale/French.lproj/About.strings; sourceTree = "<group>"; };
+		61156530147F4D10006729A9 /* Polish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Polish; path = Locale/Polish.lproj/About.strings; sourceTree = "<group>"; };
+		61156531147F4D17006729A9 /* Polish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Polish; path = Locale/Polish.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61156532147F4D1E006729A9 /* Polish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Polish; path = Locale/Polish.lproj/Scheme.strings; sourceTree = "<group>"; };
+		61177BA7148A658900686905 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = Locale/German.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61177BA9148A660C00686905 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = Locale/German.lproj/Scheme.strings; sourceTree = "<group>"; };
+		61177BAA148A661600686905 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = Locale/German.lproj/About.strings; sourceTree = "<group>"; };
+		61177BAC148A671600686905 /* Turkish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Turkish; path = Locale/Turkish.lproj/About.strings; sourceTree = "<group>"; };
+		61177BAD148A672000686905 /* Turkish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Turkish; path = Locale/Turkish.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61177BAE148A672C00686905 /* Turkish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Turkish; path = Locale/Turkish.lproj/Scheme.strings; sourceTree = "<group>"; };
+		61177BE4148B881C00686905 /* Danish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Danish; path = Locale/Danish.lproj/About.strings; sourceTree = "<group>"; };
+		61177BF0148B882500686905 /* Danish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Danish; path = Locale/Danish.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61177BF1148B882F00686905 /* Danish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Danish; path = Locale/Danish.lproj/Scheme.strings; sourceTree = "<group>"; };
+		61177C00148B8BB100686905 /* uLandGenMaze.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandGenMaze.pas; path = ../../hedgewars/uLandGenMaze.pas; sourceTree = SOURCE_ROOT; };
+		61177C01148B8BB100686905 /* uLandOutline.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandOutline.pas; path = ../../hedgewars/uLandOutline.pas; sourceTree = SOURCE_ROOT; };
 		611D7A4F142FDCD3006E0798 /* uTouch.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uTouch.pas; path = ../../hedgewars/uTouch.pas; sourceTree = SOURCE_ROOT; };
 		611D9BF812497E9800008271 /* SavedGamesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SavedGamesViewController.h; sourceTree = "<group>"; };
 		611D9BF912497E9800008271 /* SavedGamesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SavedGamesViewController.m; sourceTree = "<group>"; };
 		611D9BFA12497E9800008271 /* SavedGamesViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SavedGamesViewController.xib; sourceTree = "<group>"; };
-		611E0EE511FB20610077A41E /* ammoButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ammoButton.png; path = Resources/Overlay/ammoButton.png; sourceTree = "<group>"; };
-		611E0EE611FB20610077A41E /* cornerButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cornerButton.png; path = Resources/Overlay/cornerButton.png; sourceTree = "<group>"; };
 		611E12FE117BBBDA0044B62F /* Entitlements-Development.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Development.plist"; sourceTree = "<group>"; };
-		611EE973122A9C4100DF6938 /* clickSound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = clickSound.wav; path = Resources/clickSound.wav; sourceTree = "<group>"; };
-		611EE9D7122AA10A00DF6938 /* backSound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = backSound.wav; path = Resources/backSound.wav; sourceTree = "<group>"; };
-		611EE9D8122AA10A00DF6938 /* selSound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = selSound.wav; path = Resources/selSound.wav; sourceTree = "<group>"; };
-		611EEAEB122B2A4D00DF6938 /* HelpPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpPageViewController.h; sourceTree = "<group>"; };
-		611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpPageViewController.m; sourceTree = "<group>"; };
-		611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "HelpPageLobbyViewController-iPad.xib"; sourceTree = "<group>"; };
-		611EEBC0122B34A800DF6938 /* helpingame.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpingame.png; path = Resources/Overlay/helpingame.png; sourceTree = "<group>"; };
-		611EEBC2122B355700DF6938 /* helpbottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpbottom.png; path = Resources/Overlay/helpbottom.png; sourceTree = "<group>"; };
-		611EEBC3122B355700DF6938 /* helpright.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpright.png; path = Resources/Overlay/helpright.png; sourceTree = "<group>"; };
-		611EEC30122B54D700DF6938 /* helpplain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpplain.png; path = Resources/Overlay/helpplain.png; sourceTree = "<group>"; };
+		611EE973122A9C4100DF6938 /* clickSound.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = clickSound.caf; path = Resources/clickSound.caf; sourceTree = "<group>"; };
+		611EE9D7122AA10A00DF6938 /* backSound.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = backSound.caf; path = Resources/backSound.caf; sourceTree = "<group>"; };
+		611EE9D8122AA10A00DF6938 /* selSound.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = selSound.caf; path = Resources/selSound.caf; sourceTree = "<group>"; };
 		611F4D4A11B27A9900F9759A /* uScript.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uScript.pas; path = ../../hedgewars/uScript.pas; sourceTree = SOURCE_ROOT; };
-		6127232E117DF752005B90CF /* SDL_image.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_image.xcodeproj; path = ../../../Library/SDL_image/Xcode_iPhone/SDL_image.xcodeproj; sourceTree = SOURCE_ROOT; };
 		61272338117DF778005B90CF /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
 		6129B9F611EFB04D0017E305 /* denied.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = denied.png; path = Resources/denied.png; sourceTree = "<group>"; };
 		612CABAA1391CE68005E9596 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
-		612CABC71391D3CC005E9596 /* hwclassic.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = hwclassic.mp3; path = Resources/hwclassic.mp3; sourceTree = "<group>"; };
 		61370652117B1D50004EE44A /* Entitlements-Distribution.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Distribution.plist"; sourceTree = "<group>"; };
 		61399012125D19C0003C2DC0 /* uMobile.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uMobile.pas; path = ../../hedgewars/uMobile.pas; sourceTree = SOURCE_ROOT; };
 		6147DAD21253DCDE0010357E /* savesButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = savesButton.png; path = Resources/Frontend/savesButton.png; sourceTree = "<group>"; };
 		614E333D11DE9A93009DBA4E /* VGSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = VGSHandlers.inc; path = ../../hedgewars/VGSHandlers.inc; sourceTree = SOURCE_ROOT; };
+		6154A53114C37E4A00F6EEF6 /* Romanian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Romanian; path = Locale/Romanian.lproj/About.strings; sourceTree = "<group>"; };
+		6154A53E14C37E5400F6EEF6 /* Romanian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Romanian; path = Locale/Romanian.lproj/Localizable.strings; sourceTree = "<group>"; };
+		6154A54014C37EB100F6EEF6 /* Romanian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Romanian; path = Locale/Romanian.lproj/Scheme.strings; sourceTree = "<group>"; };
 		61589C5A144B4322007BFAA4 /* config.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = config.inc; sourceTree = "<group>"; };
 		615AD96112073B4D00F2FF04 /* startGameButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = startGameButton.png; path = Resources/Frontend/startGameButton.png; sourceTree = "<group>"; };
 		615AD9E8120764CA00F2FF04 /* backButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backButton.png; path = Resources/Frontend/backButton.png; sourceTree = "<group>"; };
 		615AD9EA1207654E00F2FF04 /* helpButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpButton.png; path = Resources/Frontend/helpButton.png; sourceTree = "<group>"; };
+		615BE3D3155C5DDF003CA34D /* uInputHandler.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uInputHandler.pas; path = ../../hedgewars/uInputHandler.pas; sourceTree = SOURCE_ROOT; };
+		615E755814E41E8C00FBA131 /* MXAudioPlayerFadeOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MXAudioPlayerFadeOperation.h; path = Classes/MXAudioPlayerFadeOperation.h; sourceTree = "<group>"; };
+		615E755914E41E8C00FBA131 /* MXAudioPlayerFadeOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MXAudioPlayerFadeOperation.m; path = Classes/MXAudioPlayerFadeOperation.m; sourceTree = "<group>"; };
+		615E76B514E4406400FBA131 /* LICENCE.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = LICENCE.rtf; path = Classes/MGSplitViewController/LICENCE.rtf; sourceTree = "<group>"; };
+		615E76B614E4421200FBA131 /* MGSplitCornersView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGSplitCornersView.h; path = Classes/MGSplitViewController/MGSplitCornersView.h; sourceTree = "<group>"; };
+		615E76B714E4421200FBA131 /* MGSplitCornersView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGSplitCornersView.m; path = Classes/MGSplitViewController/MGSplitCornersView.m; sourceTree = "<group>"; };
+		615E76B814E4421200FBA131 /* MGSplitDividerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGSplitDividerView.h; path = Classes/MGSplitViewController/MGSplitDividerView.h; sourceTree = "<group>"; };
+		615E76B914E4421200FBA131 /* MGSplitDividerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGSplitDividerView.m; path = Classes/MGSplitViewController/MGSplitDividerView.m; sourceTree = "<group>"; };
+		615E76BA14E4421200FBA131 /* MGSplitViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGSplitViewController.h; path = Classes/MGSplitViewController/MGSplitViewController.h; sourceTree = "<group>"; };
+		615E76BB14E4421200FBA131 /* MGSplitViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGSplitViewController.m; path = Classes/MGSplitViewController/MGSplitViewController.m; sourceTree = "<group>"; };
 		615FEAD912A2A4C10098EE92 /* checkbox@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "checkbox@2x.png"; path = "Resources/Icons/checkbox@2x.png"; sourceTree = "<group>"; };
 		615FEADE12A2A6640098EE92 /* localplayButton@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "localplayButton@2x~iphone.png"; path = "Resources/Frontend/localplayButton@2x~iphone.png"; sourceTree = "<group>"; };
 		615FEADF12A2A6640098EE92 /* localplayButton~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "localplayButton~ipad.png"; path = "Resources/Frontend/localplayButton~ipad.png"; sourceTree = "<group>"; };
 		615FEAE012A2A6640098EE92 /* localplayButton~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "localplayButton~iphone.png"; path = "Resources/Frontend/localplayButton~iphone.png"; sourceTree = "<group>"; };
+		616065A7159A71FD00CFAEF4 /* hwclassic.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = hwclassic.mp3; path = Resources/hwclassic.mp3; sourceTree = "<group>"; };
 		6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWeaponViewController.h; sourceTree = "<group>"; };
 		6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingleWeaponViewController.m; sourceTree = "<group>"; };
 		61641FE31437CDAA006E049C /* DefinesAndMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefinesAndMacros.h; path = Classes/DefinesAndMacros.h; sourceTree = "<group>"; };
@@ -431,10 +432,6 @@
 		616591F311CA9BA200D6E256 /* MapConfigViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapConfigViewController.m; sourceTree = "<group>"; };
 		616591F411CA9BA200D6E256 /* SettingsBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsBaseViewController.h; sourceTree = "<group>"; };
 		616591F511CA9BA200D6E256 /* SettingsBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsBaseViewController.m; sourceTree = "<group>"; };
-		616591F611CA9BA200D6E256 /* OverlayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlayViewController.h; sourceTree = "<group>"; };
-		616591F711CA9BA200D6E256 /* OverlayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverlayViewController.m; sourceTree = "<group>"; };
-		616591F811CA9BA200D6E256 /* InGameMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InGameMenuViewController.h; sourceTree = "<group>"; };
-		616591F911CA9BA200D6E256 /* InGameMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InGameMenuViewController.m; sourceTree = "<group>"; };
 		616591FA11CA9BA200D6E256 /* SchemeSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeSettingsViewController.h; sourceTree = "<group>"; };
 		616591FB11CA9BA200D6E256 /* SchemeSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SchemeSettingsViewController.m; sourceTree = "<group>"; };
 		616591FC11CA9BA200D6E256 /* SchemeWeaponConfigViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeWeaponConfigViewController.h; sourceTree = "<group>"; };
@@ -467,7 +464,6 @@
 		6165924C11CA9CB400D6E256 /* MainMenuViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "MainMenuViewController-iPhone.xib"; sourceTree = "<group>"; };
 		6165924D11CA9CB400D6E256 /* MapConfigViewController-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "MapConfigViewController-iPad.xib"; sourceTree = "<group>"; };
 		6165924E11CA9CB400D6E256 /* MapConfigViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "MapConfigViewController-iPhone.xib"; sourceTree = "<group>"; };
-		6165925011CA9CB400D6E256 /* OverlayViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OverlayViewController.xib; sourceTree = "<group>"; };
 		6165929C11CA9E2F00D6E256 /* HedgewarsAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HedgewarsAppDelegate.h; path = Classes/HedgewarsAppDelegate.h; sourceTree = "<group>"; };
 		6165929D11CA9E2F00D6E256 /* HedgewarsAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HedgewarsAppDelegate.m; path = Classes/HedgewarsAppDelegate.m; sourceTree = "<group>"; };
 		6167A6731391514600AA6D07 /* RestoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestoreViewController.h; sourceTree = "<group>"; };
@@ -509,11 +505,9 @@
 		6174F7C612CD62E300205D6F /* smallerTitle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = smallerTitle.png; path = Resources/Frontend/smallerTitle.png; sourceTree = "<group>"; };
 		6174F7C712CD62E300205D6F /* smallerTitle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "smallerTitle@2x.png"; path = "Resources/Frontend/smallerTitle@2x.png"; sourceTree = "<group>"; };
 		617987E4114AA34C00BA94A9 /* GSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = GSHandlers.inc; path = ../../hedgewars/GSHandlers.inc; sourceTree = SOURCE_ROOT; };
-		617987E5114AA34C00BA94A9 /* HHHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = HHHandlers.inc; path = ../../hedgewars/HHHandlers.inc; sourceTree = SOURCE_ROOT; };
 		617987E7114AA34C00BA94A9 /* hwengine.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = hwengine.pas; path = ../../hedgewars/hwengine.pas; sourceTree = SOURCE_ROOT; };
 		617987E9114AA34C00BA94A9 /* hwLibrary.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = hwLibrary.pas; path = ../../hedgewars/hwLibrary.pas; sourceTree = SOURCE_ROOT; };
 		617987EB114AA34C00BA94A9 /* options.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = options.inc; path = ../../hedgewars/options.inc; sourceTree = SOURCE_ROOT; };
-		617987EC114AA34C00BA94A9 /* PascalExports.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = PascalExports.pas; path = ../../hedgewars/PascalExports.pas; sourceTree = SOURCE_ROOT; };
 		617987ED114AA34C00BA94A9 /* SDLh.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SDLh.pas; path = ../../hedgewars/SDLh.pas; sourceTree = SOURCE_ROOT; };
 		617987F1114AA34C00BA94A9 /* uAI.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uAI.pas; path = ../../hedgewars/uAI.pas; sourceTree = SOURCE_ROOT; };
 		617987F2114AA34C00BA94A9 /* uAIActions.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uAIActions.pas; path = ../../hedgewars/uAIActions.pas; sourceTree = SOURCE_ROOT; };
@@ -528,7 +522,6 @@
 		617987FB114AA34C00BA94A9 /* uGame.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGame.pas; path = ../../hedgewars/uGame.pas; sourceTree = SOURCE_ROOT; };
 		617987FC114AA34C00BA94A9 /* uGears.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGears.pas; path = ../../hedgewars/uGears.pas; sourceTree = SOURCE_ROOT; };
 		617987FD114AA34C00BA94A9 /* uIO.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uIO.pas; path = ../../hedgewars/uIO.pas; sourceTree = SOURCE_ROOT; };
-		617987FE114AA34C00BA94A9 /* uKeys.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uKeys.pas; path = ../../hedgewars/uKeys.pas; sourceTree = SOURCE_ROOT; };
 		617987FF114AA34C00BA94A9 /* uLand.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLand.pas; path = ../../hedgewars/uLand.pas; sourceTree = SOURCE_ROOT; };
 		61798800114AA34C00BA94A9 /* uLandGraphics.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandGraphics.pas; path = ../../hedgewars/uLandGraphics.pas; sourceTree = SOURCE_ROOT; };
 		61798801114AA34C00BA94A9 /* uLandObjects.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandObjects.pas; path = ../../hedgewars/uLandObjects.pas; sourceTree = SOURCE_ROOT; };
@@ -543,34 +536,41 @@
 		6179880C114AA34C00BA94A9 /* uTeams.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uTeams.pas; path = ../../hedgewars/uTeams.pas; sourceTree = SOURCE_ROOT; };
 		6179880E114AA34C00BA94A9 /* uVisualGears.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uVisualGears.pas; path = ../../hedgewars/uVisualGears.pas; sourceTree = SOURCE_ROOT; };
 		6179880F114AA34C00BA94A9 /* uWorld.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uWorld.pas; path = ../../hedgewars/uWorld.pas; sourceTree = SOURCE_ROOT; };
-		617988D3114AAA3900BA94A9 /* SDLiPhoneOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDLiPhoneOS.xcodeproj; path = "../../../Library/SDL/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		61798934114AB25F00BA94A9 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
-		6179898B114AB3FA00BA94A9 /* SDL_mixer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_mixer.xcodeproj; path = "../../../Library/SDL_mixer/Xcode-iPhoneOS/SDL_mixer.xcodeproj"; sourceTree = SOURCE_ROOT; };
-		61798A0B114AB65600BA94A9 /* SDL_ttf.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_ttf.xcodeproj; path = "../../../Library/SDL_ttf/Xcode-iPhoneOS/SDL_ttf.xcodeproj"; sourceTree = SOURCE_ROOT; };
-		61798A5E114AE08600BA94A9 /* Data */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Data; path = ../../../trunk/project_files/HedgewarsMobile/Data; sourceTree = "<group>"; };
+		61798A5E114AE08600BA94A9 /* Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Data; sourceTree = SOURCE_ROOT; };
+		617BC22D1490210E00E1C294 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Locale/Italian.lproj/About.strings; sourceTree = "<group>"; };
+		617BC2391490211500E1C294 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Locale/Italian.lproj/Localizable.strings; sourceTree = "<group>"; };
+		617BC23A1490211F00E1C294 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Locale/Italian.lproj/Scheme.strings; sourceTree = "<group>"; };
 		6183D83C11E2BCE200A88903 /* Default-ipad-Landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-ipad-Landscape.png"; path = "Resources/Icons/Default-ipad-Landscape.png"; sourceTree = "<group>"; };
 		6183D83D11E2BCE200A88903 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/Icons/Default.png; sourceTree = "<group>"; };
-		61842B23122B619D0096E335 /* HelpPageInGameViewController-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "HelpPageInGameViewController-iPad.xib"; sourceTree = "<group>"; };
-		61842B3D122B65BD0096E335 /* helpabove.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpabove.png; path = Resources/Overlay/helpabove.png; sourceTree = "<group>"; };
-		61842B3F122B66280096E335 /* helpleft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpleft.png; path = Resources/Overlay/helpleft.png; sourceTree = "<group>"; };
 		618899811299516000D55FD6 /* title@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "title@2x~iphone.png"; path = "Resources/Frontend/title@2x~iphone.png"; sourceTree = "<group>"; };
 		61889984129995B500D55FD6 /* title~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "title~ipad.png"; path = "Resources/Frontend/title~ipad.png"; sourceTree = "<group>"; };
-		618E27B612A2C30700C20EF0 /* SDL_net.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_net.xcodeproj; path = "../../../Library/SDL_net/Xcode-iPhoneOS/SDL_net.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		61915D58143A4E2C00299991 /* MissionTrainingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MissionTrainingViewController.h; sourceTree = "<group>"; };
 		61915D59143A4E2C00299991 /* MissionTrainingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MissionTrainingViewController.m; sourceTree = "<group>"; };
 		61915D5A143A4E2C00299991 /* MissionTrainingViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "MissionTrainingViewController-iPhone.xib"; sourceTree = "<group>"; };
+		619349C5160BAF3E00A08518 /* uAILandMarks.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uAILandMarks.pas; path = ../../hedgewars/uAILandMarks.pas; sourceTree = SOURCE_ROOT; };
+		619349C6160BAF3E00A08518 /* uGearsHandlers.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGearsHandlers.pas; path = ../../hedgewars/uGearsHandlers.pas; sourceTree = SOURCE_ROOT; };
+		619349C7160BAF3E00A08518 /* uGearsHandlersRope.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGearsHandlersRope.pas; path = ../../hedgewars/uGearsHandlersRope.pas; sourceTree = SOURCE_ROOT; };
 		619598181364BCD200B429B6 /* Tremor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Tremor.xcodeproj; path = ../../misc/libtremor/Xcode/Tremor.xcodeproj; sourceTree = SOURCE_ROOT; };
 		6195993F1364C82B00B429B6 /* Lua.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Lua.xcodeproj; path = ../../misc/liblua/Xcode/Lua.xcodeproj; sourceTree = SOURCE_ROOT; };
-		619599BA1364E65900B429B6 /* Freetype.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Freetype.xcodeproj; path = "../../misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj"; sourceTree = SOURCE_ROOT; };
+		619599BA1364E65900B429B6 /* Freetype.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Freetype.xcodeproj; path = "../../misc/libfreetype/Xcode-iOS/Freetype.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		6199E81512463EA800DADF8C /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
 		6199E81912463EC400DADF8C /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
 		6199E836124647DE00DADF8C /* SupportViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SupportViewController.h; sourceTree = "<group>"; };
 		6199E837124647DE00DADF8C /* SupportViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SupportViewController.m; sourceTree = "<group>"; };
 		6199E86C12464A8E00DADF8C /* surprise.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = surprise.png; path = Resources/surprise.png; sourceTree = "<group>"; };
+		619BCEC41495615700C1C409 /* Bulgarian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Bulgarian; path = Locale/Bulgarian.lproj/About.strings; sourceTree = "<group>"; };
+		619BCED01495615F00C1C409 /* Bulgarian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Bulgarian; path = Locale/Bulgarian.lproj/Localizable.strings; sourceTree = "<group>"; };
+		619BCED11495616700C1C409 /* Bulgarian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Bulgarian; path = Locale/Bulgarian.lproj/Scheme.strings; sourceTree = "<group>"; };
 		619C5AF3124F7E3100D041AE /* LuaPas.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = LuaPas.pas; path = ../../hedgewars/LuaPas.pas; sourceTree = SOURCE_ROOT; };
 		619C5BA0124FA59000D041AE /* MapPreviewButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapPreviewButtonView.h; path = Classes/MapPreviewButtonView.h; sourceTree = "<group>"; };
 		619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MapPreviewButtonView.m; path = Classes/MapPreviewButtonView.m; sourceTree = "<group>"; };
 		61A117FE1168322700359010 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+		61A19AE314D2010A004B1E6D /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = "../../../Library/SDL/Xcode-iOS/SDL/SDL.xcodeproj"; sourceTree = SOURCE_ROOT; };
+		61A19B6114D20B6C004B1E6D /* SDL_image.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_image.xcodeproj; path = "../../../Library/SDL_image/Xcode-iOS/SDL_image.xcodeproj"; sourceTree = SOURCE_ROOT; };
+		61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_ttf.xcodeproj; path = "../../../Library/SDL_ttf/Xcode-iOS/SDL_ttf.xcodeproj"; sourceTree = SOURCE_ROOT; };
+		61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_net.xcodeproj; path = "../../../Library/SDL_net/Xcode-iOS/SDL_net.xcodeproj"; sourceTree = SOURCE_ROOT; };
+		61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_mixer.xcodeproj; path = "../../../Library/SDL_mixer/Xcode-iOS/SDL_mixer.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		61A4A38912A5CCC2004D81E6 /* uCommandHandlers.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uCommandHandlers.pas; path = ../../hedgewars/uCommandHandlers.pas; sourceTree = SOURCE_ROOT; };
 		61A4A38A12A5CCC2004D81E6 /* uCommands.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uCommands.pas; path = ../../hedgewars/uCommands.pas; sourceTree = SOURCE_ROOT; };
 		61A4A38B12A5CCC2004D81E6 /* uDebug.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uDebug.pas; path = ../../hedgewars/uDebug.pas; sourceTree = SOURCE_ROOT; };
@@ -594,16 +594,21 @@
 		61C079E311F35A300072BF46 /* EditableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EditableCellView.m; path = Classes/EditableCellView.m; sourceTree = "<group>"; };
 		61C28D3D142D380400DA16C2 /* AudioManagerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioManagerController.h; path = Classes/AudioManagerController.h; sourceTree = "<group>"; };
 		61C28D3E142D380400DA16C2 /* AudioManagerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AudioManagerController.m; path = Classes/AudioManagerController.m; sourceTree = "<group>"; };
+		61C6783F14B3DD020087425A /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Portuguese; path = Locale/Portuguese.lproj/About.strings; sourceTree = "<group>"; };
+		61C6784B14B3DD0B0087425A /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Portuguese; path = Locale/Portuguese.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61C6784C14B3DD140087425A /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Portuguese; path = Locale/Portuguese.lproj/Scheme.strings; sourceTree = "<group>"; };
 		61CADE321402EE290030C3EB /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
+		61D08D7114AEA7FE0007C078 /* uGearsHedgehog.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGearsHedgehog.pas; path = ../../hedgewars/uGearsHedgehog.pas; sourceTree = SOURCE_ROOT; };
+		61D08D7214AEA7FE0007C078 /* uGearsList.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGearsList.pas; path = ../../hedgewars/uGearsList.pas; sourceTree = SOURCE_ROOT; };
+		61D08D7314AEA7FE0007C078 /* uGearsUtils.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uGearsUtils.pas; path = ../../hedgewars/uGearsUtils.pas; sourceTree = SOURCE_ROOT; };
+		61D08D8714AEA9670007C078 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Locale/Japanese.lproj/About.strings; sourceTree = "<group>"; };
+		61D08D8814AEA9700007C078 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Locale/Japanese.lproj/Localizable.strings; sourceTree = "<group>"; };
+		61D08D8914AEA9780007C078 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Locale/Japanese.lproj/Scheme.strings; sourceTree = "<group>"; };
 		61D0BDF71457508C0011A899 /* ExtraCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtraCategories.h; path = Classes/ExtraCategories.h; sourceTree = "<group>"; };
 		61D0BDF81457508C0011A899 /* ExtraCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtraCategories.m; path = Classes/ExtraCategories.m; sourceTree = "<group>"; };
 		61D2059F127CDD1100ABD83E /* ObjcExports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjcExports.h; path = Classes/ObjcExports.h; sourceTree = "<group>"; };
 		61D205A0127CDD1100ABD83E /* ObjcExports.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ObjcExports.m; path = Classes/ObjcExports.m; sourceTree = "<group>"; };
 		61D3D2A41290E03A003CE7C3 /* irc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = irc.png; path = Resources/Icons/irc.png; sourceTree = "<group>"; };
-		61DE8F201257EB1100B80214 /* AmmoMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AmmoMenuViewController.h; sourceTree = "<group>"; };
-		61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AmmoMenuViewController.m; sourceTree = "<group>"; };
-		61DF0EDB1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "HelpPageLobbyViewController-iPhone.xib"; sourceTree = "<group>"; };
-		61DF0F201284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "HelpPageInGameViewController-iPhone.xib"; sourceTree = "<group>"; };
 		61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; };
 		61E2E12C12BAAEE30051B659 /* ServerProtocolNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerProtocolNetwork.h; sourceTree = "<group>"; };
 		61E2E12D12BAAEE30051B659 /* ServerProtocolNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ServerProtocolNetwork.m; sourceTree = "<group>"; };
@@ -613,13 +618,6 @@
 		61EBA62811DFF2BC0048B68A /* title~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "title~iphone.png"; path = "Resources/Frontend/title~iphone.png"; sourceTree = "<group>"; };
 		61EDB5AE135B3F97009B29A6 /* GameInterfaceBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameInterfaceBridge.h; sourceTree = "<group>"; };
 		61EDB5AF135B3F97009B29A6 /* GameInterfaceBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameInterfaceBridge.m; sourceTree = "<group>"; };
-		61EF920511DF57AC003441C4 /* arrowDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowDown.png; path = Resources/Overlay/arrowDown.png; sourceTree = "<group>"; };
-		61EF920611DF57AC003441C4 /* arrowLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowLeft.png; path = Resources/Overlay/arrowLeft.png; sourceTree = "<group>"; };
-		61EF920711DF57AC003441C4 /* arrowRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowRight.png; path = Resources/Overlay/arrowRight.png; sourceTree = "<group>"; };
-		61EF920811DF57AC003441C4 /* arrowUp.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowUp.png; path = Resources/Overlay/arrowUp.png; sourceTree = "<group>"; };
-		61EF920911DF57AC003441C4 /* joyButtonAttack.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = joyButtonAttack.png; path = Resources/Overlay/joyButtonAttack.png; sourceTree = "<group>"; };
-		61EF920A11DF57AC003441C4 /* joyButtonBackJump.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = joyButtonBackJump.png; path = Resources/Overlay/joyButtonBackJump.png; sourceTree = "<group>"; };
-		61EF920B11DF57AC003441C4 /* joyButtonForwardJump.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = joyButtonForwardJump.png; path = Resources/Overlay/joyButtonForwardJump.png; sourceTree = "<group>"; };
 		61F2E7CB1205EDE0005734F7 /* AboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = "<group>"; };
 		61F2E7CC1205EDE0005734F7 /* AboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutViewController.m; sourceTree = "<group>"; };
 		61F2E7CD1205EDE0005734F7 /* AboutViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutViewController.xib; sourceTree = "<group>"; };
@@ -648,14 +646,14 @@
 			buildActionMask = 2147483647;
 			files = (
 				922F64900F10F53100DC6EC0 /* libfpc.a in Frameworks */,
-				619599C01364E66B00B429B6 /* libFreetype.a in Frameworks */,
+				616245D114E6160200CC97FB /* libFreetype.a in Frameworks */,
 				619599451364C83D00B429B6 /* libLua.a in Frameworks */,
 				6195981F1364BCEF00B429B6 /* libTremor.a in Frameworks */,
-				61B7A61512FA13B00051E14E /* libSDL.a in Frameworks */,
-				61B7A61612FA13B00051E14E /* libSDL_image.a in Frameworks */,
-				61B7A61712FA13B00051E14E /* libSDL_mixer.a in Frameworks */,
-				61B7A61812FA13B00051E14E /* libSDL_net.a in Frameworks */,
-				61B7A61912FA13B00051E14E /* libSDL_ttf.a in Frameworks */,
+				61A19AFC14D20170004B1E6D /* libSDL2.a in Frameworks */,
+				61A19B7714D20B7A004B1E6D /* libSDL2_image.a in Frameworks */,
+				61A19C2414D20F5A004B1E6D /* libSDL2_mixer.a in Frameworks */,
+				61A19BFA14D20D95004B1E6D /* libSDL2_net.a in Frameworks */,
+				61A19BC714D20CE7004B1E6D /* libSDL2_ttf.a in Frameworks */,
 				1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
 				61A1188511683A8C00359010 /* CoreGraphics.framework in Frameworks */,
 				1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
@@ -679,11 +677,10 @@
 				6163EE4D11CC247D001C0453 /* Game Configuration */,
 				6163EE4C11CC2478001C0453 /* Settings Page */,
 				611D9BF312497B7700008271 /* Satellite Controllers */,
-				6163EE6C11CC253F001C0453 /* Overlay */,
 				616591F011CA9BA200D6E256 /* MainMenuViewController.h */,
 				616591F111CA9BA200D6E256 /* MainMenuViewController.m */,
+				6165924B11CA9CB400D6E256 /* MainMenuViewController-iPad.xib */,
 				6165924C11CA9CB400D6E256 /* MainMenuViewController-iPhone.xib */,
-				6165924B11CA9CB400D6E256 /* MainMenuViewController-iPad.xib */,
 				61EDB5AE135B3F97009B29A6 /* GameInterfaceBridge.h */,
 				61EDB5AF135B3F97009B29A6 /* GameInterfaceBridge.m */,
 				616591E611CA9BA200D6E256 /* EngineProtocolNetwork.h */,
@@ -711,6 +708,7 @@
 				29B97315FDCFA39411CA2CEA /* Other Sources */,
 				29B97323FDCFA39411CA2CEA /* Frameworks */,
 				29B97317FDCFA39411CA2CEA /* Resources */,
+				61156510147F481B006729A9 /* Locale */,
 				19C28FACFE9D520D11CA2CBB /* Products */,
 				61370652117B1D50004EE44A /* Entitlements-Distribution.plist */,
 				611E12FE117BBBDA0044B62F /* Entitlements-Development.plist */,
@@ -739,12 +737,6 @@
 		29B97317FDCFA39411CA2CEA /* Resources */ = {
 			isa = PBXGroup;
 			children = (
-				611EEBC0122B34A800DF6938 /* helpingame.png */,
-				611EEC30122B54D700DF6938 /* helpplain.png */,
-				611EEBC2122B355700DF6938 /* helpbottom.png */,
-				61842B3D122B65BD0096E335 /* helpabove.png */,
-				611EEBC3122B355700DF6938 /* helpright.png */,
-				61842B3F122B66280096E335 /* helpleft.png */,
 				6129B9F611EFB04D0017E305 /* denied.png */,
 				6167C88B14294738003DD50F /* denied@2x.png */,
 				6199E86C12464A8E00DADF8C /* surprise.png */,
@@ -768,11 +760,11 @@
 				619599BA1364E65900B429B6 /* Freetype.xcodeproj */,
 				6195993F1364C82B00B429B6 /* Lua.xcodeproj */,
 				619598181364BCD200B429B6 /* Tremor.xcodeproj */,
-				617988D3114AAA3900BA94A9 /* SDLiPhoneOS.xcodeproj */,
-				6127232E117DF752005B90CF /* SDL_image.xcodeproj */,
-				6179898B114AB3FA00BA94A9 /* SDL_mixer.xcodeproj */,
-				618E27B612A2C30700C20EF0 /* SDL_net.xcodeproj */,
-				61798A0B114AB65600BA94A9 /* SDL_ttf.xcodeproj */,
+				61A19AE314D2010A004B1E6D /* SDL.xcodeproj */,
+				61A19B6114D20B6C004B1E6D /* SDL_image.xcodeproj */,
+				61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */,
+				61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */,
+				61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */,
 				61798934114AB25F00BA94A9 /* AudioToolbox.framework */,
 				612CABAA1391CE68005E9596 /* AVFoundation.framework */,
 				61A117FE1168322700359010 /* CoreGraphics.framework */,
@@ -788,6 +780,16 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
+		61156510147F481B006729A9 /* Locale */ = {
+			isa = PBXGroup;
+			children = (
+				61156520147F48B6006729A9 /* About.strings */,
+				61156522147F48B7006729A9 /* Localizable.strings */,
+				61156524147F48B8006729A9 /* Scheme.strings */,
+			);
+			name = Locale;
+			sourceTree = "<group>";
+		};
 		611D9BF312497B7700008271 /* Satellite Controllers */ = {
 			isa = PBXGroup;
 			children = (
@@ -814,14 +816,36 @@
 		612CABCA1391D3D1005E9596 /* Sounds */ = {
 			isa = PBXGroup;
 			children = (
-				612CABC71391D3CC005E9596 /* hwclassic.mp3 */,
-				611EE973122A9C4100DF6938 /* clickSound.wav */,
-				611EE9D7122AA10A00DF6938 /* backSound.wav */,
-				611EE9D8122AA10A00DF6938 /* selSound.wav */,
+				616065A7159A71FD00CFAEF4 /* hwclassic.mp3 */,
+				611EE973122A9C4100DF6938 /* clickSound.caf */,
+				611EE9D7122AA10A00DF6938 /* backSound.caf */,
+				611EE9D8122AA10A00DF6938 /* selSound.caf */,
 			);
 			name = Sounds;
 			sourceTree = "<group>";
 		};
+		615E75C014E42C9000FBA131 /* MGSplitViewController */ = {
+			isa = PBXGroup;
+			children = (
+				615E76B514E4406400FBA131 /* LICENCE.rtf */,
+				615E76B614E4421200FBA131 /* MGSplitCornersView.h */,
+				615E76B714E4421200FBA131 /* MGSplitCornersView.m */,
+				615E76B814E4421200FBA131 /* MGSplitDividerView.h */,
+				615E76B914E4421200FBA131 /* MGSplitDividerView.m */,
+				615E76BA14E4421200FBA131 /* MGSplitViewController.h */,
+				615E76BB14E4421200FBA131 /* MGSplitViewController.m */,
+			);
+			name = MGSplitViewController;
+			sourceTree = "<group>";
+		};
+		6162456314E6159C00CC97FB /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				6162456714E6159C00CC97FB /* libFreetype.a */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
 		6163EE4C11CC2478001C0453 /* Settings Page */ = {
 			isa = PBXGroup;
 			children = (
@@ -904,26 +928,6 @@
 			name = "Third Level";
 			sourceTree = "<group>";
 		};
-		6163EE6C11CC253F001C0453 /* Overlay */ = {
-			isa = PBXGroup;
-			children = (
-				61DE8F201257EB1100B80214 /* AmmoMenuViewController.h */,
-				61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */,
-				616591F811CA9BA200D6E256 /* InGameMenuViewController.h */,
-				616591F911CA9BA200D6E256 /* InGameMenuViewController.m */,
-				616591F611CA9BA200D6E256 /* OverlayViewController.h */,
-				616591F711CA9BA200D6E256 /* OverlayViewController.m */,
-				6165925011CA9CB400D6E256 /* OverlayViewController.xib */,
-				611EEAEB122B2A4D00DF6938 /* HelpPageViewController.h */,
-				611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */,
-				61DF0F201284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib */,
-				61842B23122B619D0096E335 /* HelpPageInGameViewController-iPad.xib */,
-				61DF0EDB1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib */,
-				611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController-iPad.xib */,
-			);
-			name = Overlay;
-			sourceTree = "<group>";
-		};
 		61641FE21437CD8F006E049C /* Headers */ = {
 			isa = PBXGroup;
 			children = (
@@ -941,7 +945,6 @@
 				61589C5A144B4322007BFAA4 /* config.inc */,
 				617987EB114AA34C00BA94A9 /* options.inc */,
 				617987E4114AA34C00BA94A9 /* GSHandlers.inc */,
-				617987E5114AA34C00BA94A9 /* HHHandlers.inc */,
 				614E333D11DE9A93009DBA4E /* VGSHandlers.inc */,
 			);
 			name = inc;
@@ -950,24 +953,6 @@
 		6179936611501D1E00BA94A9 /* Overlay */ = {
 			isa = PBXGroup;
 			children = (
-				611E0EE511FB20610077A41E /* ammoButton.png */,
-				6103D399129B350700911D8D /* ammoButton@2x.png */,
-				611E0EE611FB20610077A41E /* cornerButton.png */,
-				6103D39E129B350700911D8D /* cornerButton@2x.png */,
-				61EF920511DF57AC003441C4 /* arrowDown.png */,
-				6103D39A129B350700911D8D /* arrowDown@2x.png */,
-				61EF920611DF57AC003441C4 /* arrowLeft.png */,
-				6103D39B129B350700911D8D /* arrowLeft@2x.png */,
-				61EF920711DF57AC003441C4 /* arrowRight.png */,
-				6103D39C129B350700911D8D /* arrowRight@2x.png */,
-				61EF920811DF57AC003441C4 /* arrowUp.png */,
-				6103D39D129B350700911D8D /* arrowUp@2x.png */,
-				61EF920911DF57AC003441C4 /* joyButtonAttack.png */,
-				6103D392129B34E900911D8D /* joyButtonAttack@2x.png */,
-				61EF920A11DF57AC003441C4 /* joyButtonBackJump.png */,
-				6103D393129B34E900911D8D /* joyButtonBackJump@2x.png */,
-				61EF920B11DF57AC003441C4 /* joyButtonForwardJump.png */,
-				6103D394129B34E900911D8D /* joyButtonForwardJump@2x.png */,
 			);
 			name = Overlay;
 			sourceTree = "<group>";
@@ -988,51 +973,43 @@
 			name = Products;
 			sourceTree = "<group>";
 		};
-		619599BB1364E65900B429B6 /* Products */ = {
+		61A19AE414D2010A004B1E6D /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				619599BF1364E65900B429B6 /* libFreetype.a */,
+				61A19AEA14D2010A004B1E6D /* libSDL2.a */,
+				61A19AEC14D2010A004B1E6D /* testsdl.app */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 		};
-		61B7A54712FA129F0051E14E /* Products */ = {
+		61A19B6214D20B6C004B1E6D /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				61B7A54E12FA129F0051E14E /* libSDL.a */,
-				61B7A55012FA129F0051E14E /* testsdl.app */,
+				61A19B6614D20B6C004B1E6D /* libSDL2_image.a */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 		};
-		61B7A55412FA12AD0051E14E /* Products */ = {
+		61A19BC214D20CDA004B1E6D /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				61B7A55812FA12AD0051E14E /* libSDL_image.a */,
+				61A19BC614D20CDA004B1E6D /* libSDL2_ttf.a */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 		};
-		61B7A55C12FA12BF0051E14E /* Products */ = {
+		61A19BF514D20D83004B1E6D /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				61B7A56012FA12BF0051E14E /* libSDL_mixer.a */,
+				61A19BF914D20D83004B1E6D /* libSDL2_net.a */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 		};
-		61B7A56412FA12D00051E14E /* Products */ = {
+		61A19C1F14D20F51004B1E6D /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				61B7A56812FA12D00051E14E /* libSDL_net.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		61B7A58C12FA13330051E14E /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				61B7A59012FA13330051E14E /* libSDL_ttf.a */,
+				61A19C2314D20F51004B1E6D /* libSDL2_mixer.a */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -1040,6 +1017,9 @@
 		61DE91561258B76800B80214 /* Custom UIs */ = {
 			isa = PBXGroup;
 			children = (
+				615E75C014E42C9000FBA131 /* MGSplitViewController */,
+				610C8E3514E018D200CF5C4C /* MNEValueTrackingSlider.h */,
+				610C8E3614E018D200CF5C4C /* MNEValueTrackingSlider.m */,
 				619C5BA0124FA59000D041AE /* MapPreviewButtonView.h */,
 				619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */,
 				61F544C512AF1748007FD913 /* HoldTableViewCell.h */,
@@ -1102,6 +1082,8 @@
 		61F8535314578999002CA294 /* Helpers */ = {
 			isa = PBXGroup;
 			children = (
+				615E755814E41E8C00FBA131 /* MXAudioPlayerFadeOperation.h */,
+				615E755914E41E8C00FBA131 /* MXAudioPlayerFadeOperation.m */,
 				61C28D3D142D380400DA16C2 /* AudioManagerController.h */,
 				61C28D3E142D380400DA16C2 /* AudioManagerController.m */,
 				6165922411CA9BD500D6E256 /* CGPointUtils.h */,
@@ -1151,6 +1133,16 @@
 		9283015C0F10E48900CC5A3C /* Pascal Sources */ = {
 			isa = PBXGroup;
 			children = (
+				619349C5160BAF3E00A08518 /* uAILandMarks.pas */,
+				619349C6160BAF3E00A08518 /* uGearsHandlers.pas */,
+				619349C7160BAF3E00A08518 /* uGearsHandlersRope.pas */,
+				615BE3D3155C5DDF003CA34D /* uInputHandler.pas */,
+				61798892114AA56300BA94A9 /* inc */,
+				61D08D7114AEA7FE0007C078 /* uGearsHedgehog.pas */,
+				61D08D7214AEA7FE0007C078 /* uGearsList.pas */,
+				61D08D7314AEA7FE0007C078 /* uGearsUtils.pas */,
+				61177C00148B8BB100686905 /* uLandGenMaze.pas */,
+				61177C01148B8BB100686905 /* uLandOutline.pas */,
 				611D7A4F142FDCD3006E0798 /* uTouch.pas */,
 				61A976B2136F668500DD9878 /* uCursor.pas */,
 				61E5D68C12AB006F00566F29 /* uLandPainted.pas */,
@@ -1168,11 +1160,9 @@
 				61A4A39312A5CCC2004D81E6 /* uVariables.pas */,
 				61399012125D19C0003C2DC0 /* uMobile.pas */,
 				619C5AF3124F7E3100D041AE /* LuaPas.pas */,
-				61798892114AA56300BA94A9 /* inc */,
 				61E1F4F711D004240016A5AA /* adler32.pas */,
 				617987E7114AA34C00BA94A9 /* hwengine.pas */,
 				617987E9114AA34C00BA94A9 /* hwLibrary.pas */,
-				617987EC114AA34C00BA94A9 /* PascalExports.pas */,
 				617987ED114AA34C00BA94A9 /* SDLh.pas */,
 				617987F1114AA34C00BA94A9 /* uAI.pas */,
 				617987F2114AA34C00BA94A9 /* uAIActions.pas */,
@@ -1187,7 +1177,6 @@
 				617987FB114AA34C00BA94A9 /* uGame.pas */,
 				617987FC114AA34C00BA94A9 /* uGears.pas */,
 				617987FD114AA34C00BA94A9 /* uIO.pas */,
-				617987FE114AA34C00BA94A9 /* uKeys.pas */,
 				617987FF114AA34C00BA94A9 /* uLand.pas */,
 				61798800114AA34C00BA94A9 /* uLandGraphics.pas */,
 				61798801114AA34C00BA94A9 /* uLandObjects.pas */,
@@ -1262,12 +1251,20 @@
 				Japanese,
 				French,
 				German,
+				Spanish,
+				Polish,
+				Turkish,
+				Danish,
+				Italian,
+				Bulgarian,
+				Portuguese,
+				Romanian,
 			);
 			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
 			projectDirPath = "";
 			projectReferences = (
 				{
-					ProductGroup = 619599BB1364E65900B429B6 /* Products */;
+					ProductGroup = 6162456314E6159C00CC97FB /* Products */;
 					ProjectRef = 619599BA1364E65900B429B6 /* Freetype.xcodeproj */;
 				},
 				{
@@ -1275,24 +1272,24 @@
 					ProjectRef = 6195993F1364C82B00B429B6 /* Lua.xcodeproj */;
 				},
 				{
-					ProductGroup = 61B7A55412FA12AD0051E14E /* Products */;
-					ProjectRef = 6127232E117DF752005B90CF /* SDL_image.xcodeproj */;
+					ProductGroup = 61A19AE414D2010A004B1E6D /* Products */;
+					ProjectRef = 61A19AE314D2010A004B1E6D /* SDL.xcodeproj */;
 				},
 				{
-					ProductGroup = 61B7A55C12FA12BF0051E14E /* Products */;
-					ProjectRef = 6179898B114AB3FA00BA94A9 /* SDL_mixer.xcodeproj */;
+					ProductGroup = 61A19B6214D20B6C004B1E6D /* Products */;
+					ProjectRef = 61A19B6114D20B6C004B1E6D /* SDL_image.xcodeproj */;
 				},
 				{
-					ProductGroup = 61B7A56412FA12D00051E14E /* Products */;
-					ProjectRef = 618E27B612A2C30700C20EF0 /* SDL_net.xcodeproj */;
+					ProductGroup = 61A19C1F14D20F51004B1E6D /* Products */;
+					ProjectRef = 61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */;
 				},
 				{
-					ProductGroup = 61B7A58C12FA13330051E14E /* Products */;
-					ProjectRef = 61798A0B114AB65600BA94A9 /* SDL_ttf.xcodeproj */;
+					ProductGroup = 61A19BF514D20D83004B1E6D /* Products */;
+					ProjectRef = 61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */;
 				},
 				{
-					ProductGroup = 61B7A54712FA129F0051E14E /* Products */;
-					ProjectRef = 617988D3114AAA3900BA94A9 /* SDLiPhoneOS.xcodeproj */;
+					ProductGroup = 61A19BC214D20CDA004B1E6D /* Products */;
+					ProjectRef = 61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */;
 				},
 				{
 					ProductGroup = 619598191364BCD200B429B6 /* Products */;
@@ -1309,6 +1306,13 @@
 /* End PBXProject section */
 
 /* Begin PBXReferenceProxy section */
+		6162456714E6159C00CC97FB /* libFreetype.a */ = {
+			isa = PBXReferenceProxy;
+			fileType = archive.ar;
+			path = libFreetype.a;
+			remoteRef = 6162456614E6159C00CC97FB /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
 		6195981D1364BCD200B429B6 /* libTremor.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
@@ -1323,53 +1327,46 @@
 			remoteRef = 619599431364C82B00B429B6 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		619599BF1364E65900B429B6 /* libFreetype.a */ = {
+		61A19AEA14D2010A004B1E6D /* libSDL2.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
-			path = libFreetype.a;
-			remoteRef = 619599BE1364E65900B429B6 /* PBXContainerItemProxy */;
+			path = libSDL2.a;
+			remoteRef = 61A19AE914D2010A004B1E6D /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		61B7A54E12FA129F0051E14E /* libSDL.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL.a;
-			remoteRef = 61B7A54D12FA129F0051E14E /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		61B7A55012FA129F0051E14E /* testsdl.app */ = {
+		61A19AEC14D2010A004B1E6D /* testsdl.app */ = {
 			isa = PBXReferenceProxy;
 			fileType = wrapper.application;
 			path = testsdl.app;
-			remoteRef = 61B7A54F12FA129F0051E14E /* PBXContainerItemProxy */;
+			remoteRef = 61A19AEB14D2010A004B1E6D /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		61B7A55812FA12AD0051E14E /* libSDL_image.a */ = {
+		61A19B6614D20B6C004B1E6D /* libSDL2_image.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
-			path = libSDL_image.a;
-			remoteRef = 61B7A55712FA12AD0051E14E /* PBXContainerItemProxy */;
+			path = libSDL2_image.a;
+			remoteRef = 61A19B6514D20B6C004B1E6D /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		61B7A56012FA12BF0051E14E /* libSDL_mixer.a */ = {
+		61A19BC614D20CDA004B1E6D /* libSDL2_ttf.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
-			path = libSDL_mixer.a;
-			remoteRef = 61B7A55F12FA12BF0051E14E /* PBXContainerItemProxy */;
+			path = libSDL2_ttf.a;
+			remoteRef = 61A19BC514D20CDA004B1E6D /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		61B7A56812FA12D00051E14E /* libSDL_net.a */ = {
+		61A19BF914D20D83004B1E6D /* libSDL2_net.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
-			path = libSDL_net.a;
-			remoteRef = 61B7A56712FA12D00051E14E /* PBXContainerItemProxy */;
+			path = libSDL2_net.a;
+			remoteRef = 61A19BF814D20D83004B1E6D /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		61B7A59012FA13330051E14E /* libSDL_ttf.a */ = {
+		61A19C2314D20F51004B1E6D /* libSDL2_mixer.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
-			path = libSDL_ttf.a;
-			remoteRef = 61B7A58F12FA13330051E14E /* PBXContainerItemProxy */;
+			path = libSDL2_mixer.a;
+			remoteRef = 61A19C2214D20F51004B1E6D /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
 /* End PBXReferenceProxy section */
@@ -1384,14 +1381,6 @@
 				611E12FF117BBBDA0044B62F /* Entitlements-Development.plist in Resources */,
 				6165925311CA9CB400D6E256 /* MainMenuViewController-iPad.xib in Resources */,
 				6165925511CA9CB400D6E256 /* MapConfigViewController-iPad.xib in Resources */,
-				6165925811CA9CB400D6E256 /* OverlayViewController.xib in Resources */,
-				61EF920E11DF57AC003441C4 /* arrowDown.png in Resources */,
-				61EF920F11DF57AC003441C4 /* arrowLeft.png in Resources */,
-				61EF921011DF57AC003441C4 /* arrowRight.png in Resources */,
-				61EF921111DF57AC003441C4 /* arrowUp.png in Resources */,
-				61EF921211DF57AC003441C4 /* joyButtonAttack.png in Resources */,
-				61EF921311DF57AC003441C4 /* joyButtonBackJump.png in Resources */,
-				61EF921411DF57AC003441C4 /* joyButtonForwardJump.png in Resources */,
 				61F9040911DF58B00068B24D /* settingsButton.png in Resources */,
 				61F9040B11DF59370068B24D /* background.png in Resources */,
 				61EBA62A11DFF2BC0048B68A /* title~iphone.png in Resources */,
@@ -1401,23 +1390,13 @@
 				61F7A43C11E290650040BA66 /* Icon.png in Resources */,
 				61F7A43E11E290650040BA66 /* iTunesArtwork.png in Resources */,
 				6129B9F711EFB04D0017E305 /* denied.png in Resources */,
-				611E0EE711FB20610077A41E /* ammoButton.png in Resources */,
-				611E0EE811FB20610077A41E /* cornerButton.png in Resources */,
 				61F2E7CF1205EDE0005734F7 /* AboutViewController.xib in Resources */,
 				61F2E7EC12060E31005734F7 /* checkbox.png in Resources */,
 				615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */,
 				615AD9E9120764CA00F2FF04 /* backButton.png in Resources */,
 				615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */,
-				611EE974122A9C4100DF6938 /* clickSound.wav in Resources */,
-				611EE9DA122AA10A00DF6938 /* selSound.wav in Resources */,
-				611EEAEF122B2A4D00DF6938 /* HelpPageLobbyViewController-iPad.xib in Resources */,
-				611EEBC1122B34A800DF6938 /* helpingame.png in Resources */,
-				611EEBC4122B355700DF6938 /* helpbottom.png in Resources */,
-				611EEBC5122B355700DF6938 /* helpright.png in Resources */,
-				611EEC31122B54D700DF6938 /* helpplain.png in Resources */,
-				61842B24122B619D0096E335 /* HelpPageInGameViewController-iPad.xib in Resources */,
-				61842B3E122B65BD0096E335 /* helpabove.png in Resources */,
-				61842B40122B66280096E335 /* helpleft.png in Resources */,
+				611EE974122A9C4100DF6938 /* clickSound.caf in Resources */,
+				611EE9DA122AA10A00DF6938 /* selSound.caf in Resources */,
 				6199E86D12464A8E00DADF8C /* surprise.png in Resources */,
 				611D9BFC12497E9800008271 /* SavedGamesViewController.xib in Resources */,
 				6147DAD31253DCDE0010357E /* savesButton.png in Resources */,
@@ -1428,9 +1407,7 @@
 				61A670C212747DBD00B06CE7 /* MapConfigViewController-iPhone.xib in Resources */,
 				61E2F7441283752C00E12521 /* fb.png in Resources */,
 				61E2F7451283752C00E12521 /* tw.png in Resources */,
-				61DF0EDC1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib in Resources */,
-				61DF0F211284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib in Resources */,
-				61808A5D128C930A005D0E2F /* backSound.wav in Resources */,
+				61808A5D128C930A005D0E2F /* backSound.caf in Resources */,
 				61D3D2A51290E03A003CE7C3 /* irc.png in Resources */,
 				6172FED91298CF9800D73365 /* background~iphone.png in Resources */,
 				6172FEEF1298D25D00D73365 /* mediumBackground~ipad.png in Resources */,
@@ -1439,22 +1416,13 @@
 				61889985129995B500D55FD6 /* title~ipad.png in Resources */,
 				615FEAE212A2A6640098EE92 /* localplayButton~ipad.png in Resources */,
 				615FEAE312A2A6640098EE92 /* localplayButton~iphone.png in Resources */,
-				61188BF212A6FE530026C5DA /* ammoButton@2x.png in Resources */,
-				61188BF312A6FE540026C5DA /* arrowDown@2x.png in Resources */,
-				61188BF412A6FE560026C5DA /* arrowLeft@2x.png in Resources */,
-				61188BF512A6FE570026C5DA /* arrowRight@2x.png in Resources */,
-				61188BF612A6FE590026C5DA /* arrowUp@2x.png in Resources */,
 				61188BF712A6FE5A0026C5DA /* backButton@2x.png in Resources */,
 				61188BF812A6FE5C0026C5DA /* background@2x~iphone.png in Resources */,
 				61188BF912A6FE5D0026C5DA /* checkbox@2x.png in Resources */,
-				61188BFA12A6FE5E0026C5DA /* cornerButton@2x.png in Resources */,
 				61188BFB12A6FE610026C5DA /* Default-ipad-Landscape.png in Resources */,
 				61188BFC12A6FE630026C5DA /* Default@2x.png in Resources */,
 				61188BFD12A6FE730026C5DA /* fb@2x.png in Resources */,
 				61188BFE12A6FE7C0026C5DA /* irc@2x.png in Resources */,
-				61188BFF12A6FE7E0026C5DA /* joyButtonAttack@2x.png in Resources */,
-				61188C0012A6FE810026C5DA /* joyButtonBackJump@2x.png in Resources */,
-				61188C0112A6FE820026C5DA /* joyButtonForwardJump@2x.png in Resources */,
 				61188C0212A6FE840026C5DA /* localplayButton@2x~iphone.png in Resources */,
 				61188C0312A6FE860026C5DA /* netplayButton.png in Resources */,
 				61188C0412A6FE880026C5DA /* savesButton@2x.png in Resources */,
@@ -1467,7 +1435,6 @@
 				6174F7C912CD62E300205D6F /* smallerTitle@2x.png in Resources */,
 				6167A6771391514600AA6D07 /* RestoreViewController-iPhone.xib in Resources */,
 				6167A72D13919E6800AA6D07 /* RestoreViewController-iPad.xib in Resources */,
-				612CABC81391D3CC005E9596 /* hwclassic.mp3 in Resources */,
 				6167C87414294727003DD50F /* surprise@2x.png in Resources */,
 				6167C88C14294738003DD50F /* denied@2x.png in Resources */,
 				6167C8F51429502C003DD50F /* hedgehog.png in Resources */,
@@ -1497,6 +1464,10 @@
 				610782971440EE5C00645B29 /* credits.plist in Resources */,
 				610782981440EE5C00645B29 /* gameMods.plist in Resources */,
 				61B9A86814423A9D001541C1 /* GameConfigViewController-iPad.xib in Resources */,
+				61156521147F48B6006729A9 /* About.strings in Resources */,
+				61156523147F48B7006729A9 /* Localizable.strings in Resources */,
+				61156525147F48B8006729A9 /* Scheme.strings in Resources */,
+				616065A8159A71FD00CFAEF4 /* hwclassic.mp3 in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1514,7 +1485,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\n\n#create config.inc\necho \"Updating config file...\"\nPROTO=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep HEDGEWARS_PROTO_VER | cut -d ' ' -f 2 | cut -d ')' -f 1`\nMAJN=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MAJOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nMINN=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MINOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nPATN=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep CPACK_PACKAGE_VERSION_PATCH | xargs | cut -d ' ' -f 2 |cut -d '$' -f 1`\nREVN=-`/usr/local/bin/hg id -n ${PROJECT_DIR}/../../`\necho \"const cNetProtoVersion = $PROTO; const cVersionString = '${MAJN}.${MINN}.${PATN}${REVN}'; const cLuaLibrary = '';\" > ${PROJECT_DIR}/config.inc\n\necho \"Copying Data...\"\ncp -R ${PROJECT_DIR}/../../share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some files from QTfrontend/res\necho \"Fetching additional graphics from QTfrontend...\"\nmkdir ${PROJECT_DIR}/Data/Graphics/Icons\ncp    ${PROJECT_DIR}/../../QTfrontend/res/{btn*,icon*,StatsMedal*,ammopic*}.png  ${PROJECT_DIR}/Data/Graphics/Icons/\n\necho \"Removing text and dummy files...\"\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg* -delete\nfind ${PROJECT_DIR}/Data -name *.psd -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\nfind ${PROJECT_DIR}/Data -name *.ts -delete\n\n#delete dummy maps and hats, misc stuff\nrm -rf ${PROJECT_DIR}/Data/Maps/test*\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/{TeamCap,TeamHeadband,TeamHair}\nrm -rf ${PROJECT_DIR}/Data/misc/\n\n#delete forbidden maps and WIP themes (remember to check that no Map uses them)\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\nrm -rf ${PROJECT_DIR}/Data/Themes/{Beach,Digital}\n\n#delete all names, reserved hats and unused fonts\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\necho \"Handling audio files...\"\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n#delete the main theme file\nrm -rf ${PROJECT_DIR}/Data/Music/main_theme.ogg\n#copy mono audio\ncp -R ${PROJECT_DIR}/Audio/* ${PROJECT_DIR}/Data/\n#remove unused voices\nfor i in {Amazing,Brilliant,Bugger,Bungee,Cutitout,Drat,Excellent,Fire,FlawlessPossibility,Gonnagetyou,Grenade,Hmm,Justyouwait,Leavemealone,Ohdear,Ouch,Perfect,Revenge,Runaway,Solong,Thisoneismine,VictoryPossibility,Watchthis,Whatthe,Whoopsee}; do find Data/Sounds/voices/ -name $i.ogg -delete; done\n\necho \"Tweaking Data contents...\"\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nfor i in `ls ${PROJECT_DIR}/Data/Maps/`; do if [[ `ls -f ${PROJECT_DIR}/Data/Maps/$i/map.lua 2> /dev/null` != '' ]]; then mv ${PROJECT_DIR}/Data/Maps/$i ${PROJECT_DIR}/Data/Missions/Maps/; fi; done;\n#workaround for missing map in CTF_Blizzard\nln -s ../../../Maps/Blizzard/map.png ${PROJECT_DIR}/Data/Missions/Maps/CTF_Blizzard/map.png\n#remove cfg files since we have plists\nfind ${PROJECT_DIR}/Data/Scripts -name *.cfg -delete\nif ((`ls ${PROJECT_DIR}/Data/Scripts/Multiplayer/*.lua|wc -l` >= `ls ${PROJECT_DIR}/Data/Scripts/plist/*.plist|wc -l` ))\nthen\necho \"${PROJECT_DIR}/Data/Scripts/Multiplayer/Normal.plist:0: warning, missing plist implementation of a Multiplayer script file\"\nfi\n\n#reduce the number of flakes for City\nsed -i -e 's/1500/50/' ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n#cleanup missions/trainings info\nsed -i -e -n '/\"/p' ${PROJECT_DIR}/Data/Locale/missions_en.txt\n\necho \"Done\"";
+			shellScript = "SOURCE_DIR=${PROJECT_DIR}/../../\n\n#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\n\n#create config.inc\necho \"Updating config file...\"\nPROTO=`cat ${SOURCE_DIR}/CMakeLists.txt | grep HEDGEWARS_PROTO_VER | cut -d ' ' -f 2 | cut -d ')' -f 1`\nMAJN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MAJOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nMINN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MINOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nPATN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_PATCH | xargs | cut -d ' ' -f 2 |cut -d '$' -f 1`\nREVN=-`/usr/local/bin/hg id -n ${SOURCE_DIR}`\necho \"const cNetProtoVersion = $PROTO; const cVersionString = '${MAJN}.${MINN}.${PATN}${REVN}'; const cLuaLibrary = '';\" > ${PROJECT_DIR}/config.inc\n\necho \"Copying Data...\"\ncp -R ${SOURCE_DIR}/share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some other files\necho \"Fetching additional graphics...\"\nmkdir -p ${PROJECT_DIR}/Data/Graphics/Icons\ncp    ${SOURCE_DIR}/QTfrontend/res/{btn*,icon*,StatsMedal*,ammopic*}.png ${PROJECT_DIR}/Data/Graphics/Icons/\ncp -R ${SOURCE_DIR}/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons ${PROJECT_DIR}/Data/Graphics/\n\necho \"Removing text and dummy files...\"\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg* -delete\nfind ${PROJECT_DIR}/Data -name *.psd -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\nfind ${PROJECT_DIR}/Data -name *.ts -delete\n\n#delete dummy maps and hats, misc stuff\nrm -rf ${PROJECT_DIR}/Data/Maps/test*\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/{TeamCap,TeamHeadband,TeamHair}\nrm -rf ${PROJECT_DIR}/Data/misc/\n\n#delete forbidden maps and WIP themes (remember to check that no Map uses them)\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\nrm -rf ${PROJECT_DIR}/Data/Themes/{Beach,Digital}\n\n#delete all names, reserved hats and unused fonts\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\necho \"Handling audio files...\"\n#copy mono audio\ncp -R ${SOURCE_DIR}/project_files/AudioMono/* ${PROJECT_DIR}/Data/\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n#delete the main theme file\nrm -rf ${PROJECT_DIR}/Data/Music/main_theme.ogg\n\n#remove unused voices\nfor i in {Amazing,Brilliant,Bugger,Bungee,Cutitout,Drat,Excellent,Fire,FlawlessPossibility,Gonnagetyou,Grenade,Hmm,Justyouwait,Leavemealone,Ohdear,Ouch,Perfect,Revenge,Runaway,Solong,Thisoneismine,VictoryPossibility,Watchthis,Whatthe,Whoopsee}; do find Data/Sounds/voices/ -name $i.ogg -delete; done\n\necho \"Tweaking Data contents...\"\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nfor i in `ls ${PROJECT_DIR}/Data/Maps/`;\ndo \n    if [[ `ls -f ${PROJECT_DIR}/Data/Maps/$i/map.lua 2> /dev/null` != '' ]];\n    then\n        mv ${PROJECT_DIR}/Data/Maps/$i ${PROJECT_DIR}/Data/Missions/Maps/;\n    fi;\ndone;\n\n#workaround for missing map in CTF_Blizzard\nln -s ../../../Maps/Blizzard/map.png ${PROJECT_DIR}/Data/Missions/Maps/CTF_Blizzard/map.png\n\n#reduce the number of flakes for City\nsed -i -e 's/1500/50/' ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\necho \"Done\"";
 			showEnvVarsInLog = 0;
 		};
 		9283011B0F10CB2D00CC5A3C /* Build libfpc.a */ = {
@@ -1531,7 +1502,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "# Build libfpc.a\n# 9 July 2006 (Jonas Maebe)\n#   * original version\n# 15 September 2006 (Erling Johansen)\n#   * simplified\n# 26 April 2007 (Jonas Maebe)\n#  * added support for ppc64/x86_64 (future proofing)\n# 4 August 2007 (Jonas Maebe)\n#  * call ranlib after ar so the toc of the library is up-to-date\n# 3 January 2009 (Jonas Maebe)\n#  * support for ARM\n# 24 October 2009 (Jonas Maebe)\n#  * don't hardcode version 2.3.1 anymore under certain circumstances\n#  * use the FPC_RTL_UNITS_BASE setting\n# 13 December 2009 (Jonas Maebe)\n#  * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nrm -f \"$TARGET_TEMP_DIR\"/*.a\nnarch=\n\ntemparchs=`echo $ARCHS|sed -e 's/arm[^\\w]*/arm\\\n/'|sort -u`\nfor arch in $temparchs\ndo\n\tcase $arch in\n\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n\t\ti386) fpc_arch=386; fpc_rtl=i386 ;;\n\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t*) continue\n\tesac\n\tif test -e \"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch}\n\tthen\n\t\tupath=\"$FPC_RTL_UNITS_BASE\"/`\"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch} -iV`/units/${fpc_rtl}-darwin\n\t\tar -q \"$TARGET_TEMP_DIR\"/libfpc${narch}.a `ls \"$upath\"/*/*.o | grep -v 'darwin/fv/'`\n\t\tranlib \"$TARGET_TEMP_DIR\"/libfpc${narch}.a\n\t\tnarch=${narch}x\n\telse\n\t\techo error: can\\'t build libfpc.a for $arch \\(${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch} not found, derived from FPC_COMPILER_BINARY_DIR project setting\\)\n\tfi\ndone\n\nif test ${#narch} -gt 1\nthen\n\tlipo -create \"$TARGET_TEMP_DIR\"/libfpc*.a -output \"$TARGET_BUILD_DIR\"/libfpc.a\n\trm -f \"$TARGET_TEMP_DIR\"/*.a\nelse\n\tmv \"$TARGET_TEMP_DIR\"/libfpc.a \"$TARGET_BUILD_DIR\"\nfi\n";
+			shellScript = "# Build libfpc.a\n# 9 July 2006 (Jonas Maebe)\n#   * original version\n# 15 September 2006 (Erling Johansen)\n#   * simplified\n# 26 April 2007 (Jonas Maebe)\n#  * added support for ppc64/x86_64 (future proofing)\n# 4 August 2007 (Jonas Maebe)\n#  * call ranlib after ar so the toc of the library is up-to-date\n# 3 January 2009 (Jonas Maebe)\n#  * support for ARM\n# 24 October 2009 (Jonas Maebe)\n#  * don't hardcode version 2.3.1 anymore under certain circumstances\n#  * use the FPC_RTL_UNITS_BASE setting\n# 13 December 2009 (Jonas Maebe)\n#  * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nrm -f \"$TARGET_TEMP_DIR\"/*.a\nnarch=\n\ntemparchs=`echo $ARCHS|sed -e 's/arm[^\\w]*/arm\\\n/'|sort -u`\nfor arch in $temparchs\ndo\n\ttargetos=darwin;\n\tcase $arch in\n\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n\t\ti386) fpc_arch=386; fpc_rtl=i386; targetos=iphonesim ;;\n\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t*) continue\n\tesac\n\tif test -e \"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch}\n\tthen\n\t\tupath=\"$FPC_RTL_UNITS_BASE\"/`\"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch} -iV`/units/${fpc_rtl}-${targetos}\n\t\tar -q \"$TARGET_TEMP_DIR\"/libfpc${narch}.a `ls \"$upath\"/*/*.o | grep -v 'darwin/fv/'`\n\t\tranlib \"$TARGET_TEMP_DIR\"/libfpc${narch}.a\n\t\tnarch=${narch}x\n\telse\n\t\techo error: can\\'t build libfpc.a for $arch \\(${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch} not found, derived from FPC_COMPILER_BINARY_DIR project setting\\)\n\tfi\ndone\n\nif test ${#narch} -gt 1\nthen\n\tlipo -create \"$TARGET_TEMP_DIR\"/libfpc*.a -output \"$TARGET_BUILD_DIR\"/libfpc.a\n\trm -f \"$TARGET_TEMP_DIR\"/*.a\nelse\n\tmv \"$TARGET_TEMP_DIR\"/libfpc.a \"$TARGET_BUILD_DIR\"\nfi\n";
 		};
 		928301560F10E04C00CC5A3C /* Compile Pascal Sources */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -1546,7 +1517,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "# Compile Pascal Sources\n# 15sep06,ejo  written.\n# 26 April 2007 - Jonas Maebe\n#  * support for ppc64 and x86_64\n#  * don't run when cleaning (in case running scripts when cleaning is ever fixed by Apple)\n#  * split the options in FPC_COMMON_FLAGS (common to all configurations) and FPC_CFG_SPECIFIC_FLAGS (per configuration)\n# 4 January 2009 - Jonas Maebe\n#  * support for ARM\n# 24 October 2009 - Jonas Maebe\n#  * don't hardcode 2.3.1 in some cases anymore\n# 13 December 2009 (Jonas Maebe)\n#  * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nif [ x\"$ACTION\" != \"xbuild\" ]; then\n  # in case running scripts during cleaning gets fixed\n  exit 0\nfi\n\nif test ! -e \"$FPC_MAIN_FILE\"\nthen\n\techo error: FPC_MAIN_FILE not found \\($FPC_MAIN_FILE\\)\n\texit 2\nfi\n\nfor variant in $BUILD_VARIANTS\ndo\n\tfor arch in $ARCHS\n\tdo\n\t\tcase $arch in\n\t\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n\t\t\ti386) fpc_arch=386; fpc_rtl=i386 ;;\n\t\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n\t\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n\t\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t\t*) continue\n\t\tesac\n\n\t\tapp_target_temp_dir=$CONFIGURATION_TEMP_DIR/`basename \"$PROJECT_TEMP_DIR\"`\n\t\tout_dir=$app_target_temp_dir/`basename \"$DERIVED_SOURCES_DIR\"`-$variant/$arch\n\t\tfpccompiler=\"${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch}\"\n\t\tif test -e \"$fpccompiler\"\n\t\tthen\n\t\t\tfpcversion=`\"$fpccompiler\" -iV`\n\t\t\tmainunitdir=\"$FPC_RTL_UNITS_BASE/$fpcversion/units/${fpc_rtl}-darwin/\"\n\t\t\tmkdir -p \"$out_dir\"\n\t\t\tcd \"$out_dir\"\n\t\t\techo \"Compiling to $out_dir\"\n\t\t\trm -f compilefailed\n\t\n\t\t\t# delete any ppu files for which the \".s\" file was somehow deleted (Xcode does that sometimes in case of errors),\n\t\t\t# so that FPC will recompile the unit\n\t\t\tfor file in *.ppu\n\t\t\tdo\n\t\t\t\tasmname=`basename \"$file\" ppu`s\n\t\t\t\tif [ ! -f \"$asmname\" ]; then\n\t\t\t\t\t# can fail in case there are no .ppu files, since then it will try to erase the file with name '*.ppu'\n\t\t\t\t\t# -> use -f so it won't give an error message\n\t\t\t\t\trm -f \"$file\"\n\t\t\t\tfi\n\t\t\tdone\n\n\t\t\techo $fpccompiler -n -l -viwn -a -s -vbr -FE. $FPC_COMMON_OPTIONS $FPC_SPECIFIC_OPTIONS '\\' >ppccmd.sh\n\t\t\techo -Fi\\\"`dirname \"$FPC_MAIN_FILE\"`\\\" '\\' >>ppccmd.sh\n\t\t\techo -Fu\"$mainunitdir/*\" -Fu\"$mainunitdir/rtl\" '\\' >>ppccmd.sh\n\t\t\t# allow FPC_UNIT_PATHS to override default search directory\n\t\t\techo $FPC_UNIT_PATHS '\\' >>ppccmd.sh\n\t\t\techo \\\"$FPC_MAIN_FILE\\\" >>ppccmd.sh\n\t\t\t# cat ppccmd.sh\n\n\t\t\t/bin/sh ppccmd.sh\n\t\t\tif [ $? != 0 ]; then\n\t\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\t\texit 1\n\t\t\tfi\n\t\telse\n\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\techo $FPC_MAIN_FILE:1: error: 1: can\\'t compile for $arch \\(ppc${fpc_arch} not found\\)\n\t\t\texit 2\n\t\tfi\n\tdone\ndone\n";
+			shellScript = "# Compile Pascal Sources\n# 15sep06,ejo  written.\n# 26 April 2007 - Jonas Maebe\n#  * support for ppc64 and x86_64\n#  * don't run when cleaning (in case running scripts when cleaning is ever fixed by Apple)\n#  * split the options in FPC_COMMON_FLAGS (common to all configurations) and FPC_CFG_SPECIFIC_FLAGS (per configuration)\n# 4 January 2009 - Jonas Maebe\n#  * support for ARM\n# 24 October 2009 - Jonas Maebe\n#  * don't hardcode 2.3.1 in some cases anymore\n# 13 December 2009 (Jonas Maebe)\n#  * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nif [ x\"$ACTION\" != \"xbuild\" ]; then\n  # in case running scripts during cleaning gets fixed\n  exit 0\nfi\n\nif test ! -e \"$FPC_MAIN_FILE\"\nthen\n\techo error: FPC_MAIN_FILE not found \\($FPC_MAIN_FILE\\)\n\texit 2\nfi\n\nfor variant in $BUILD_VARIANTS\ndo\n\tfor arch in $ARCHS\n\tdo\n\t\ttargetos=darwin;\n\t\tcase $arch in\n\t\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n\t\t\ti386) fpc_arch=386; fpc_rtl=i386; targetos=iphonesim ;;\n\t\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n\t\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n\t\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t\t*) continue\n\t\tesac\n\n\t\tapp_target_temp_dir=$CONFIGURATION_TEMP_DIR/`basename \"$PROJECT_TEMP_DIR\"`\n\t\tout_dir=$app_target_temp_dir/`basename \"$DERIVED_SOURCES_DIR\"`-$variant/$arch\n\t\tfpccompiler=\"${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch}\"\n\t\tif test -e \"$fpccompiler\"\n\t\tthen\n\t\t\tfpcversion=`\"$fpccompiler\" -iV`\n\t\t\tmainunitdir=\"$FPC_RTL_UNITS_BASE/$fpcversion/units/${fpc_rtl}-${targetos}/\"\n\t\t\tmkdir -p \"$out_dir\"\n\t\t\tcd \"$out_dir\"\n\t\t\techo \"Compiling to $out_dir\"\n\t\t\trm -f compilefailed\n\t\n\t\t\t# delete any ppu files for which the \".s\" file was somehow deleted (Xcode does that sometimes in case of errors),\n\t\t\t# so that FPC will recompile the unit\n\t\t\tfor file in *.ppu\n\t\t\tdo\n\t\t\t\tasmname=`basename \"$file\" ppu`s\n\t\t\t\tif [ ! -f \"$asmname\" ]; then\n\t\t\t\t\t# can fail in case there are no .ppu files, since then it will try to erase the file with name '*.ppu'\n\t\t\t\t\t# -> use -f so it won't give an error message\n\t\t\t\t\trm -f \"$file\"\n\t\t\t\tfi\n\t\t\tdone\n\n\t\t\techo $fpccompiler -n -l -viwn -a -s -vbr -FE. $FPC_COMMON_OPTIONS $FPC_SPECIFIC_OPTIONS '\\' >ppccmd.sh\n\t\t\techo -Fi\\\"`dirname \"$FPC_MAIN_FILE\"`\\\" '\\' >>ppccmd.sh\n\t\t\techo -Fu\"$mainunitdir/*\" -Fu\"$mainunitdir/rtl\" '\\' >>ppccmd.sh\n\t\t\t# allow FPC_UNIT_PATHS to override default search directory\n\t\t\techo $FPC_UNIT_PATHS '\\' >>ppccmd.sh\n\t\t\techo \\\"$FPC_MAIN_FILE\\\" >>ppccmd.sh\n\t\t\t# cat ppccmd.sh\n\n\t\t\t/bin/sh ppccmd.sh\n\t\t\tif [ $? != 0 ]; then\n\t\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\t\texit 1\n\t\t\tfi\n\t\telse\n\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\techo $FPC_MAIN_FILE:1: error: 1: can\\'t compile for $arch \\(ppc${fpc_arch} not found\\)\n\t\t\texit 2\n\t\tfi\n\tdone\ndone\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
@@ -1557,7 +1528,6 @@
 			files = (
 				61798816114AA34C00BA94A9 /* hwengine.pas in Sources */,
 				61798818114AA34C00BA94A9 /* hwLibrary.pas in Sources */,
-				6179881B114AA34C00BA94A9 /* PascalExports.pas in Sources */,
 				6179881C114AA34C00BA94A9 /* SDLh.pas in Sources */,
 				6179881F114AA34C00BA94A9 /* uAI.pas in Sources */,
 				61798820114AA34C00BA94A9 /* uAIActions.pas in Sources */,
@@ -1598,8 +1568,6 @@
 				6165921511CA9BA200D6E256 /* MainMenuViewController.m in Sources */,
 				6165921611CA9BA200D6E256 /* MapConfigViewController.m in Sources */,
 				6165921711CA9BA200D6E256 /* SettingsBaseViewController.m in Sources */,
-				6165921811CA9BA200D6E256 /* OverlayViewController.m in Sources */,
-				6165921911CA9BA200D6E256 /* InGameMenuViewController.m in Sources */,
 				6165921A11CA9BA200D6E256 /* SchemeSettingsViewController.m in Sources */,
 				6165921B11CA9BA200D6E256 /* SchemeWeaponConfigViewController.m in Sources */,
 				6165921C11CA9BA200D6E256 /* SingleSchemeViewController.m in Sources */,
@@ -1617,15 +1585,12 @@
 				6163EE7E11CC2600001C0453 /* SingleWeaponViewController.m in Sources */,
 				61E1F4F811D004240016A5AA /* adler32.pas in Sources */,
 				61F904D711DF7DA30068B24D /* WeaponCellView.m in Sources */,
-				61B3D71C11EA6F2700EC7420 /* uKeys.pas in Sources */,
 				61C079E411F35A300072BF46 /* EditableCellView.m in Sources */,
 				61F2E7CE1205EDE0005734F7 /* AboutViewController.m in Sources */,
-				611EEAEE122B2A4D00DF6938 /* HelpPageViewController.m in Sources */,
 				6199E839124647DE00DADF8C /* SupportViewController.m in Sources */,
 				611D9BFB12497E9800008271 /* SavedGamesViewController.m in Sources */,
 				619C5AF4124F7E3100D041AE /* LuaPas.pas in Sources */,
 				619C5BA2124FA59000D041AE /* MapPreviewButtonView.m in Sources */,
-				61DE8F221257EB1100B80214 /* AmmoMenuViewController.m in Sources */,
 				61399013125D19C0003C2DC0 /* uMobile.pas in Sources */,
 				61D205A1127CDD1100ABD83E /* ObjcExports.m in Sources */,
 				61006F95128DE31F00EBA7F7 /* CreationChamber.m in Sources */,
@@ -1653,6 +1618,20 @@
 				611D7A50142FDCD3006E0798 /* uTouch.pas in Sources */,
 				61915D5B143A4E2C00299991 /* MissionTrainingViewController.m in Sources */,
 				61D0BDF91457508C0011A899 /* ExtraCategories.m in Sources */,
+				61177C02148B8BB100686905 /* uLandGenMaze.pas in Sources */,
+				61177C03148B8BB100686905 /* uLandOutline.pas in Sources */,
+				61D08D7414AEA7FE0007C078 /* uGearsHedgehog.pas in Sources */,
+				61D08D7514AEA7FE0007C078 /* uGearsList.pas in Sources */,
+				61D08D7614AEA7FE0007C078 /* uGearsUtils.pas in Sources */,
+				610C8E3714E018D200CF5C4C /* MNEValueTrackingSlider.m in Sources */,
+				615E755A14E41E8C00FBA131 /* MXAudioPlayerFadeOperation.m in Sources */,
+				615E76BC14E4421200FBA131 /* MGSplitCornersView.m in Sources */,
+				615E76BD14E4421200FBA131 /* MGSplitDividerView.m in Sources */,
+				615E76BE14E4421200FBA131 /* MGSplitViewController.m in Sources */,
+				615BE3D4155C5DDF003CA34D /* uInputHandler.pas in Sources */,
+				619349C8160BAF3E00A08518 /* uAILandMarks.pas in Sources */,
+				619349C9160BAF3E00A08518 /* uGearsHandlers.pas in Sources */,
+				619349CA160BAF3E00A08518 /* uGearsHandlersRope.pas in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1666,6 +1645,66 @@
 		};
 /* End PBXTargetDependency section */
 
+/* Begin PBXVariantGroup section */
+		61156520147F48B6006729A9 /* About.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				6115651A147F48AE006729A9 /* English */,
+				61156526147F49E1006729A9 /* Spanish */,
+				6115652D147F4C52006729A9 /* French */,
+				61156530147F4D10006729A9 /* Polish */,
+				61177BAA148A661600686905 /* German */,
+				61177BAC148A671600686905 /* Turkish */,
+				61177BE4148B881C00686905 /* Danish */,
+				617BC22D1490210E00E1C294 /* Italian */,
+				619BCEC41495615700C1C409 /* Bulgarian */,
+				61D08D8714AEA9670007C078 /* Japanese */,
+				61C6783F14B3DD020087425A /* Portuguese */,
+				6154A53114C37E4A00F6EEF6 /* Romanian */,
+			);
+			name = About.strings;
+			sourceTree = "<group>";
+		};
+		61156522147F48B7006729A9 /* Localizable.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				6115651B147F48AE006729A9 /* English */,
+				61156527147F4A2E006729A9 /* Spanish */,
+				6115652C147F4C4C006729A9 /* French */,
+				61156531147F4D17006729A9 /* Polish */,
+				61177BA7148A658900686905 /* German */,
+				61177BAD148A672000686905 /* Turkish */,
+				61177BF0148B882500686905 /* Danish */,
+				617BC2391490211500E1C294 /* Italian */,
+				619BCED01495615F00C1C409 /* Bulgarian */,
+				61D08D8814AEA9700007C078 /* Japanese */,
+				61C6784B14B3DD0B0087425A /* Portuguese */,
+				6154A53E14C37E5400F6EEF6 /* Romanian */,
+			);
+			name = Localizable.strings;
+			sourceTree = "<group>";
+		};
+		61156524147F48B8006729A9 /* Scheme.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				6115651C147F48AE006729A9 /* English */,
+				61156528147F4A3C006729A9 /* Spanish */,
+				6115652B147F4C45006729A9 /* French */,
+				61156532147F4D1E006729A9 /* Polish */,
+				61177BA9148A660C00686905 /* German */,
+				61177BAE148A672C00686905 /* Turkish */,
+				61177BF1148B882F00686905 /* Danish */,
+				617BC23A1490211F00E1C294 /* Italian */,
+				619BCED11495616700C1C409 /* Bulgarian */,
+				61D08D8914AEA9780007C078 /* Japanese */,
+				61C6784C14B3DD140087425A /* Portuguese */,
+				6154A54014C37EB100F6EEF6 /* Romanian */,
+			);
+			name = Scheme.strings;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
 /* Begin XCBuildConfiguration section */
 		1D6058940D05DD3E006BFB54 /* Debug */ = {
 			isa = XCBuildConfiguration;
@@ -1694,6 +1733,7 @@
 		61022D7C12305A2800B08935 /* Distro AppStore */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_IDENTITY = "iPhone Distribution";
@@ -1706,17 +1746,32 @@
 				FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\"";
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DEBUGGING_SYMBOLS = default;
+				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_FAST_MATH = YES;
 				GCC_OPTIMIZATION_LEVEL = s;
 				GCC_PREPROCESSOR_DEFINITIONS = "";
 				GCC_STRICT_ALIASING = YES;
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+				GCC_WARN_PEDANTIC = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNKNOWN_PRAGMAS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
-					"\"$(SRCROOT)/../../../Library/SDL/src/events\"",
-					"\"$(SRCROOT)/../../../Library/SDL/src/video\"/**",
 					"\"$(SRCROOT)/../../../Library/SDL/include/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_net/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_mixer/\"",
@@ -1736,6 +1791,12 @@
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
 				VALID_ARCHS = "armv7 armv6";
+				WARNING_CFLAGS = (
+					"-Wall",
+					"-Wbad-function-cast",
+					"-Wmissing-declarations",
+					"-Wnested-externs",
+				);
 			};
 			name = "Distro AppStore";
 		};
@@ -1776,6 +1837,7 @@
 		6137064B117B1CB3004EE44A /* Distro Adhoc */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_ENTITLEMENTS = "Entitlements-Distribution.plist";
@@ -1789,17 +1851,32 @@
 				FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\"";
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DEBUGGING_SYMBOLS = full;
+				GCC_DYNAMIC_NO_PIC = YES;
 				GCC_FAST_MATH = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
 				GCC_STRICT_ALIASING = YES;
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+				GCC_WARN_PEDANTIC = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNKNOWN_PRAGMAS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
-					"\"$(SRCROOT)/../../../Library/SDL/src/events\"",
-					"\"$(SRCROOT)/../../../Library/SDL/src/video\"/**",
 					"\"$(SRCROOT)/../../../Library/SDL/include/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_net/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_mixer/\"",
@@ -1817,6 +1894,12 @@
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
 				VALID_ARCHS = "armv7 armv6";
+				WARNING_CFLAGS = (
+					"-Wall",
+					"-Wbad-function-cast",
+					"-Wmissing-declarations",
+					"-Wnested-externs",
+				);
 			};
 			name = "Distro Adhoc";
 		};
@@ -1901,30 +1984,46 @@
 		C01FCF4F08A954540054247B /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FPC_COMMON_OPTIONS = "-dIPHONEOS -Cs2000000 -vwi -B  -Sgix -Fi${PROJECT_DIR}";
-				FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.5.1;
+				FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.6.0;
 				FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas";
 				FPC_RTL_UNITS_BASE = /usr/local/lib/fpc;
-				FPC_SPECIFIC_OPTIONS = "-dDEBUGFILE -O- -g -gl -gw2 -gt -ghttt -Xs-";
+				FPC_SPECIFIC_OPTIONS = "-Tiphonesim -dDEBUGFILE -O- -g -gl -gw2 -gt -ghttt -Xs-";
 				FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\"";
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DEBUGGING_SYMBOLS = full;
+				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_FAST_MATH = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
 				GCC_STRICT_ALIASING = YES;
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+				GCC_WARN_PEDANTIC = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNKNOWN_PRAGMAS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
-					"\"$(SRCROOT)/../../../Library/SDL/src/events\"",
-					"\"$(SRCROOT)/../../../Library/SDL/src/video\"/**",
 					"\"$(SRCROOT)/../../../Library/SDL/include/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_net/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_mixer/\"",
@@ -1942,36 +2041,58 @@
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = NO;
 				VALID_ARCHS = "armv7 armv6";
+				WARNING_CFLAGS = (
+					"-Wall",
+					"-Wbad-function-cast",
+					"-Wmissing-declarations",
+					"-Wnested-externs",
+				);
 			};
 			name = Debug;
 		};
 		C01FCF5008A954540054247B /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_ENTITLEMENTS = "Entitlements-Development.plist";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				FPC_COMMON_OPTIONS = "-dIPHONEOS -Cs2000000 -vwi -B  -Sgix -Fi${PROJECT_DIR}";
-				FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.7.1;
+				FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.6.0;
 				FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas";
 				FPC_RTL_UNITS_BASE = /usr/local/lib/fpc;
 				FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -Os -Xs  -Cfvfpv3 -dDEBUGFILE";
 				FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\"";
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DEBUGGING_SYMBOLS = default;
+				GCC_DYNAMIC_NO_PIC = YES;
 				GCC_FAST_MATH = YES;
 				GCC_OPTIMIZATION_LEVEL = s;
 				GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
 				GCC_STRICT_ALIASING = YES;
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+				GCC_WARN_PEDANTIC = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNKNOWN_PRAGMAS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
-					"\"$(SRCROOT)/../../../Library/SDL/src/events\"",
-					"\"$(SRCROOT)/../../../Library/SDL/src/video\"/**",
 					"\"$(SRCROOT)/../../../Library/SDL/include/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_net/\"",
 					"\"$(SRCROOT)/../../../Library/SDL_mixer/\"",
@@ -1990,6 +2111,12 @@
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = NO;
 				VALID_ARCHS = "armv7 armv6";
+				WARNING_CFLAGS = (
+					"-Wall",
+					"-Wbad-function-cast",
+					"-Wmissing-declarations",
+					"-Wnested-externs",
+				);
 			};
 			name = Release;
 		};
--- a/project_files/HedgewarsMobile/Hedgewars_Prefix.pch	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Hedgewars_Prefix.pch	Sun Oct 28 13:28:23 2012 +0100
@@ -14,8 +14,6 @@
  * 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 created on 25/04/2010.
  */
 
 
@@ -23,12 +21,15 @@
 #import <Foundation/Foundation.h>
 #import <CoreGraphics/CoreGraphics.h>
 #import <UIKit/UIKit.h>
-#import "PascalImports.h"
-#import "UIImageExtra.h"
-#import "DefinesAndMacros.h"
 #import "HedgewarsAppDelegate.h"
 #import "AudioManagerController.h"
+#import "ExtraCategories.h"
+#import "UIImageExtra.h"
+#import "PascalImports.h"
+#import "DefinesAndMacros.h"
+#import "EditableCellView.h"
+#import "CreationChamber.h"
 #import "HWUtils.h"
-#import "ExtraCategories.h"
+#import "hwconsts.h"
 #endif
 
--- a/project_files/HedgewarsMobile/Info.plist	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/HedgewarsMobile/Info.plist	Sun Oct 28 13:28:23 2012 +0100
@@ -37,10 +37,17 @@
 	<true/>
 	<key>UILaunchImageFile~ipad</key>
 	<string>Default-ipad</string>
-	<key>UISupportedInterfaceOrientations</key>
+	<key>UISupportedInterfaceOrientations~iphone</key>
 	<array>
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+	<key>UISupportedInterfaceOrientations~ipad</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
 </dict>
 </plist>
Binary file project_files/HedgewarsMobile/Locale/Bulgarian.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Bulgarian.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Bulgarian.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Danish.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Danish.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Danish.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/English.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/English.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/French.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/French.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/French.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/German.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/German.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/German.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Italian.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Italian.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Italian.lproj/Scheme.strings has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/Japanese.lproj/About.strings	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,44 @@
+/* code credit */
+"Engine, frontend, net server" = "エンジン、フロントエンド、ネットサーバー";
+"Many desktop frontend improvements" = "多くのデスクトップフロントエンドの改善";
+"Many engine and desktop frontend improvements" = "多くのエンジンとデスクトップフロントエンドの改善";
+"Drillrocket, Ballgun, RC Plane weapons" = "ドリルロケット、ボールガン、ラジコン武器";
+"Mine number and time game settings" = "地雷番号とタイムゲーム設定";
+"Desktop frontend improvements" = "デスクトップフロントエンドの改善";
+"Desktop frontend improvements" = "デスクトップフロントエンドの改善";
+"Mac OS X and iPhone version" = "Mac OS X と iPhone バージョン";
+"Many engine and desktop frontend improvements" = "多くのエンジンとデスクトップフロントエンドの改善";
+"Gamepad and Lua integration" = "ゲームパッドとLuaの統合化";
+"Many engine improvements and graphics" = "多くのエンジン改善とグラフィック";
+"Maze maps" = "迷路地図";
+"Engine and desktop frontend improvements" = "エンジンとデスクトップフロントエンドの改善";
+"Lua game modes and missions" = "Lua ゲームモードとミッション";
+"Desktop frontend improvements" = "デスクトップフロントエンドの改善";
+"Android port" = "アンドロイドポート";
+
+/* art credit */
+"Main graphics" = "メイングラフィック";
+"Some hats" = "帽子";
+"Hedgehogs voice" = "ハリネズミの声";
+
+/* translation credit */
+"Brazilian Portuguese" = "ポルトガル語(ブラジル)";
+"Bulgarian" = "ブルガリア語";
+"Czech" = "チェコ語";
+"Chinese" = "中国語";
+"English" = "英語";
+"Finnish" = "フィンランド語";
+"French" = "フランス語";
+"German" = "ドイツ語";
+"Greek" = "ギリシャ語";
+"Italian" = "イタリア語";
+"Japanese" = "日本語";
+"Korean" = "韓国語";
+"Lithuanian" = "リトアニア語";
+"Polish" = "ポーランド語";
+"Portuguese" = "ポルトガル語";
+"Russian" = "ロシア語";
+"Slovak" = "スロバキア語";
+"Spanish" = "スペイン語";
+"Swedish" = "スウェーデン語";
+"Ukrainian" = "ウクライナ語";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/Japanese.lproj/Localizable.strings	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,380 @@
+/* No comment provided by engineer. */
+"A monitor has been disconnected while playing and this has ended the match! You need to restart the game if you wish to use the second display again." = "モニターの接続が切断され、マッチを終了してしまいました!二番目のディスプレーをまた使用したい場合はゲームをリスタートしなければいけません。";
+
+/* from the scheme panel
+   from the team panel */
+"Add" = "追加";
+
+/* No comment provided by engineer. */
+"Aggressive" = "積極的";
+
+/* No comment provided by engineer. */
+"All" = "全て";
+
+/* from the settings table */
+"Alternate Damage" = "代わりのダメージ";
+
+/* No comment provided by engineer. */
+"Are you reeeeeally sure?" = "本当にいいですか?";
+
+/* from the settings table */
+"Audio Preferences" = "オーディオ設定";
+
+/* No comment provided by engineer. */
+"Available Teams" = "利用可能なチーム";
+
+/* No comment provided by engineer. */
+"Average" = "平均";
+
+/* No comment provided by engineer. */
+"Backup" = "バックアップ";
+
+/* No comment provided by engineer. */
+"Before playing the preview needs to be generated" = "プレーする前にプレビューを生成する必要があります";
+
+/* No comment provided by engineer. */
+"Before returning the preview needs to be generated" = "戻る前にプレビューを生成する必要があります";
+
+/* No comment provided by engineer. */
+"Brutal" = "残忍";
+
+/* No comment provided by engineer. */
+"Bully" = "いじめっ子";
+
+/* No comment provided by engineer. */
+"Cancel" = "キャンセル";
+
+/* No comment provided by engineer. */
+"Cavern" = "洞窟";
+
+/* No comment provided by engineer. */
+"Change hedgehogs' hat" = "ハリネズミの帽子を変える";
+
+/* No comment provided by engineer. */
+"Chat with the devs in IRC" = "IRC でデベロッパ達とチャットする";
+
+/* No comment provided by engineer. */
+"Choose a charismatic symbol for your team" = "チームのためのカリスマ的なシンボルを選択する";
+
+/* No comment provided by engineer. */
+"Choose hedgehog graves" = "ハリネズミの墓を選択する";
+
+/* No comment provided by engineer. */
+"Choose team fort" = "チームの砦を選択する";
+
+/* from the settings table */
+"Choosing a Scheme will select its associated Weapon" = "スキームを選択すると関連した武器を選択します。";
+
+/* No comment provided by engineer. */
+"Classic Ammo Menu" = "クラシックな弾薬メニュー";
+
+/* No comment provided by engineer. */
+"Community" = "コミュニティー";
+
+/* from the settings table */
+"Damage popups will notify you on every single hit" = "ダメージポップアップはすべてのヒットを通知してくれます。";
+
+/* from the scheme panel
+   from the team panel */
+"Done" = "終了";
+
+/* from the scheme panel
+   from the team panel */
+"Edit" = "編集";
+
+/* No comment provided by engineer. */
+"Edit scheme preferences" = "スキーム設定を編集";
+
+/* No comment provided by engineer. */
+"Edit team settings" = "チーム設定を編集";
+
+/* No comment provided by engineer. */
+"Edit weapons preferences" = "武器設定を編集";
+
+/* No comment provided by engineer. */
+"End Game" = "ゲームを終了する";
+
+/* No comment provided by engineer. */
+"Flag" = "フラグ";
+
+/* No comment provided by engineer. */
+"Follow us on Twitter" = "ツイッターでフォローする";
+
+/* No comment provided by engineer. */
+"Fort" = "砦";
+
+/* No comment provided by engineer. */
+"Game Modifiers" = "ゲームの変更";
+
+/* No comment provided by engineer. */
+"Game Settings" = "ゲームの設定";
+
+/* No comment provided by engineer. */
+"General" = "一般";
+
+/* No comment provided by engineer. */
+"Grave" = "墓";
+
+/* No comment provided by engineer. */
+"Hedgewars supports multi-monitor configurations, but the screen has to be connected before launching the game." = "Hedgewarsはマルチモニター設定をサポートしていますが、スクリーンはゲームをスタートする前に接続されていなければいけません。";
+
+/* No comment provided by engineer. */
+"Hogs controlled by AI" = "AIにコントロールされたハリネズミ";
+
+/* No comment provided by engineer. */
+"Hold your finger on a weapon to see what it does.\nTap anywhere to dismiss." = "武器の上でホールドして何をするか見る。\nほかの部分をタップして閉じる。";
+
+/* No comment provided by engineer. */
+"Hold your finger on a weapon to see what it does.\nYou can move this window anywhere on the screen." = "武器の上でホールドして何をするか見る。\nこのウィンドウはスクリーンのどこにでも動かすことができます。";
+
+/* ammo selection */
+"Initial quantity " = "初期量";
+
+/* from the settings table */
+"Insert your password" = "パスワードを入力";
+
+/* from the settings table */
+"Insert your username (if you have one)" = "ユーザーネームを入力 (持っていた場合)";
+
+/* No comment provided by engineer. */
+"Join us on Facebook" = "Facebookで参加する";
+
+/* No comment provided by engineer. */
+"Large" = "大きな";
+
+/* No comment provided by engineer. */
+"Large Floating Islands" = "大きな浮き島";
+
+/* No comment provided by engineer. */
+"Large Tunnels" = "大きなトンネル";
+
+/* No comment provided by engineer. */
+"Leave a positive review on iTunes!" = "iTunesでポジティブなレビューを残す!";
+
+/* No comment provided by engineer. */
+"Level" = "レベル";
+
+/* No comment provided by engineer. */
+"Loading..." = "ロード中...";
+
+/* from the settings table */
+"Main Configuration" = "メイン設定";
+
+/* No comment provided by engineer. */
+"Mark the death of your fallen warriors" = "あなたの倒れた戦士の死をマーク";
+
+/* No comment provided by engineer. */
+"Max Hogs:" = "ハリネズミの最大数:";
+
+/* No comment provided by engineer. */
+"Medium" = "中くらい";
+
+/* No comment provided by engineer. */
+"Medium Floating Islands" = "中くらいの浮き島";
+
+/* No comment provided by engineer. */
+"Medium Tunnels" = "中くらいのトンネル";
+
+/* No comment provided by engineer. */
+"Missing detail" = "詳細が抜けています";
+
+/* No comment provided by engineer. */
+"Missions don't need further configuration" = "ミッションはこれ以上の設定を必要としません";
+
+/* from the settings table */
+"Music" = "音楽";
+
+/* No comment provided by engineer. */
+"Names and Hats" = "ネームと帽子";
+
+/* from the settings table */
+"Nickname" = "ニックネーム";
+
+/* No comment provided by engineer. */
+"No filter" = "フィルターなし";
+
+/* No comment provided by engineer. */
+"No thanks" = "遠慮します";
+
+/* ammo selection */
+"Number of turns before you can use this weapon " = "この武器を使えるようになるまでのターン数";
+
+/* Short for 'Never' */
+"Nvr" = "絶対にない";
+
+/* No comment provided by engineer. */
+"Of course!" = "もちろん!";
+
+/* No comment provided by engineer. */
+"Ok, got it" = "Ok, わかった";
+
+/* No comment provided by engineer. */
+"Opt for controlling the team or let the AI lead" = "チームをコントロールするかAIをリードさせる";
+
+/* from the settings table */
+"Other Settings" = "ほかの設定";
+
+/* from the settings table */
+"Password" = "パスワード";
+
+/* No comment provided by engineer. */
+"Pick a slang your hogs will speak" = "あなたのハリネズミが話すスラングを選択";
+
+/* No comment provided by engineer. */
+"Playing Teams" = "プレー中のチーム";
+
+/* ammo selection */
+"Presence probability in crates " = "クレートの中の存在確率";
+
+/* No comment provided by engineer. */
+"Press to resume playing or swipe to delete the save file." = "押してプレーを再開するか、スワイプしてセーブファイルを削除。";
+
+/* No comment provided by engineer. */
+"Preview not available" = "プレビューが利用できません";
+
+/* ammo selection */
+"Quantity that you will find in a crate " = "クレーとの中で見つかる量";
+
+/* No comment provided by engineer. */
+"Remind me later" = "後で連絡";
+
+/* Short for 'Random' */
+"Rnd" = "ランダム";
+
+/* No comment provided by engineer. */
+"Save" = "保存";
+
+/* No comment provided by engineer. */
+"Scheme" = "スキーム";
+
+/* No comment provided by engineer. */
+"Scheme mismatch" = "スキームミスマッチ";
+
+/* No comment provided by engineer. */
+"Scheme Name" = "スキーム名";
+
+/* No comment provided by engineer. */
+"Schemes" = "スキーム";
+
+/* No comment provided by engineer. */
+"Select at least two teams to play a game" = "ゲームをプレーするには最低二チーム選択してください。";
+
+/* No comment provided by engineer. */
+"Select one Scheme and one Weapon for this game" = "このゲームのためにスキームと武器を一つずつ選択してください。";
+
+/* No comment provided by engineer. */
+"Select the team invincible fortress (only valid for fort games)" = "無敵砦のチームを選択する (砦ゲームのみ有効)";
+
+/* from the settings table */
+"Select which style of ammo menu you prefer" = "弾薬メニューのスタイルを選択してください";
+
+/* No comment provided by engineer. */
+"Set difficulty level" = "難易度レベルをセットする";
+
+/* No comment provided by engineer. */
+"Set hedgehog voices" = "ハリネズミの声をセットする";
+
+/* No comment provided by engineer. */
+"Set team flag" = "チームフラグをセットする";
+
+/* on the overlay */
+"Set!" = "セット!";
+
+/* No comment provided by engineer. */
+"Show Help" = "ヘルプを表示する";
+
+/* No comment provided by engineer. */
+"Small" = "小さい";
+
+/* No comment provided by engineer. */
+"Small Floating Islands" = "小さな浮き島";
+
+/* No comment provided by engineer. */
+"Small Tunnels" = "小さなトンネル";
+
+/* from the settings table */
+"Sound" = "サウンド";
+
+/* No comment provided by engineer. */
+"Style" = "スタイル";
+
+/* No comment provided by engineer. */
+"Support" = "サポート";
+
+/* No comment provided by engineer. */
+"Sync Schemes and Weapons" = "スキームと武器を同期する";
+
+/* No comment provided by engineer. */
+"Tag" = "タグ";
+
+/* No comment provided by engineer. */
+"Tap to add hogs or change color, touch and hold to remove a team." = "ハリネズミを追加するか色を変更するにはタップ、チームを取り除くにはタッチしてホールドしてください。";
+
+/* No comment provided by engineer. */
+"Team Name" = "チーム名";
+
+/* No comment provided by engineer. */
+"Team Preferences" = "チーム設定";
+
+/* No comment provided by engineer. */
+"Teams" = "チーム";
+
+/* No comment provided by engineer. */
+"The map is too small for that many hogs" = "このマップはこれだけのハリネズミには小さすぎます。";
+
+/* No comment provided by engineer. */
+"The robot badge indicates an AI-controlled team." = "ロボットバッジはAIがコントロールするチームを指します。";
+
+/* No comment provided by engineer. */
+"The scheme you selected allows only for two teams" = "選択したスキームは二チーム用です。";
+
+/* No comment provided by engineer. */
+"This weapon is locked" = "この武器はロックされています";
+
+/* No comment provided by engineer. */
+"Too few teams playing" = "プレーしているチームが少なすぎます";
+
+/* No comment provided by engineer. */
+"Too many hogs" = "ハリネズミが多すぎます";
+
+/* No comment provided by engineer. */
+"Too many teams" = "チームが多すぎます";
+
+/* No comment provided by engineer. */
+"Visit our website" = "ウェブサイトを見る";
+
+/* No comment provided by engineer. */
+"Voice" = "音量";
+
+/* No comment provided by engineer. */
+"Wacky" = "奇抜";
+
+/* No comment provided by engineer. */
+"Wait for the Preview" = "プレビューを待つ";
+
+/* No comment provided by engineer. */
+"Weaky" = "弱い者";
+
+/* No comment provided by engineer. */
+"Weapon" = "武器";
+
+/* No comment provided by engineer. */
+"Weapon Ammuntions" = "武器弾薬";
+
+/* No comment provided by engineer. */
+"Weapons" = "武器";
+
+/* No comment provided by engineer. */
+"Weaponset Name" = "武器セット名";
+
+/* No comment provided by engineer. */
+"Well, maybe not..." = "まあ、そうでないかもしれません...";
+
+/* No comment provided by engineer. */
+"Worldwide" = "ワールドワイド";
+
+/* No comment provided by engineer. */
+"You can add a description if you wish" = "お望みなら説明を追加することができます。";
+
+/* No comment provided by engineer. */
+"You exceeded the maximum number of tems allowed in a game" = "ゲームで許可されているチームの最大数を超しました。";
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/Japanese.lproj/Scheme.strings	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,194 @@
+/* game mod description */
+"Land can not be destroyed" = "土地は破壊することができません";
+
+/* game mod title */
+"Solid Land" = "固形の土地";
+
+/* game mod description */
+"Add an indestructable border around the terrain" = "地形の周りに破壊できないボーダーを追加する";
+
+/* game mod title */
+"Add Border" = "ボーダーを追加する";
+
+/* game mod description */
+"Teams will start on opposite sides of the terrain" = "チームは地形の反対側からスタート思案す";
+
+/* game mod title */
+"Divide Team (max 2 teams)" = "チームを分ける (最大二チーム)";
+
+/* game mod description */
+"Lower gravity" = "低い重力";
+
+/* game mod title */
+"Low Gravity" = "低重力";
+
+/* game mod description */
+"Assisted aiming with laser sight" = "レーザーサイトで狙いの補助";
+
+/* game mod title */
+"Laser Sight" = "レーザーサイト";
+
+/* game mod description */
+"All hogs have a personal forcefield" = "全てのハリネズミは自分の力場を持っています";
+
+/* game mod title */
+"Invulnerable" = "無敵";
+
+/* game mod description */
+"All (living) hedgehogs are fully restored at the end of turn" = "全ての (生きている) ハリネズミの体力はターン終了時に完全に復元されます";
+
+/* game mod title */
+"Reset Health" = "体力をリセット";
+
+/* game mod description */
+"Gain 80% of the damage you do back in health" = "ダメージの80% を体力としてもらう";
+
+/* game mod title */
+"Vampirism Mode" = "吸血モード";
+
+/* game mod description */
+"Share your opponents pain, share their damage" = "相手の痛みを共有し、 ダメージを共有する";
+
+/* game mod title */
+"Karma Mode" = "カルマモード";
+
+/* game mod description */
+"Your hogs are unable to move, test your aim" = "あなたのハリネズミは動けない, 狙いを試せ";
+
+/* game mod title */
+"Artillery Mode" = "砲兵モード";
+
+/* game mod description */
+"Defend your fort and destroy the opponents" = "砦を守って相手を潰せ";
+
+/* game mod title */
+"Fort Mode" = "砦モード";
+
+/* game mod description */
+"Order of play is random instead of in room order" = "プレー順はルーム順ではなくランダムです";
+
+/* game mod title */
+"Random Order" = "ランダムオーダー";
+
+/* game mod description */
+"Play with a King; when he dies, your side loses" = "キングとプレーする; キングが死ぬと、あなたの負けです";
+
+/* game mod title */
+"King Mode" = "キングモード";
+
+/* game mod description */
+"Take turns placing your hedgehogs pre-game" = "ゲームの前にターンを取ってハリネズミを置く";
+
+/* game mod title */
+"Place Hedgehogs" = "ハリネズミを置く";
+
+/* game mod description */
+"Ammo is shared between all clan teams" = "弾薬は全ての一族チームの間で共有されます";
+
+/* game mod title */
+"Clan Shares Ammo" = "一族は弾薬を共有します";
+
+/* game mod description */
+"Disable girders when generating random maps" = "ランダムマップを作成するときはガードを無効にする";
+
+/* game mod title */
+"Disable Girders" = "ガードを無効にする";
+
+/* game mod description */
+"Disable land objects when generating maps" = "マップ作成中は土地のオブジェクトを無効にする";
+
+/* game mod title */
+"Disable Land Objects" = "土地のオブジェクトを無効にする";
+
+/* game mod description */
+"AI-controlled hogs respawn on death" = "AIがコントロールするハリネズミは死ぬと再出現します";
+
+/* game mod title */
+"AI Survival Mode" = "AI サバイバルモード";
+
+/* game mod description */
+"Attacking does not end your turn" = "攻撃してもターンは終了しません";
+
+/* game mod title */
+"Unlimited Attacks" = "無限攻撃";
+
+/* game mod description */
+"Weapons are reset to starting values each turn" = "武器は毎ターン初期値にリセットされます";
+
+/* game mod title */
+"Reset Weapons" = "武器をリセット";
+
+/* game mod description */
+"Each hedgehog has its own ammo" = "各ハリネズミが自分の弾薬を持っています";
+
+/* game mod title */
+"Per Hedgehog Ammo" = "ハリネズミあたりの弾薬";
+
+/* game mod description */
+"You will not have to worry about wind any more" = "風のことは気にせずに良くなります";
+
+/* game mod title */
+"Disable Wind" = "風を無効にする";
+
+/* game mod description */
+"Wind will affect almost everything" = "風はほとんどのものに影響します";
+
+/* game mod title */
+"More Wind" = "より強い風";
+
+/* game mod description */
+"Clan teams take turns sharing their time" = "一族のチームはタイムを共有してターンを取ります";
+
+/* game mod title */
+"Tag Team" = "タッグチーム";
+
+/* game mod description */
+"Add an indestructible border along the bottom" = "破壊できないボーダーを下に追加する";
+
+/* game mod title */
+"Bottom Border" = "ボトムボーダー";
+
+
+/* flag description */
+"Initial Health" = "初期体力";
+
+/* flag description */
+"Damage Modifier" = "ダメージ変更";
+
+/* flag description */
+"Turn Time" = "ターンタイム";
+/* flag description */
+"Sudden Death Timeout" = "サデン・デス タイムアウト";
+
+/* flag description */
+"Water Rise Amount" = "水位上昇量";
+
+/* flag description */
+"Health Decrease" = "体力の減少";
+
+/* flag description */
+"Rope Length (%)" = "ロープの長さ (%)";
+
+/* flag description */
+"Crate Drop Turns" = "クレートドロップターン";
+
+/* flag description */
+"Health Kit Probability (%)" = "体力キットの確率 (%)";
+
+/* flag description */
+"Health Amount in Kit" = "キットの体力量";
+
+/* flag description */
+"Mines Time" = "地雷タイム";
+
+/* flag description */
+"Mines Number" = "地雷ナンバー";
+
+/* flag description */
+"Dud Mines Probability (%)" = "不発地雷の確率(%)";
+
+/* flag description */
+"Explosives" = "爆発物";
+
+/* flag description */
+"Get Away Time (%)" = "脱出タイム (%)";
\ No newline at end of file
Binary file project_files/HedgewarsMobile/Locale/Polish.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Polish.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Polish.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Portuguese.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Portuguese.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Portuguese.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Romanian.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Romanian.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Romanian.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Spanish.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Spanish.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Spanish.lproj/Scheme.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Turkish.lproj/About.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Turkish.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/Turkish.lproj/Scheme.strings has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_bg.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, много яко!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars е достъпна в Mac Appstore ! Потърсете hedgewars на вашия мак и вземете вашето БЕЗПЛАТНО копие днес!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+
+iOS порта има някой ексклузивни екстри като
+* iPad VGA Out: Закачете външен дисплей и играйте на пълна резолюция;
+* Поддръжка на ретина дисплей: играйте на по-висока резолюция през цялата игра;
+* Многозадачност: прекъснете играта по всяко време;
+* Възстановяване на игра: Винаги ще можете да завършите вашата игра, независимо какво.
+
+Описание:
+Това е най-забавната и пристрастяваща игра, която някога ще играете - забава, на която можете да се наслаждавате навсякъде, по всяко време. Hedgewars е стратегия но истинската забава е от разрушенията причинени от тези досадни таралежи с тези фантастични оръжия - подли малки гадини с лош характер!
+
+С други думи Hedgewars е стратегия, артилерийна, екшън и комедийна игра, която включва лудориите на розови таралежи с характер докато те се бият от дълбините на ада до дълбините на космоса.
+
+Като командир, вашата работа е да подберете вашия отбор от таралежи и да занесете войната на врага си.
+
+Всеки играч контролира отбор от няколко таралежа. Играчите се редуват с по един таралеж на ред. Те използват всякакви оръжия и инструменти за да убият противниковите таралежи и съответно да спечелят играта. Таралежите могат да се движат по различни начини, обикновено като ходят и скачат но и като използват определени инструменти като "Въжето" или "Парашута" за да достиднат иначе недостъпни места. Всеки ред е ограничен по време, за да не се задържа играта с прекалено много мислене или движение. Голям набор от инструменти и оръжия са на разположение на играчите : Граната, Клъстерна бомба, Базука, НЛО, Пушка, Револвер, Огнен пунш, Бухалка, Динамит, Мина, Въже, Пневматична мотика, Парашут. При използването си, повечето оръжия предизвикват експлозии, които деформират терена, премахвайки кръгли парчета. Пейзажът е плаващ остров или пещера с вода в дъното си.Таралежите умират когато паднат във вода(или като паднат от острова, или през дупка в него), са изхвърлени от арената или когато здравето им достигне 0, обикновно от контакт с експлозии (щетите върху даден таралеж се показват само след края на реда).
+
+* Оживена и опустошителна редово базирана битка за до 6 играча
+* Локален и мрежови мултиплейър с възможност за противници контролирани от ИИ
+* Бийте се на безкрайни произволно генерирани карти с над 20 различни среди
+* Използвайте над 48 удивлителни оръжия! Включително падащото пиано и експлодиращата роботизирана торта
+* Играйте играта по вашият начин, с над 20 игрови режима, можете да промените почти всеки аспект на играта
+* Персонализирайте вашият отбор, с над 120 костюма, 30 гроба, 12 крепости, стотици флагове и уникални гласови пакети
+* Огромни битки с до 64 таралежа
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_da.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, det' Vildt!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars er tilgængeligt i Mac App Store! Søg efter Hedgewars på din Mac og få din GRATIS kopi i dag!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+iOS versionen har flere eksklusive funktioner, så som
+* iPad VGA-udgangssignal: tilslut en ekstern skærm og spil i fuld oplysning;
+* Understøttelse af Retina-skærmen: spil hele spillet i en højere opløsning;
+* Multitasking: sæt spillet på pause når som helst;
+* Genoptagelse af Spil: du kan altid færdiggøre din kamp, lige meget hvad.
+
+Beskrivelse:
+Det her er det sjoveste og mest afhængighedsskabende spil du nogensinde kommer til at prøve - hylende morsomt og lige til at tage op af lommen hvor som helst, når som helst. Hedgewars er et turbaseret strategispil, men det fedeste er at se de utrolige ødelæggelser de forbistrede pindsvin laver med deres fantasifulde våben - luskede små fyre med en uforskammet holdning.
+
+Med andre ord er Hedgewars et turbaseret strategi-, artilleri-, action- og komediespil som byder på an narrestreger fra små lyserøde pindsvin med attitude og som viser hvordan de slås overalt, fra det dybeste helvede til den yderste afkroge af rummet.
+
+Som hærfører er det dit arbejde at sammensætte et førsteklasses hold af pindsvinesoldater og føre krig mod fjenderne helt fremme ved frontlinjen.
+
+Hver spiller styrer et hold bestående af adskillige pindsvin. I løbet af spillet tager spillerne ture med et af deres pindsvin. De bruger her et hvilket som helst tilgængeligt værktøj eller våben til at angribe og dræbe deres modstanderes pindsvin, og vinder derved spillet. Pindsvinene kan bevæge sig rundt i terrænet på mange forskellige måder, normalt ved at gå og hoppe, men også ved at bruge forskellige værktøjer som f.eks. et reb, en teleporter eller en faldskærm for at nå ellers utilgængelige steder. Hver tur er tidsbegrænset for at sikre at spillere ikke forsinker spillet med for mange tanker eller bevægelser. Et stort assortiment af våben er tilgængeligt i løbet af spillet: Granater, klyngebomber, bazookaer, UFO'er, haglgeværer, pistoler, slag med brændende næver, baseballbatter, dynamit, miner, reb, trykluftsbor, faldskærme, osv. De fleste våben laver eksplosioner som deformerer terrænet ved at fjerne cirkulære stykker. Landskabet består af en flydende ø i en vandmasse, eller en begrænset grotte med vand i bunden. Pindsvin dør hvis de falder i vandet (enten ved at falde ud over kanten af øen, eller gennem et hul i bunden), falder ud over kanten af banen eller hvis deres liv bliver reduceret (typisk ved nærkontakt med for mange eksplosioner) til nul.
+
+* Vandvittig morsom og ødelæggende turbaseret krigsførsel for op til 6 spillere
+* Multiplayer, både lokalt og over et netværk, men valgfri computerstyrede modstandere
+* Kæmp på et uendeligt antal tilfældigt genererede baner med over 20 forskellige typer omgivelser
+* Brug 48 (forøges løbende) overvældende våben! Inklusiv klaveranslaget og den eksplosive robotkage
+* Spil lige som du har lyst til! Med mere end 20 forskellige måder at justere spillet på, kan du selv bestemme over næsten alle aspekter af kampen
+* Skræddersy dit hold med over 120 kostumer, 30 gravsten, 12 forter, hundredvis af flag og mange unikke sæt stemmer
+* Enorme slag med op til 64 pindsvin
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_de.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, einfach Bombastisch!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars ist jetzt auch im Mac Appstore verfügbar! Suche Hedgewars von deinem Mac und bekomme deine GRATIS Kopie!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+Der iOS-Port hat einige exklusiven Features, wie z.B.:
+* iPad VGA-Ausgabe: Schließe einen externen Bildschirm an und spiele mit voller Auflösung;
+* Retina Display-Unterstützung: Spiele das gesamte Spiel mit noch höherer Auflösung;
+* Multitasking: Pausiere das Spiel wann immer du willst;
+* Spielstandwiederherstellung: Egal was passiert, du wirst immer in der Lage sein die Partie zu Ende zu spielen.
+
+Beschreibung:
+Es ist das lustigste und süchtig-machendste Spiel auf der Welt - wahnsinniger Spielspaß, wo und wann du willst. Hedgewars ist ein rundenbasiertes Strategiespiel. Aber die richtige Begeisterung verursacht erst, diesen nervigen kleinen Igeln zu zuschauen, wie sie mit ihren fantastischen Waffen alles zerstören - hinterhältige kleine Mistkerle mit bösen Absichten!
+
+Anders gesagt, Hedgewars ist ein rundenbasiertes Strategie-, Artillerie-, Action- und Comedy-Spiel. In den Hauptrollen die Grimassen der pinken Igel, mit dem Anschein als wollten sie sich aus den Tiefen der Hölle in die Tiefen des Universums vorkämpfen.
+
+Als Kommandant ist es deine Aufgabe ein Sondereinsatzkommando aus Igelsoldaten zusammenzustellen und deine Feinde mit Krieg zu überziehen.
+
+Jeder Spieler befehligt ein aus mehreren Igeln bestehendes Team. Im Spielverlauf ziehen die Spieler mit einem ihrer Igel. Sie benutzen dann alle zur Verfügung stehende Hilfsmittel und Waffen um die gegnerischen Igel zu töten. Dadurch gewinnen sie das Spiel. Igel können sich auf verschiedene Arten und Weisen auf dem Gelände bewegen, normalerweise durch laufen und springen, sie können aber auch spezielle Hilfsmittel wie zum Beispiel ein Seil oder einen Fallschirm benutzen, um zu ansonsten unerreichbaren Regionen vorzudringen. Um zu verhindern, dass Teilnehmer nicht das Spiel durch übermäßiges Nachdenken oder Bewegen aufhalten, ist jeder Zug zeitlich begrenzt. Während dem Spiel gibt es eine Vielzahl von Waffen und Hilfsmitteln: Granaten, Streubomben, Panzerfäuste, UFOs, Schrotflinten, Desert Eagles, Feuerschläge, Baseballschläger, Dynamit, Minen, Seile, Presslufthammer und Fallschirme. Die meisten Waffen verursachen Explosionen, die auch kreisförmige Stücke des Geländes heraus sprengen. Die verfügbaren Umgebungen sind eine auf einem Gewässer schwimmende Insel oder eine beschränkt zugängliche Höhle mit Wasser auf dem Boden. Ein Igel stirbt wenn er ins Wasser fällt (z.B. weil er von der Insel oder durch ein Loch in deren Boden fällt), er auf irgendeiner Seite aus dem Spielfeld fliegt oder wenn seine Gesundheit unter Null fällt, typischerweise aber durch Explosionen. (Der einem oder mehreren Igeln durch einen Spieler- oder KI-Zug zugefügte Schaden wird erst angerechnet, nachdem alle Bewegungen auf dem Schlachtfeld abgeschlossen ist).
+
+* Sensationeller, zerstörerischer, rundenbasierter Krieg für bis zu 6 Spieler
+* Lokale- und Online-Multiplayerspiele, mit zusätzlichen KI-Gegnern
+* Kämpfe auf unendlichen vielen, zufällig generierten Karten mit über 20 Umgebungen
+* Benutze 48 (und es werden laufend mehr) überwältigende Waffen! Inklusive dem Piano-Schlag und dem explosiven Roboterkuchen
+* Spiel das Spiel auf deine Weise, mit mehr als 20 verschiedenen Modifikatoren kannst du so gut wie jedes Detail anpassen
+* Passe dein Team an, mit über 120 Kostümen, 30 Gräbern, 12 Festungen, 100ten von Flaggen und einzigartigen Stimmen
+* Riesige Schlachten mit bis zu 64 Igeln
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_en.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, it's a Blast!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars is available for the Mac Appstore! Search Hedgewars on your Mac and get your FREE copy today!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+The iOS port has some exclusive features, such as
+* iPad VGA Out: hook an external display and play at full resolution;
+* Retina Display Support: play at a higher resolution the whole game;
+* Multitasking: pause the game at any time;
+* Game Restore: you will be always able to complete your match, no matter what.
+
+Description:
+This is the funniest and most addictive game you'll ever play - hilarious fun that you can enjoy anywhere, anytime. Hedgewars is a turn based strategy game but the real buzz is from watching the devastation caused by those pesky hedgehogs with those fantastic weapons - sneaky little blighters with a bad attitude!
+
+In other words Hedgewars is a turn based strategy, artillery, action and comedy game, featuring the antics of pink hedgehogs with attitude as they battle from the depths of hell to the depths of space.
+
+As commander, it's your job to assemble your crack team of hedgehog soldiers and bring the war to your enemy.
+
+Each player controls a team of several hedgehogs. During the course of the game, players take turns with one of their hedgehogs. They then use whatever tools and weapons are available to attack and kill the opponents' hedgehogs, thereby winning the game. Hedgehogs may move around the terrain in a variety of ways, normally by walking and jumping but also by using particular tools such as the "Rope" or "Parachute", to move to otherwise inaccessible areas. Each turn is time-limited to ensure that players do not hold up the game with excessive thinking or moving. A large variety of tools and weapons are available for players during the game: Grenade, Cluster Bomb, Bazooka, UFO, Shotgun, Desert Eagle, Fire Punch, Baseball Bat, Dynamite, Mine, Rope, Pneumatic pick, Parachute. Most weapons, when used, cause explosions that deform the terrain, removing circular chunks. The landscape is an island floating on a body of water, or a restricted cave with water at the bottom. A hedgehog dies when it enters the water (either by falling off the island, or through a hole in the bottom of it), it is thrown off either side of the arena or when its health is reduced, typically from contact with explosions, to zero (the damage dealt to the attacked hedgehog or hedgehogs after a player's or CPU turn is shown only when all movement on the battlefield has ceased).
+
+* Hilarious and devastating turn based combat for up to 6 players
+* Both local and network multiplayer, with optional AI opponents
+* Battle on an infinite number of randomly generated maps, with over 20 environments
+* Use 48 (and counting) overwhelming weapons! Including the piano strike and explosive robotic cake
+* Play the game your way, with more than 20 different game modifiers, tweak almost every aspect of the match
+* Customize your team, with over 120 costumes, 30 graves, 12 forts, 100s of flags and unique voice packs
+* Huge battles with up to 64 hogs
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_es.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, ¡es la leche!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+¡Hedgewars esta disponible en la Mac Appstore! ¡Busca Hedgewars en tu Mac y consigue tu copia gratuita hoy!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+La versión para iOS contiene algunas características exclusivas, como:
+* Salida VGA para iPad: conecta un monitor externo y juega a resolución completa;
+* Soporte para pantalla Retina: juega el juego entero a una resolución mayor;
+* Multitarea: pausa el juego en cualquier momento;
+* Restauración de partidas: siempre podrás completar tu partida, pase lo que pase.
+
+Descripción:
+Este es el juego más adictivo que jugarás - diviértete en cualquier sitio, en cualquier momento. Hedgewars es un juego de estrategia por turnos pero la verdadera diversión esta en ver como estos molestos erizos con sus fantásticas armas destrozan el entorno - unos pequeños pero gamberros tíos con ganas de liarla parda!
+
+En otras palabra, Hedgewars es un juego de estrategia por turnos, con toques de artillería, acción y comedia, protagonizado por las travesuras de erizos rosas con mal carácter que luchan desde el fondo del infierno hasta el espacio exterior.
+
+Eres el comandante, tu tarea es crear un potente equipo de erizos soldado y llevar la guerra a las puertas de tus enemigos.
+
+Cada jugador controla un equipo de varios erizos. Durante el transcurso de la partida, los jugador usan un turno con cada uno de sus erizos. Entonces pueden usar cualquier herramienta o arma disponible para atacar y matar a los erizos de los oponentes, ganando así la partida. Los erizos se pueden mover por el campo de juego de muchas maneras, normalmente andando o saltando pero también usando herramientas especiales como la "Cuerda" o el "Paracaídas", para moverse a lugares de otra forma incaccesibles. Cada turno tiene un límite de tiempo para asegurar que los jugadores no se pasan demasiado tiempo pensando o moviendo. Una gran variedad de armas y herramientas están disponibles durante la partida: Granada, Bomba de Racimo, Bazoka, UFO, Escopeta, Desert Eagle, Puñetazo de fuego, Bate de Beisbol, Dinamita, Minas, Cuerda, Taladro Neumático, Paracaidas. Casi todas las armas, cuando son usadas, causan explosiones que deforman el terreno, destruyendo sectores circulares. El paisaje es una isla que flota en el agua, o una restringida cueva con agua en el fondo. Un erizo muere cuando entra en el agua (ya sea callendose por un borde o un agujero), es lanzado fuera del campo de juego o cuando se queda sin vida, normalmente por las explosiones (el daño hecho a un erizo o unos erizos es mostrado después del turno del jugador o de la CPU cuando todo el movimiento en el campo de batalla ha terminado).
+
+* Divertido y devastador combate basado en turnos para un máximo de 6 jugadores.
+* Juego multijugador tanto local como en red, con oponentes virtuales opcionales
+* Lucha en infinitos mapas generados aleatoriamente, con más de 20 entornos.
+* Usa 48 (y la cuenta sigue) poderosas armas! Incluido el golpe de piano o la explosiva tarta robot
+* Juega a tu manera, con más de 20 modificadores de juego puedes configurar todo los aspectos de la partida
+* Personaliza to equipo, con más de 120 trajes, 30 tumbas, 12 fuertes, y cientos de banderas y voces únicas
+* Grandes batallas con hasta 64 puercos
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_fr.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, c'est génial!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars est disponible sur le Mac Appstore ! Cherchez Hedgewars sur votre Mac et obtenez une copie gratuite aujourd'hui !
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+Le portage vers iOS a quelques fonctionnalités exclusives, comme :
+* Sortie VGA de l'iPad: connectez un affichage externe et jouez à la résolution maximale;
+* Support de l'Affichage Rétinien: jouez le jeu entier à une résolution supérieure;
+* Multitâche: mettez le jeu en pause à n'importe-quel moment;
+* Restoration de Jeu: vous aurez toujours la possibilité de finir votre match, quoiqu'il arrive.
+
+Description :
+C'est le jeu le plus amusant et le plus addictif auquel vous ne jouerez jamais - de l'amusement que vous pouvez apprécier partout, tout le temps. Hedgewars est un jeu de stratégie au tour par tout mais le vrai intérêt est de regarder la dévastation causée par ces satanés hérissons avec ces armes fantastiques - sournois petits gars au mauvais comportement!
+
+En d'autres mots Hedgewars est un jeu au tour par tour basé sur la stratégie, l'artillerie, l'action et la comédie, présentant les pitreries des hérissons roses pendant qu'ils combattent des profondeurs de l'enfer aux profondeurs de l'espace.
+
+En tant que commandant, c'est votre devoir de rassembler votre folle équipe de soldats hérissons et de partir en guerre contre l'ennemi.
+
+Chaque joueur contrôle une équipe de plusieurs hérissons. Pendant le déroulement du jeu, les joueurs prennent leur tour avec un de leurs hérissons. Ils peuvent utiliser n'importe-quels outils ou armes disponibles pour attaquer et tuer les hérissons des opposants, et ainsi gagner la partie. Les hérissons peuvent bouger autour du terrain de diverses façons, généralement en marchant et sautant mais aussi en utilisant des outils particuliers comme la "Corbe" ou le "Parachute", pour atteindre des zones inaccessibles en d'autres circonstances. Chaque tour est limité en temps afin d'être sûr que les joueurs ne mettent pas le jeu en suspens en pensant ou bougeant à excès. Une grande diversité d'outils et d'armes sont disponibles pour les joueurs pendant le jeu : la Grenade, la Grenade à Fragmentation, le Bazooka, l'OVNI, le fusil à pompes, le Desert Eagle, le Poing de Feu, la Batte de Baseball, la Dynamite, la Mine, la Corbe, le Ramassage Pneumatique, le Parachute. La plupart des armes, lorsqu'elles sont utilisées, causent des explosions qui déforment le terrain, en enlevant des morceaux circulaires. Le paysage est une île flottant sur un plan d'eau. Un hérisson meure quand il entre dans de l'eau (soit en tombant en dehors de l'île, soit à travers un trou situé au fond de celle-ci), quand il est éjecté de n'importe-quel côté de l'arène ou quand sa santé est réduite, généralement au contact des explosions, à zéro (les dégâts infligés à l'hérisson ou aux hérissons attaqués après le tour d'un joueur ou d'un ordinateur est seulement montré quand tous les mouvements sur le champ de bataille ont cessé).
+
+* des combats tordants et dévastateurs basés sur le tour par tour jusqu'à 6 joueurs
+* multijoueur à la fois local et en réseau, avec d'optionnels opposants IA
+* Combattez sur un nombre infini de cartes générées aléatoirement, avec plus de 20 environnements
+* Utilisez 48 (et plus) d'armes écrasantes! Y compris la frappe de piano et le gateau explostif robotique
+* Jouez au jeu à votre façon, avec plus de 20 modificateurs de jeux différents, déformez presque chaque aspect du match
+* Personnalisez votre équipe, avec plus de 120 costumes, 30 tombes, 12 forts, 100s de drapeaux et d'uniques packs de voix
+* D'énormes batailles avec jusqu'à 64 hérissons
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_it.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, è Esplosivo!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars è disponiile sul Mac Appstore! Cerca Hedgewars sul tuo Mac e scarica la tua copia gratuitamente!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+La verisone per iOS offre alcune fantastiche esclusive, come
+* iPad VGA Out: attacca un dispaly esterno e gioca a piena risoluzione;
+* Retina Display Support: gioca ad una risoluzione pià alta per tutta la durata della partita;
+* Multitasking: metti in pausa il gioco in qualunque istante;
+* Game Restore: potrai ripristinare la partita in qualunque momento.
+
+Descrizione:
+Questio è videogioco più divertente che potrai provare - esilaranti momenti di divertimento che potrai sperimentare in qualsiasi momento e luogo. Hedgewars è un gioco di strategia a turni ma con una marcia in più: vedrai che devastazione sono in grado di causare questi riccetti rosa - creature scaltre con un pessimo carattere!
+
+In altre parole, Hedgewars è un gioco di strategia a turni, con elementi di artiglieria e azione, e con protagonisti ricci rosa che combattano dall profondità dell'inferno all'infinità dello spazio.
+
+Come comandante, dovrai radunare la tua squadra di ricci soldato e dichiarare guerra al tuo nemico.
+
+Ogni giocatore controlla una squadra di parecchi ricci; durante lo svologimento della partita, i giocatori controllano a turno uno dei loro ricci. Dopodiché usano una qualunque arma e strumento a disposizione per attare e uccidere i ricci nemici, vicendo così la parita. I ricci si posso muovere sul terreno di gioco in parecchi modi, normalmente camminando e saltando qua e là, ma anche usando strumenti particolari, come la "Corda", il "Paracadute" e il "Teletrasporto", per raggiungere posizioni impossibili. Ogni turno è dura una certa quantità di tempo per permettere ai giocatori una partita fluida senza stalli per preparare una strategia. Una grande varietà di strumenti sono disponibili per i giocatori: Granata, Bomba a Frammentazione, Bazooka, UFO, Fucile a Pompa, Aquila del Deserto, Pugno di Fuoco, Mazza da Baseball, Dinamite, Mina, Corda, Martello Pneumatico, Paracadute. La maggior parte delle armi quando utilizzate causano esplosioni che modificano il terreno, eliminando elementi circolari. Il terreno di gioco è un'isola circondata dal mare o una caverna sperduta con acqua a portata di mano. I ricci non sanno nuotare per cui affogheranno se vi cadranno (o se veranno lanciati); l'effetto sarà identico se i punti salute dei ricci raggiungeranno lo zero (i danni inflitti al riccio sono mostrati solo alla fine del turno quando tutti i ricci saranno fermi).
+
+* Esilaranti turni di devastazione fino a 8 giocatori
+* Partite in locale e in multiplayer su rete, con squadre controllate dall'intelligenza artificiale (opzionale)
+* Combatti su un numero infinito di mappe casuali, con oltre 20 temi disponibili
+* Usa 48 (e oltre) armi devastanti! Incluso il Paino e la Torta esplosiva
+* Gioca come ti pare, con oltre 20 tipi di modificatori di gioco, puoi cambiare qualsiasi aspetto della partita
+* Personalizza la tua squadra, con oltre 120 cappelli, 30 tombe, 12 fortini, centinaia di bandiere e voci uniche
+* Gigantesche battaglie con oltre 64 ricci
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_ja.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,28 @@
+
+Hedgewars, ブラストだ!
+
+Hedgewars が Mac アップストアに登場! Mac で Hedgewars を検索して無料コピーを今すぐダウンロードしよう!
+
+iOS ポートはいくつかの限定フィーチャーがあります。例えば:
+* iPad VGA アウト: 外部ディスプレイを接続してフル解像度でプレー
+* Retina ディスrプレイサポート: ゲームの全てを高い解像度でプレー;
+* マルチタスキング: いつでもゲームをポーズ;
+* ゲームリストア: あなたは何が何でもマッチを完成させることができます。
+
+説明:
+これはあなたが遊ぶ一番面白くて依存症のあるゲームです - いつでも、どこでも楽しめる陽気な楽しみ。 Hedgewars はターン制ストラテジーゲームですが、本当の楽しみはあの厄介なハリネズミがすばらしい武器を使って起こす破壊を見ることです - 悪い態度の小さな厄介者!
+
+言い換えれば、 Hedgewars はターン製ストラテジー、砲兵、アクションとコメディゲームで、地獄から宇宙まで 悪ふざけをするピンクのハリネズミが特色です。
+
+司令官としてのあなたの役目はハリネズミ兵のチームを編成し、敵に戦争を持ってゆくことです。
+
+プレイヤーはそれぞれ複数のハリネズミをコントロールします。ゲーム中は、ハリネズミの一つを使って交代します。利用可能な武器や道具を使って敵のハリネズミを攻撃して殺し、勝利を取ります。
+Hedgehogs は地形をさまざまな方法で動き回ります。普段は歩いたりジャンプしたりしますが、"ロープ"や"パラシュート"などの特定の道具を使って本来なら届かないエリアに移動することができます。ターンはプレイヤーが動いたいり考えたりする時間をとり過ぎないようにタイムリミットがかかっています。ゲーム中はさまざまな道具や武器が使えます:手榴弾、クラスター爆弾、UFO、ショットガン、デザートイーグル、ファイアーパンチ、野球バット、ダイナマイト、地雷、ロープ、ニューマチックピックやパラシュートです。ほとんどの武器は、使用時に、地形を変える爆発を起こします。地形は水の上に浮かんでいる島か、下に水がある洞窟です。ハリネズミは水の中に入るか(島から落ちるか、穴を通って)、アリーナの横から落とされるか、爆発などで体力がゼロに減ると(プレーヤーやCPUのターンのダメージは全ての動きが止まった後表示されます)死んでしまいます。
+
+* 六人までの陽気と壊滅的なターン制コンバット
+* AIも追加可能なローカルとネットワーク上のマルチプレーヤー
+* ランダムで作成された無限のマップと二十以上の環境の中で戦おう
+* 48(上昇中)の圧倒的な武器を使おう!ピアノストライクと爆発的なロボットケーキも含みます。
+* 二十種類以上のゲーム修飾法で戦いのほとんどの部分を微調整して自分のやり方でプレーしよう
+* 120以上のコスチューム、30以上の墓、12以上の砦、100以上のフラグやユニークなボイスパックでチームをカスタマイズ
+* 64体までの広大な戦い
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_pl.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars jest super!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+Hedgewars jest dostępny na Mac Appstore! Poszukaj Hedgewars na swoim Mac'u i otrzymaj kopię za darmo!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+Port na iOS posiada kilka unikalnych funkcji, takich jak:
+* Wtyczka iPad VGA : podłącz zewnętrzny ekran i graj w pełnej rozdzielczości;
+* Wsparcie dla Retina Display: graj całą grę w wyższej rozdzielczości;
+* Wielozadaniowość: pauzuj grę kiedy chcesz;
+* Wznawianie gry: zawsze możesz dokończyć swój mecz;.
+
+Opis:
+To najzabawniejsza i najbardziej uzależniająca gra w jaką kiedykolwiek grałeś - niezwykła zabawa, w którą możesz wciągnąć się zawsze i wszędzie. Hedgewars to turowa gra strategiczna, jednak najlepsze jest patrzenie, jak te małe jeże niszczą otoczenie swoim niecodziennym orężem. Nie daj się zmylić pozorom - to podstępne małe gagatki z nie do końca dobrą postawą.
+
+Inaczej mówiąc Hedgewars jest komediową grą strategiczną, artylerii i akcji, w której do łez rozbawią cię wybryki jeżów z charakterkiem, które walczą ze sobą przy każdej okazji.
+
+W roli dowódcy, Twoją robotą będzie zorganizowanie ekipy jeży i sprawienie piekła przeciwnikowi.
+
+Każdy gracz kontroluje drużynę złożoną z kilku jeży. Podczas gry, uczestnicy kierują jednym jeżem na turę. Mogą wtedy używać przeróżnych narzędzi i broni, którymi rozniesie w pył jeże wroga, w ten sposób zwyciężając. Jeże przemieszczać się mogą na różnorakie sposoby, m.in. chodząc lub skacząc, ale również używając narzędzi takich jak lina, czy spadochron, aby dostać się do trudno dostępnych obszarów. Każda tura jest ograniczona czasowo, aby zapewnić brak sytuacji, w których gracz zbyt długo "zastanawia się nad ruchem". Gracze do dyspozycji mają dużą pulę broni i narzędzi: granaty, bomby kasetowe, bazooki, UFO, strzelby, pistolety Desert Eagle, kije baseballowe, dynamity, miny, młoty pneumatyczne. Większość typów oręża powoduje eksplozje, które deformują teren zostawiając okrągłe wyrwy. Mapa jest unoszącą się na wodzie wyspą, lub ograniczoną jaskinią, z wodą na dnie. Jeż umiera, gdy znajdzie się w wodzie (na przykład przez wyrzucenie poza wyspę lub wpadnięcie do dziury), wypadnie poza mapę, lub jeśli jego poziom zdrowia wyniesie 0 (obrażenia zadane jeżom przez gracza lub CPU ukazują się gdy wszystkie ruchy są zatrzymane).
+
+* Komiczne i niszczycielskie boje podzielone na tury dla maksymalnie 6 graczy
+* Możliwa jest gra zarówno lokalna jak i sieciowa z opcjonalnymi przeciwnikami AI
+* Bitwy na nieskończonej ilości, losowo generowanych map z ponad 20 różnymi środowiskami
+* Aż 48 rodzajów (liczba ciągle rośnie) druzgocących broni! Między innymi zrzut pianina, czy eksplodujące ciasto urodzinowe
+* Graj jak tylko chcesz. Masz do dyspozycji ponad 20 modyfikacji, możesz zasmakować każdego aspektu rozgrywki.
+* Dostosuj swoją drużynę do własnych zachcianek. Możesz wybrać 120 przebrań, 30 grobów, 12 fortów, setki flag oraz unikalne zestawy głosów
+* Ogromne bitwy, w których mogą uczestniczyć aż 64 jeże.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_pt.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,31 @@
+Hedgewars, é um Estrondo!
+
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+O Hedgewars está disponível na Mac App Store! Pesquisa Hedgewars no teu MacBook e obtém a tua cópia GRATUITA hoje!
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭
+✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭✭ 
+
+A versão para iOS tem algumas funcionalidades exclusivas, como
+* Saída VGA no iPad: liga-o a um ecrã externo e joga em resolução completa;
+* Suporte para Retina Display: joga numa resolução mais alta durante todo o jogo;
+* Multitarefa: pausa o jogo a qualquer altura;
+* Restaurar o jogo: vais ser sempre capaz de completar o teu jogo.
+
+Descrição:
+Este é o mais divertido e viciante jogo que alguma vez vais jogar - diversão hilariante a qual podes aproveitar onde estives, quando quiseres. Hedgewars é um jogo de estratégia por turnos, mas o que é ainda mais espetacular, é ver a destruição causada pelos pequenos ouriços e o seu fantásticas arsenal!
+
+Por outras palavras, Hedgewars é um jogo de estratégia por turnos, artilharia, ação e comédia, patrocinado pelas palhaçadas dos pequenos ouriços cor-de-rosa cheios de atitude, enquanto lutam das profundezas do inferno ás do espaço.
+
+Como comandante, é o teu trabalho reunir uma equipa de ouriços especialistas e levar a guerra ao teu inimigo.
+
+Cada jogador controla uma equipa de vários ouriços. Durante o decorrer do jogo, os jogadores controlam alternadamente um dos seus ouriços. Depois utilizam qualquer ferramenta ou arma disponível para atacar e destruir os ouriços oponentes, ganhando assim o jogo. Os ouriços podem deslocar-se pelo terreno de variadíssimas maneiras, normalmente a andar e a saltar, mas também utilizando ferramentas como a "Corda" ou o "Paraquedas", para chegarem a áreas de outro modo inacessíveis. Cada turno tem tempo limitado para garantir que os jogadores não passam demasiado tempo a pensar ou a movimentar-se. Uma grande variedade de ferramentas e armas estão disponíveis durante o jogo: Granada, Bomba de Fragmentos, Bazuca, Disco Voador, Caçadeira, Desert Eagle, Shoryuken, Taco de Basebol, Dinamite, Mina, Corda, Martelo Pneumático, Paraquedas. A maioria das armas, quando utilizadas, causam explosões que deformam o terreno, removendo pedaços circulares. A paisagem é simplesmente uma ilha a flutuar numa massa de água, ou uma caverna com água no fundo. Um ouriço morre quando entra na água (caindo da ilha, ou através de um buraco), é atirado para fora da arena ou quando a sua vida é reduzida, tipicamente quando entra em contacto com explosões, a zero (o dano causado ao ouriço ou ouriços atacados, após o turno de um jogador ou CPU, é apenas mostrado quando todo o movimento no campo de batalha tiver acabado).
+
+* Hilariante e devastador jogo de combate por turnos para até 6 jogadores
+* Modo local e multijogador por rede, com oponentes IA opcionais
+* Batalha num número ilimitado de mapas gerados aleatoriamente, e em mais de 20 ambientes diferentes
+* Utiliza 48 (e a aumentar) impressionantes armas! Incluindo o ataque piano e o bolo robótico explosivo
+* Joga o jogo à tua maneira, com mais de 20 modificadores de jogo diferentes, muda quase todos os aspectos do jogo
+* Personaliza a tua equipa, com mais de 120 chapéus, 30 sepulturas, 12 fortes, 100s de bandeiras e packs de voz únicos
+* Enormes batalhas com até 64 ouriços
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Locale/hw-desc_ro.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,25 @@
+Războiul aricilor! E beton!
+Războiul aricilor este disponibil pentru Mac Appstore! Caută Războiul aricilor pe Mac-ul tău și downloadează o copie GRATUITĂ acum!
+
+Portarea iOS are câteva caracteristici exclusive, cum ar fi:
+* Ieșire VGA pe iPad: atașeză un dispozitiv extern și joacă la rezoluție maximă;
+* Suport pentru ecran Retina: joacă la o rezoluție mai mare tot jocul;
+* Multitasking : întrerupe jocul oricând;
+* Restaurarea joc: vei putea să termini meciul oricând, indiferent de situație;
+
+Descriere:
+Acesta este cel mai distractiv și cel mai captivant joc pe care îl vei juca - distracție hilară, putând să te distrezi oriunde, oricând. Războiul aricilor este un joc de strategie bazat pe runde dar adevăratul zumzet e să vezi devastarea făcută de acei arici plictisitori cu armele lor fantastice - mici distrugători lași cu o atitudine rea.
+
+Cu alte cuvinte, Războiul aricilor este un joc de strategie, artilerie, de acțiune și comedie, bazat pe runde, oferind aricii rozi și antici cu atitudine, în timp ce se bat din adâncurile iadului până la suprafața cosmosului.
+
+Ca și comandant, este responsabilitatea ta sa asamblezi o echipă tare de arici soldați și să declari război inamicului.
+
+Fiecare jucător controlează o echipă de mai mulți arici. În timpul jocului, jucătorii joacă pe rând în fiecare rând cu aricii lor. Pot folosi orice unelte sau arme au la dispoziție, pentru a ataca aricii inamicului, câștigând jocul. Aricii se pot muta pe teren în o mulțime de metode, în mod normal mergând și sărind, dar și folosind unelte particulare ca și ”Funie” sau ”Parașută”, pentru a ajunge în zone de altfel inaccesibile. Fiecare rundă e limitată la timp pentru a se asigura că jucătorii nu țin jocul prin gândire sau mutare excesivă. O mare varietate de unelte și arme sunt valabile pentru jucători în timpul jocului: Grenade, Bombă îndesată, Bazuca, OZN, Shotgun, Desert Eagle, Pumn de foc, Minge de baseball, Dinamită, Mină, Funie, Ciocan pneumatic, Parașută. Majoritatea armelor, când sunt utilizate cauzează explozii care deformează terenul, eliminând părțile circulare. Peisajul este o insulă plutitoare, sau o peșteră restrictivă cu apă pe jos. Un arici moare când ajunge în apă (fie căzând de pe insulă sau printr-o cauză în fundul ei), este aruncat într-o parte a arenei sau când viața îi este redusă, în mod normal din cauza unei explozii, la 0 (dauna dată la ariciul sau aricii atacați, după ce runda jucătorului sau UCP-ului este arătată, doar când toată mișcarea de pe câmpul de luptă se termină)
+
+* Bătaie hilară și devastatoare pe runde, pentru până la 6 jucători
+* Multiplayer local sau în rețea, cu inamici IA opționali
+* Bate-te pe o infinitate de hărți generate aleator, în peste 20 de medii
+* Folosește 48 (și încă se mai numără) de arme copleșitoare! Incluzând lovitura de pian și tortul robotic exploziv
+* Joacă-te în felul tău, cu mai mult de 20 de modificatori ai jocului, optimizând fiecare aspect al meciului
+* Personalizează-ți echipa, cu peste 120 de costume, 30 de morminte, 12 fortărețe, 100 de steaguri și pachete de voce unice.
+* Bătăli imense cu până la 64 de arici.
\ No newline at end of file
Binary file project_files/HedgewarsMobile/Locale/hw-desc_tr.txt has changed
Binary file project_files/HedgewarsMobile/Resources/Frontend/smallerBackground~ipad.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/ammoButton.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/ammoButton@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowDown.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowDown@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowLeft.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowLeft@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowRight.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowRight@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowUp.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/arrowUp@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/cornerButton.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/cornerButton@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/helpabove.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/helpbottom.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/helpingame.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/helpleft.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/helpplain.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/helpright.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/joyButtonAttack.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/joyButtonAttack@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/joyButtonBackJump.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/joyButtonBackJump@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/joyButtonForwardJump.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/joyButtonForwardJump@2x.png has changed
Binary file project_files/HedgewarsMobile/Resources/backSound.caf has changed
Binary file project_files/HedgewarsMobile/Resources/backSound.wav has changed
Binary file project_files/HedgewarsMobile/Resources/clickSound.caf has changed
Binary file project_files/HedgewarsMobile/Resources/clickSound.wav has changed
Binary file project_files/HedgewarsMobile/Resources/selSound.caf has changed
Binary file project_files/HedgewarsMobile/Resources/selSound.wav has changed
--- a/project_files/HedgewarsMobile/SDL-50560ca58f80.patch	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-diff -r 50560ca58f80 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
---- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Oct 24 23:18:53 2011 -0400
-+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Wed Nov 02 09:22:08 2011 +0100
-@@ -1596,9 +1596,12 @@
- 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- 				GCC_C_LANGUAGE_STANDARD = c99;
- 				GCC_DEBUGGING_SYMBOLS = full;
-+				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 = NO;
--				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
-+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
- 				ONLY_ACTIVE_ARCH = NO;
- 				PREBINDING = NO;
- 				SDKROOT = iphoneos;
-@@ -1613,9 +1616,12 @@
- 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- 				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 = NO;
--				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
-+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
- 				PREBINDING = NO;
- 				SDKROOT = iphoneos;
- 				TARGETED_DEVICE_FAMILY = "1,2";
-diff -r 50560ca58f80 include/SDL_config_iphoneos.h
---- a/include/SDL_config_iphoneos.h	Mon Oct 24 23:18:53 2011 -0400
-+++ b/include/SDL_config_iphoneos.h	Wed Nov 02 09:22:08 2011 +0100
-@@ -106,7 +106,7 @@
- /* enable iPhone version of Core Audio driver */
- #define SDL_AUDIO_DRIVER_COREAUDIO 1
- /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
--#define SDL_AUDIO_DRIVER_DUMMY	1
-+#define SDL_AUDIO_DRIVER_DUMMY	0
- 
- /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
- #define SDL_HAPTIC_DISABLED	1
-@@ -132,16 +132,16 @@
- /* enable OpenGL ES */
- #define SDL_VIDEO_OPENGL_ES	1
- #define SDL_VIDEO_RENDER_OGL_ES	1
--#define SDL_VIDEO_RENDER_OGL_ES2	1
-+#define SDL_VIDEO_RENDER_OGL_ES2	0
- 
- /* Enable system power support */
--#define SDL_POWER_UIKIT 1
-+#define SDL_POWER_UIKIT 0
- 
- /* enable iPhone keyboard support */
- #define SDL_IPHONE_KEYBOARD 1
- 
- /* enable joystick subsystem */
--#define SDL_JOYSTICK_DISABLED 0
-+#define SDL_JOYSTICK_DISABLED 1
- 
- /* Set max recognized G-force from accelerometer
-    See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
-diff -r 50560ca58f80 src/video/uikit/SDL_uikitopenglview.m
---- a/src/video/uikit/SDL_uikitopenglview.m	Mon Oct 24 23:18:53 2011 -0400
-+++ b/src/video/uikit/SDL_uikitopenglview.m	Wed Nov 02 09:22:08 2011 +0100
-@@ -114,8 +114,8 @@
- 
-         // !!! FIXME: use the screen this is on!
-         /* Use the main screen scale (for retina display support) */
--        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
--            self.contentScaleFactor = [UIScreen mainScreen].scale;
-+        if ([self respondsToSelector:@selector(contentScaleFactor)])
-+            self.contentScaleFactor = [[UIScreen mainScreen] scale];
- 
-         self.autoresizingMask = 0;  // don't allow autoresize, since we need to do some magic in -(void)updateFrame.
-     }
-@@ -144,8 +144,8 @@
- 
-     // !!! FIXME: use the screen this is on!
-     /* Use the main screen scale (for retina display support) */
--    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
--        self.contentScaleFactor = [UIScreen mainScreen].scale;
-+    if ([self respondsToSelector:@selector(contentScaleFactor)])
-+        self.contentScaleFactor = [[UIScreen mainScreen] scale];
- }
- 
- - (void)setCurrentContext
-diff -r 50560ca58f80 src/video/uikit/SDL_uikitvideo.m
---- a/src/video/uikit/SDL_uikitvideo.m	Mon Oct 24 23:18:53 2011 -0400
-+++ b/src/video/uikit/SDL_uikitvideo.m	Wed Nov 02 09:22:08 2011 +0100
-@@ -178,7 +178,7 @@
- 
-     // UIScreenMode showed up in 3.2 (the iPad and later). We're
-     //  misusing this supports_multiple_displays flag here for that.
--    if (!SDL_UIKit_supports_multiple_displays) {
-+    if (SDL_UIKit_supports_multiple_displays) {
-         UIScreenMode *uimode = [uiscreen currentMode];
-         [uimode retain];  // once for the desktop_mode
-         [uimode retain];  // once for the current_mode
-@@ -200,10 +200,8 @@
- {
-     _this->gl_config.driver_loaded = 1;
- 
--    NSString *reqSysVer = @"3.2";
--    NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
--    if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending)
--        SDL_UIKit_supports_multiple_displays = YES;
-+    // this tells us whether we are running on ios >= 3.2
-+    SDL_UIKit_supports_multiple_displays = [UIScreen instancesRespondToSelector:@selector(currentMode)];
- 
-     // Add the main screen.
-     UIScreen *uiscreen = [UIScreen mainScreen];
-diff -r 50560ca58f80 src/video/uikit/SDL_uikitview.m
---- a/src/video/uikit/SDL_uikitview.m	Mon Oct 24 23:18:53 2011 -0400
-+++ b/src/video/uikit/SDL_uikitview.m	Wed Nov 02 09:22:08 2011 +0100
-@@ -311,7 +311,7 @@
- /* iPhone keyboard addition functions */
- #if SDL_IPHONE_KEYBOARD
- 
--SDL_uikitview * getWindowView(SDL_Window * window)
-+SDL_uikitview *SDL_getUikitView(SDL_Window *window)
- {
-     if (window == NULL) {
-         SDL_SetError("Window does not exist");
-@@ -328,9 +328,9 @@
-     return view;
- }
- 
--int SDL_iPhoneKeyboardShow(SDL_Window * window)
-+int SDL_iPhoneKeyboardShow(SDL_Window *window)
- {
--    SDL_uikitview *view = getWindowView(window);
-+    SDL_uikitview *view = SDL_getUikitView(window);
-     if (view == nil) {
-         return -1;
-     }
-@@ -339,9 +339,9 @@
-     return 0;
- }
- 
--int SDL_iPhoneKeyboardHide(SDL_Window * window)
-+int SDL_iPhoneKeyboardHide(SDL_Window *window)
- {
--    SDL_uikitview *view = getWindowView(window);
-+    SDL_uikitview *view = SDL_getUikitView(window);
-     if (view == nil) {
-         return -1;
-     }
-@@ -350,9 +350,9 @@
-     return 0;
- }
- 
--SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window)
-+SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window)
- {
--    SDL_uikitview *view = getWindowView(window);
-+    SDL_uikitview *view = SDL_getUikitView(window);
-     if (view == nil) {
-         return 0;
-     }
-@@ -360,9 +360,9 @@
-     return view.keyboardVisible;
- }
- 
--int SDL_iPhoneKeyboardToggle(SDL_Window * window)
-+int SDL_iPhoneKeyboardToggle(SDL_Window *window)
- {
--    SDL_uikitview *view = getWindowView(window);
-+    SDL_uikitview *view = SDL_getUikitView(window);
-     if (view == nil) {
-         return -1;
-     }
-@@ -380,24 +380,24 @@
- 
- /* stubs, used if compiled without keyboard support */
- 
--int SDL_iPhoneKeyboardShow(SDL_Window * window)
-+int SDL_iPhoneKeyboardShow(SDL_Window *window)
- {
-     SDL_SetError("Not compiled with keyboard support");
-     return -1;
- }
- 
--int SDL_iPhoneKeyboardHide(SDL_Window * window)
-+int SDL_iPhoneKeyboardHide(SDL_Window *window)
- {
-     SDL_SetError("Not compiled with keyboard support");
-     return -1;
- }
- 
--SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window)
-+SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window)
- {
-     return 0;
- }
- 
--int SDL_iPhoneKeyboardToggle(SDL_Window * window)
-+int SDL_iPhoneKeyboardToggle(SDL_Window *window)
- {
-     SDL_SetError("Not compiled with keyboard support");
-     return -1;
-diff -r 50560ca58f80 src/video/uikit/SDL_uikitviewcontroller.m
---- a/src/video/uikit/SDL_uikitviewcontroller.m	Mon Oct 24 23:18:53 2011 -0400
-+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Wed Nov 02 09:22:08 2011 +0100
-@@ -28,8 +28,8 @@
- 
- #include "SDL_uikitwindow.h"
- 
--#import "SDL_uikitviewcontroller.h"
--
-+#include "SDL_uikitviewcontroller.h"
-+#include "SDL_uikitvideo.h"
- 
- @implementation SDL_uikitviewcontroller
- 
-@@ -116,38 +116,17 @@
-     const UIInterfaceOrientation toInterfaceOrientation = [self interfaceOrientation];
-     SDL_WindowData *data = self->window->driverdata;
-     UIWindow *uiwindow = data->uiwindow;
--    UIScreen *uiscreen = [uiwindow screen];
-+    UIScreen *uiscreen;
-+    if (SDL_UIKit_supports_multiple_displays)
-+        uiscreen = [uiwindow screen];
-+    else
-+        uiscreen = [UIScreen mainScreen];
-     const int noborder = self->window->flags & SDL_WINDOW_BORDERLESS;
-     CGRect frame = noborder ? [uiscreen bounds] : [uiscreen applicationFrame];
--    const CGSize size = frame.size;
--    int w, h;
--
--    switch (toInterfaceOrientation) {
--        case UIInterfaceOrientationPortrait:
--        case UIInterfaceOrientationPortraitUpsideDown:
--            w = (size.width < size.height) ? size.width : size.height;
--            h = (size.width > size.height) ? size.width : size.height;
--            break;
--
--        case UIInterfaceOrientationLandscapeLeft:
--        case UIInterfaceOrientationLandscapeRight:
--            w = (size.width > size.height) ? size.width : size.height;
--            h = (size.width < size.height) ? size.width : size.height;
--            break;
--
--        default:
--            SDL_assert(0 && "Unexpected interface orientation!");
--            return;
--    }
--
--    frame.size.width = w;
--    frame.size.height = h;
--    frame.origin.x = 0;
--    frame.origin.y = 0;
- 
-     [uiwindow setFrame:frame];
-     [data->view updateFrame];
--    SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
-+    SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, frame.size.width, frame.size.height);
- }
- 
- @end
--- a/project_files/hedgewars.pro	Thu Nov 24 13:44:30 2011 +0100
+++ b/project_files/hedgewars.pro	Sun Oct 28 13:28:23 2012 +0100
@@ -9,23 +9,17 @@
 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
-}
+DESTDIR = ../bin
 
 QT += network
 QT += webkit
 
-HEADERS += ../QTfrontend/model/themesmodel.h \
+HEADERS += ../QTfrontend/model/ThemeModel.h \
+    ../QTfrontend/model/MapModel.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 \
@@ -72,7 +66,7 @@
     ../QTfrontend/ui/widget/mapContainer.h \
     ../QTfrontend/ui/widget/HistoryLineEdit.h \
     ../QTfrontend/ui/widget/SmartLineEdit.h \
-    ../QTfrontend/util/HWDataManager.h \
+    ../QTfrontend/util/DataManager.h \
     ../QTfrontend/net/netregister.h \
     ../QTfrontend/net/netserver.h \
     ../QTfrontend/net/netudpwidget.h \
@@ -93,13 +87,29 @@
     ../QTfrontend/achievements.h \
     ../QTfrontend/binds.h \
     ../QTfrontend/ui_hwform.h \
-	../QTfrontend/KB.h \
+    ../QTfrontend/KB.h \
     ../QTfrontend/hwconsts.h \
-    ../QTfrontend/sdlkeys.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/util/libav_iteraction.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
 
 SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
-    ../QTfrontend/model/themesmodel.cpp \
-    ../QTfrontend/model/hats.cpp \
+    ../QTfrontend/model/MapModel.cpp \
+    ../QTfrontend/model/ThemeModel.cpp \
     ../QTfrontend/model/netserverslist.cpp \
     ../QTfrontend/ui/qaspectratiolayout.cpp \
     ../QTfrontend/ui/page/pagemain.cpp \
@@ -147,7 +157,7 @@
     ../QTfrontend/ui/widget/mapContainer.cpp \
     ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
     ../QTfrontend/ui/widget/SmartLineEdit.cpp \
-    ../QTfrontend/util/HWDataManager.cpp \
+    ../QTfrontend/util/DataManager.cpp \
     ../QTfrontend/net/tcpBase.cpp \
     ../QTfrontend/net/netregister.cpp \
     ../QTfrontend/net/proto.cpp \
@@ -169,58 +179,83 @@
     ../QTfrontend/util/SDLInteraction.cpp \
     ../QTfrontend/team.cpp \
     ../QTfrontend/ui_hwform.cpp \
-    ../QTfrontend/hwconsts.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/util/libav_iteraction.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
 
-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
+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../misc/quazip -lquazip
+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
-} 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
+    LIBS += -lSDL -lSDL_mixer
+    !win32 {
+        INCLUDEPATH += /usr/local/include/SDL /usr/include/SDL
+    }
+}
 
- 	#CONFIG += x86 ppc x86_64 ppc64
-}
+FORMS +=
Binary file project_files/promotional_art/Icon.png has changed
Binary file project_files/promotional_art/Marketplace-header.png has changed
Binary file project_files/promotional_art/Promo-graphic.png has changed
--- a/share/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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 @@
 		DESTINATION ../Resources/)
 	install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem"
 		DESTINATION ../Resources/)
-ENDIF(APPLE)
+ENDIF(APPLE OR CROSSAPPLE)
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png has changed
--- a/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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}
Binary file share/hedgewars/Data/Graphics/ExplPart.png has changed
Binary file share/hedgewars/Data/Graphics/ExplPart2.png has changed
Binary file share/hedgewars/Data/Graphics/Flags/cm_soviet.png has changed
Binary file share/hedgewars/Data/Graphics/Flags/cpu_plain.png has changed
Binary file share/hedgewars/Data/Graphics/Graves/dragonball.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Graphics/Graves/dragonball.svg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,606 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   width="32"
+   height="256"
+   sodipodi:docname="Dragonball.svg"
+   inkscape:export-filename="/home/alumno/Dragonball.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <metadata
+     id="metadata8">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs6">
+    <linearGradient
+       id="linearGradient4055-9"
+       inkscape:collect="always">
+      <stop
+         id="stop4057-4"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop4059-43"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       y2="44.056526"
+       x2="130.48477"
+       y1="44.056526"
+       x1="-9.8052101"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient3900-8"
+       xlink:href="#linearGradient4055-9"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient4055-3-0-4"
+       inkscape:collect="always">
+      <stop
+         id="stop4057-6-7-5"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop4059-2-5-2"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       y2="44.056526"
+       x2="130.48477"
+       y1="44.056526"
+       x1="-9.8052101"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient3488-6"
+       xlink:href="#linearGradient4055-3-0-4"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient4055-80"
+       inkscape:collect="always">
+      <stop
+         id="stop4057-7"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop4059-1"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       y2="44.056526"
+       x2="130.48477"
+       y1="44.056526"
+       x1="-9.8052101"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient4091-2"
+       xlink:href="#linearGradient4055-80"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient4055-8-2-8"
+       inkscape:collect="always">
+      <stop
+         id="stop4057-8-7-0"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop4059-4-7-8"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4055-8-2-8"
+       id="linearGradient4113-9-1"
+       gradientUnits="userSpaceOnUse"
+       x1="-9.8052101"
+       y1="44.056526"
+       x2="130.48477"
+       y2="44.056526" />
+    <linearGradient
+       id="linearGradient4055-3"
+       inkscape:collect="always">
+      <stop
+         id="stop4057-6"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop4059-2"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       y2="44.056526"
+       x2="130.48477"
+       y1="44.056526"
+       x1="-9.8052101"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient4091-0"
+       xlink:href="#linearGradient4055-3"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient4055-8"
+       inkscape:collect="always">
+      <stop
+         id="stop4057-8"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop4059-4"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       y2="44.056526"
+       x2="130.48477"
+       y1="44.056526"
+       x1="-9.8052101"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient4091-1"
+       xlink:href="#linearGradient4055-8"
+       inkscape:collect="always" />
+  </defs>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1024"
+     inkscape:window-height="576"
+     id="namedview4"
+     showgrid="false"
+     inkscape:zoom="0.92187498"
+     inkscape:cx="9.5337118"
+     inkscape:cy="163.22073"
+     inkscape:window-x="0"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <g
+     id="g3100">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 a 70.144989,72.407738 0 1 1 -140.2899801,0 70.144989,72.407738 0 1 1 140.2899801,0 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 a 70.144989,72.407738 0 1 1 -140.2899801,0 70.144989,72.407738 0 1 1 140.2899801,0 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     transform="translate(-1.5272255e-8,-32.508047)"
+     id="g3100-0">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-1"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7-52"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077-67"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071-7"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     transform="translate(-1.5272256e-8,31.848953)"
+     id="g3100-1">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-11"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7-9"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077-9"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071-51"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     id="g3100-5"
+     transform="translate(0,96.26138)">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-8"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7-86"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077-4"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071-5"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     transform="translate(-1.5272255e-8,63.753333)"
+     id="g3100-0-0">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-1-1"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7-52-0"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077-67-5"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071-7-0"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     transform="translate(-1.5272256e-8,128.11033)"
+     id="g3100-1-8">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-11-9"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7-9-4"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077-9-1"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071-51-2"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     id="g3100-5-3"
+     transform="translate(-1.5272253e-8,160.30523)">
+    <path
+       transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-8-8"
+       style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)"
+       d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+       sodipodi:ry="72.407738"
+       sodipodi:rx="70.144989"
+       sodipodi:cy="44.056526"
+       sodipodi:cx="60.339779"
+       id="path3060-7-86-6"
+       style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:nodetypes="cssscsscc"
+       inkscape:connector-curvature="0"
+       id="path4077-4-0"
+       d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+       style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+    <path
+       transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)"
+       inkscape:transform-center-y="-0.35951858"
+       inkscape:transform-center-x="0.015096207"
+       d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+       inkscape:randomized="0"
+       inkscape:rounded="0"
+       inkscape:flatsided="false"
+       sodipodi:arg2="1.5590267"
+       sodipodi:arg1="0.93070817"
+       sodipodi:r2="1.9533451"
+       sodipodi:r1="3.9066894"
+       sodipodi:cy="12.666666"
+       sodipodi:cx="13.466667"
+       sodipodi:sides="5"
+       id="path4071-5-7"
+       style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       sodipodi:type="star" />
+  </g>
+  <g
+     transform="translate(8.8208575,190.52706)"
+     id="g3100-1-8-8">
+    <g
+       id="g3339"
+       transform="translate(-8.8208575,1.5340622)">
+      <path
+         sodipodi:type="arc"
+         style="fill:#ffac24;fill-opacity:1;fill-rule:nonzero;stroke:none"
+         id="path3060-11-9-8"
+         sodipodi:cx="60.339779"
+         sodipodi:cy="44.056526"
+         sodipodi:rx="70.144989"
+         sodipodi:ry="72.407738"
+         d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+         transform="matrix(0.17677671,0,0,0.17125242,5.7333328,42.12326)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:#ed9206;fill-opacity:1;fill-rule:nonzero;stroke:none"
+         id="path3060-7-9-4-8"
+         sodipodi:cx="60.339779"
+         sodipodi:cy="44.056526"
+         sodipodi:rx="70.144989"
+         sodipodi:ry="72.407738"
+         d="m 130.48477,44.056526 c 0,39.98969 -31.404983,72.407734 -70.144991,72.407734 -38.740008,0 -70.1449891,-32.418044 -70.1449891,-72.407734 0,-39.9896891 31.4049811,-72.407738 70.1449891,-72.407738 38.740008,0 70.144991,32.4180489 70.144991,72.407738 z"
+         transform="matrix(0.15467962,0,0,0.14984587,6.4957768,42.439091)" />
+      <path
+         style="fill:#ed8306;fill-opacity:1;fill-rule:nonzero;stroke:none"
+         d="m 19.085438,59.142083 c -0.36023,-0.1397 -0.589073,-0.503672 -0.658968,-1.048089 -0.15772,-1.228515 2.606903,-2.373056 3.740935,-4.08299 1.116204,-1.683048 0.58952,-3.935901 1.989235,-4.615917 0.701981,-0.341041 1.092365,-0.417866 1.519378,-0.299001 0.539091,0.150054 0.761059,0.492497 0.807314,1.24549 0.14374,2.339891 -2.644356,6.671744 -5.339,8.295178 -0.719612,0.433543 -1.653173,0.662676 -2.058892,0.505335 z"
+         id="path4077-9-1-3"
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cssscsscc" />
+      <path
+         sodipodi:type="star"
+         style="opacity:0.55;fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+         id="path4071-51-2-5"
+         sodipodi:sides="5"
+         sodipodi:cx="13.466667"
+         sodipodi:cy="12.666666"
+         sodipodi:r1="3.9066894"
+         sodipodi:r2="1.9533451"
+         sodipodi:arg1="0.93070817"
+         sodipodi:arg2="1.5590267"
+         inkscape:flatsided="false"
+         inkscape:rounded="0"
+         inkscape:randomized="0"
+         d="M 15.800001,15.799999 13.489657,14.619876 11.20773,15.854051 11.616158,13.292105 9.7372337,11.503245 12.3,11.099999 l 1.120688,-2.3397518 1.175448,2.3127258 2.571548,0.342814 -1.8363,1.83259 z"
+         inkscape:transform-center-x="0.015096207"
+         inkscape:transform-center-y="-0.35951858"
+         transform="matrix(1.3174211,0,0,1.2399999,-1.1801897,33.032817)" />
+    </g>
+  </g>
+  <path
+     style="opacity:0.41999996;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+     d="m 5.6818853,52.944892 c -1.4249208,-4.670814 -0.1790584,-8.097449 1.725719,-10.495306 2.0559768,-2.588197 5.0634737,-4.368771 8.4063917,-4.281193 2.450497,-0.111055 5.480318,1.374625 5.480318,1.374625 -0.07868,0.78593 -6.13236,2.602482 -8.919506,5.655618 -2.283219,2.501117 -5.0641461,7.081358 -4.7383419,11.096412 -0.6809241,-0.87477 -1.4647048,-2.11081 -1.9545808,-3.350156 z"
+     id="path4121-4"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cscsscc" />
+  <path
+     style="opacity:0.41999996;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+     d="M 5.9583102,85.256922 C 5.4238859,83.650628 4.4751276,79.169801 5.5109031,77.40561 6.5395157,75.653619 7.397708,73.991223 8.317305,73.071625 c 1.079063,-1.079062 3.838619,-3.17952 9.462215,-2.843943 1.806813,0.204535 4.457553,1.7441 4.457553,1.7441 -0.07868,0.78593 -5.183207,3.531776 -7.970353,6.584911 -2.14499,2.349697 -4.7242734,7.983314 -6.5030137,9.559525 -0.3693871,-0.482911 -1.133301,-1.17148 -1.8053961,-2.859296 z"
+     id="path4121-4-6"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="csscsscc" />
+  <path
+     style="opacity:0.41999996;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+     d="m 6.0993866,117.32562 c 3.5759918,-9.01347 6.7157204,-11.897 11.9170884,-14.69367 1.806813,-0.27485 4.361674,1.40853 4.361674,1.40853 -0.07868,0.78593 -4.173901,3.91587 -6.961045,6.96901 -2.708171,2.96662 -6.4118227,14.10633 -9.3177174,6.31613 z"
+     id="path4121-4-6-5"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="ccssc" />
+  <path
+     style="opacity:0.41999996;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+     d="m 8.0353418,152.69557 c 8.9452112,-4.69892 12.8040302,-14.72543 12.7320592,-16.85095 1.758874,0.25249 4.335587,3.83076 4.335587,3.83076 -0.07868,0.78593 -1.835084,6.44844 -4.622233,9.50157 -1.983167,2.17243 -5.268932,6.41929 -8.885039,5.90193 -1.32197,-0.18914 -2.1543301,-0.80776 -3.5603742,-2.38331 z"
+     id="path4121-4-6-5-9"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="ccsscc" />
+  <path
+     style="opacity:0.41999996;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+     d="m 10.441003,186.42942 c 3.222707,-1.69289 5.890978,-4.0906 7.895906,-6.56495 3.560116,-4.39366 5.17465,-9.02893 5.128608,-10.38869 1.423297,1.21127 2.90704,4.80317 2.90704,4.80317 0.395896,2.95542 0.537798,6.99081 -2.249351,10.04395 -2.060273,2.25689 -5.592916,3.90658 -9.359327,3.58681 -1.248968,-0.10604 -4.171671,-1.08589 -4.322876,-1.48029 z"
+     id="path4121-4-6-5-9-2"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cscsssc" />
+  <path
+     style="opacity:0.41999996;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+     d="m 13.077671,219.87312 c 8.945211,-4.69892 10.987149,-15.6465 10.915178,-17.77202 1.423298,1.01952 2.379707,4.51894 2.379707,4.51894 -0.07868,0.78593 0.864467,4.39019 -1.055682,8.05118 -0.783125,1.49312 -3.834308,4.50955 -7.291243,5.31355 -1.302673,0.30297 -3.01998,0.17502 -4.94796,-0.11165 z"
+     id="path4121-4-6-5-9-2-5"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="ccsssc" />
+</svg>
Binary file share/hedgewars/Data/Graphics/Hats/Reserved/a1ed4756b565d13aaecb1f2b1a556570alwayss.png has changed
Binary file share/hedgewars/Data/Graphics/Hats/Reserved/chef.png has changed
Binary file share/hedgewars/Data/Graphics/Hedgehog.png has changed
Binary file share/hedgewars/Data/Graphics/Hedgehog/amCleaver.png has changed
Binary file share/hedgewars/Data/Graphics/Hedgehog/amKnife.png has changed
Binary file share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png has changed
Binary file share/hedgewars/Data/Graphics/LandIce.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Cluster_Bomb@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Rope@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Sniper_Rifle.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Bamboo_Thicket.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Dangerous_Ducklings.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Diver.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Newton_and_the_Hammock.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree@2x.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Teamwork.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_That_Sinking_Feeling.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape.png has changed
Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape@2x.png has changed
Binary file share/hedgewars/Data/Graphics/botlevels.png has changed
Binary file share/hedgewars/Data/Graphics/cleaver.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Graphics/cleaver.svg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.1 "
+   width="450"
+   height="470"
+   sodipodi:docname="cleaver.svg">
+  <metadata
+     id="metadata8">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs6">
+    <linearGradient
+       id="linearGradient3767">
+      <stop
+         style="stop-color:#6a6a6a;stop-opacity:1;"
+         offset="0"
+         id="stop3769" />
+      <stop
+         style="stop-color:#dbdbdb;stop-opacity:1;"
+         offset="1"
+         id="stop3771" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3767"
+       id="linearGradient3856"
+       gradientUnits="userSpaceOnUse"
+       x1="183.86975"
+       y1="213.57822"
+       x2="323.47919"
+       y2="103.38492" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3767"
+       id="linearGradient3882"
+       gradientUnits="userSpaceOnUse"
+       x1="183.86975"
+       y1="213.57822"
+       x2="326.20184"
+       y2="120.35856"
+       gradientTransform="matrix(1.0972003,0,0,0.76264827,-18.838734,68.569149)" />
+  </defs>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1242"
+     inkscape:window-height="868"
+     id="namedview4"
+     showgrid="false"
+     inkscape:zoom="2.0085106"
+     inkscape:cx="209.47607"
+     inkscape:cy="261.39935"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg2" />
+  <path
+     sodipodi:nodetypes="cccccssssss"
+     inkscape:connector-curvature="0"
+     style="fill:url(#linearGradient3882);fill-opacity:1;stroke:#222222;stroke-width:5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 225.90551,108.67968 C 182.87572,133.43708 155.21472,164.45472 132.53094,196.82022 195.69872,221.91543 199.95162,252.4674 204.03008,290.30913 255.29581,289.41319 296.87745,280.50855 329.72809,249.74578 324.96182,204.42109 289.52086,128.98334 225.90551,108.67968 z M 225.59692,129.27118 C 228.29612,129.16913 230.95971,129.51441 233.3459,130.39132 240.98173,133.19744 242.87403,140.27073 237.56326,146.16861 232.25249,152.06649 221.74644,154.57543 214.1106,151.76931 206.47477,148.96319 204.61676,141.8899 209.92753,135.99202 213.57868,131.93723 219.65867,129.49572 225.59692,129.27118 z"
+     id="path2987"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     transform="matrix(1.090887,0.40089412,-0.66619266,0.73984055,45.886101,-17.883965)"
+     d="M 233.7647,95.061127 A 12.67399,14.434267 0 1 1 208.41672,95.061127 12.67399,14.434267 0 1 1 233.7647,95.061127 z"
+     sodipodi:ry="14.434267"
+     sodipodi:rx="12.67399"
+     sodipodi:cy="95.061127"
+     sodipodi:cx="221.09071"
+     id="path3779"
+     style="fill:none;stroke:none"
+     sodipodi:type="arc"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:#c6ba88;fill-opacity:1;stroke:#222222;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 203.34878,290.82382 C 202.57349,309.63771 200.72506,324.14058 187.80748,338.35174 188.46168,347.80203 193.86915,347.27331 198.72527,347.90208 234.16583,334.60641 229.03629,309.93407 231.57515,289.00247 z"
+     id="path3761"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="ccccc"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:#c8ac1d;fill-opacity:1;stroke:#222222;stroke-width:3.28770398999999980;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 203.44706,291.39151 203.1569,297.94586 230.81974,297.29852 231.10991,289.04487 z"
+     id="path3809"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="ccccc"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 200.17035,335.78701 C 201.22805,337.23038 202.66678,337.76213 204.2423,337.96662"
+     id="path3817"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cc"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 210.76291,320.56732 C 213.14437,322.15978 215.38854,322.14589 217.58341,321.55533"
+     id="path3817-6"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cc"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 206.01411,328.26521 C 207.84525,329.83412 210.01071,330.27207 212.29617,330.30402"
+     id="path3817-7"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cc"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:#808080;fill-opacity:1;stroke:#333333;stroke-width:1.41000009;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none"
+     d="m 221.79837,113.95961 c -21.75946,13.05498 -41.31898,29.53781 -58.441,48.23222 -9.86016,10.62761 -19.01968,21.91187 -27.24127,33.85597 21.44098,9.1359 43.44539,21.04019 55.91257,41.56455 9.46361,14.98751 11.79385,32.99706 13.97753,50.15453 11.40101,0.37915 22.84258,-1.01125 34.19504,-2.09442 27.93191,-3.21887 55.91365,-11.96932 78.24584,-29.55025 2.88165,-2.3967 6.19261,-4.4927 8.46649,-7.48569 -2.36955,-17.66221 -7.90037,-34.85387 -15.16499,-51.09771 -13.76178,-30.09689 -34.61955,-57.99042 -63.11129,-75.50419 -7.14974,-4.33722 -14.8115,-7.77049 -22.68472,-10.56442 -1.38473,0.8298 -2.76946,1.65961 -4.1542,2.48941 z m 4.96326,13.33388 c 6.92786,-0.18017 15.95374,4.08288 15.69881,12.04251 0.0296,8.58261 -8.66637,13.92682 -16.19669,15.52767 -7.71639,1.69714 -17.98233,-0.11705 -21.28443,-8.2306 -2.60175,-7.96643 4.57224,-15.10751 11.5913,-17.48808 3.24621,-1.22318 6.7144,-1.92242 10.19101,-1.8515 z"
+     id="path3042"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:#999999;fill-opacity:1;stroke:#333333;stroke-width:1.41000009;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none"
+     d="m 184.72177,141.68538 c -7.04816,6.02341 -13.67238,12.70313 -20.10196,19.41737 11.08722,8.12224 21.93196,16.67468 31.78963,26.29896 13.96904,12.81464 23.21706,29.74191 31.57528,46.51558 6.9716,14.36807 9.80641,30.24397 13.18435,45.7279 0.72814,1.68644 -0.0957,4.21026 1.22914,5.49225 8.59993,-1.14295 17.2702,-2.70254 25.57865,-5.1344 -1.48385,-14.7308 -4.63759,-29.31515 -8.27278,-43.6701 -4.34702,-17.04486 -13.37374,-32.42971 -22.6612,-47.20026 -9.84038,-15.31404 -24.25699,-26.89158 -38.2929,-38.16645 -4.57974,-3.12111 -8.74957,-7.30261 -13.93486,-9.29641 l -0.0933,0.0156 z"
+     id="path3076"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:#b3b3b3;fill-opacity:1;stroke:#333333;stroke-width:1.41000009;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none"
+     d="m 225.68807,112.18591 c -5.92512,2.65358 -11.16099,6.91284 -16.71014,10.34659 -8.31649,5.86403 -16.43569,12.06633 -24.00722,18.87282 11.93009,6.55981 22.02037,15.92218 32.24191,24.8031 10.55351,9.24568 19.31488,20.36884 26.04132,32.67108 7.65459,13.14787 14.53726,26.93399 17.7837,41.89983 3.31322,12.94904 5.40772,26.19944 7.37487,39.3793 18.61835,-5.22168 36.65473,-13.40061 51.68631,-25.68757 2.35028,-1.97812 5.55487,-3.83814 6.44134,-6.92366 -1.86457,-11.62675 -4.52164,-23.12372 -8.83705,-34.10578 -5.82729,-16.86203 -14.35358,-32.64948 -24.08535,-47.54676 -2.24209,-3.19836 -5.0169,-6.38514 -7.34901,-9.65397 -7.94085,-9.50331 -16.48873,-18.56881 -26.36039,-26.08192 -7.56515,-5.85454 -15.90196,-10.78183 -24.65164,-14.69016 -3.08288,-1.28523 -6.17749,-3.08293 -9.56865,-3.2829 z m 0.56012,15.18538 c 7.0065,-0.60697 15.54072,3.27911 16.30561,11.03118 0.67466,7.39744 -5.62903,12.89817 -11.97389,15.29716 -7.52887,2.9229 -17.53617,3.01251 -23.42236,-3.25465 -5.23034,-5.67163 -2.26244,-14.80264 3.79634,-18.5772 4.37608,-3.23642 9.91486,-4.54942 15.2943,-4.49649 z"
+     id="path3078"
+     inkscape:connector-curvature="0" />
+  <path
+     inkscape:connector-curvature="0"
+     style="fill:#cfcfcf;fill-opacity:1;stroke:#222222;stroke-width:5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="m 226.64659,108.8491 -20.88109,13.60851 c 5.03759,2.50338 9.79444,5.03962 14.29789,7.60265 4.62109,-1.38342 9.72089,-1.48452 13.95502,0.0715 6.3819,2.34531 8.73636,7.67283 6.24032,12.7982 51.12054,36.60475 58.89197,78.11048 71.42089,119.64044 5.91733,-3.53885 12.72061,-8.19948 18.27524,-13.25101 -6.3498,-50.76394 -37.98674,-117.10181 -103.30827,-140.47028 z"
+     id="path3759-4"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Graphics/hedgewars.svg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="2001.415"
+   height="373.84308"
+   id="svg3761"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="hedgewars.svg">
+  <defs
+     id="defs3763">
+    <linearGradient
+       id="linearGradient3830">
+      <stop
+         style="stop-color:#fde003;stop-opacity:1;"
+         offset="0"
+         id="stop3832" />
+      <stop
+         id="stop3834"
+         offset="0.65004325"
+         style="stop-color:#fde003;stop-opacity:0.82456142;" />
+      <stop
+         style="stop-color:#fde003;stop-opacity:0;"
+         offset="0.81587774"
+         id="stop3836" />
+      <stop
+         style="stop-color:#fde003;stop-opacity:0;"
+         offset="1"
+         id="stop3838" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4510">
+      <stop
+         id="stop4512"
+         offset="0"
+         style="stop-color:#fde003;stop-opacity:1;" />
+      <stop
+         style="stop-color:#fde003;stop-opacity:0.82456142;"
+         offset="0.60000002"
+         id="stop4514" />
+      <stop
+         id="stop4518"
+         offset="0.80000001"
+         style="stop-color:#fde003;stop-opacity:0;" />
+      <stop
+         id="stop4516"
+         offset="1"
+         style="stop-color:#fde003;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient4399">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop4401" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop4403" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4399"
+       id="radialGradient4405"
+       cx="395.95886"
+       cy="670.11121"
+       fx="395.95886"
+       fy="670.11121"
+       r="1000.7524"
+       gradientTransform="matrix(1,0,0,0.18705578,0,544.76303)"
+       gradientUnits="userSpaceOnUse" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4192"
+       id="radialGradient4198"
+       cx="886.33868"
+       cy="1818.9486"
+       fx="886.33868"
+       fy="1818.9486"
+       r="965.06842"
+       gradientTransform="matrix(1.1017484,-0.00284152,8.1448464e-4,0.31579243,-39.372399,335.81069)"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       id="linearGradient4192">
+      <stop
+         style="stop-color:#fde003;stop-opacity:1;"
+         offset="0"
+         id="stop4194" />
+      <stop
+         id="stop4202"
+         offset="0.7631796"
+         style="stop-color:#fde003;stop-opacity:0.7368421;" />
+      <stop
+         style="stop-color:#fde003;stop-opacity:0;"
+         offset="1"
+         id="stop4196" />
+    </linearGradient>
+    <radialGradient
+       r="965.06842"
+       fy="1818.9486"
+       fx="886.33868"
+       cy="1818.9486"
+       cx="886.33868"
+       gradientTransform="matrix(1.1017484,-0.00284152,8.1448464e-4,0.31579243,-581.77533,968.26906)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient4423"
+       xlink:href="#linearGradient4192"
+       inkscape:collect="always" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4510"
+       id="radialGradient4508"
+       cx="301.59787"
+       cy="1603.1143"
+       fx="301.59787"
+       fy="1603.1143"
+       r="965.37823"
+       gradientTransform="matrix(1.3744339,0.00122796,-2.847412e-4,0.31870592,-111.92506,298.79849)"
+       gradientUnits="userSpaceOnUse" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4510"
+       id="radialGradient4528"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3744339,0.00122796,-2.847412e-4,0.31870592,-111.92506,298.79849)"
+       cx="301.59787"
+       cy="1603.1143"
+       fx="301.59787"
+       fy="1603.1143"
+       r="965.37823" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4510"
+       id="radialGradient3041"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3744339,0.00122796,-2.847412e-4,0.31870592,-2055.4585,448.30107)"
+       cx="301.59787"
+       cy="1603.1143"
+       fx="301.59787"
+       fy="1603.1143"
+       r="965.37823" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3830"
+       id="radialGradient3824"
+       cx="396.08008"
+       cy="1707.7947"
+       fx="396.08008"
+       fy="1707.7947"
+       r="970.50092"
+       gradientTransform="matrix(1.5350005,-0.00416341,0.001041,0.38380416,-213.68086,198.07079)"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="584.24342"
+     inkscape:cy="246.47842"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:window-width="1896"
+     inkscape:window-height="1026"
+     inkscape:window-x="24"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       orientation="1,0"
+       position="1000.051,282.84271"
+       id="guide3828" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata3766">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(603.97091,-479.69834)">
+    <path
+       inkscape:connector-curvature="0"
+       id="path3855"
+       d="M -526.00534,852.17056 C -542.67082,849.40463 -557.25422,840.6511 -571.77866,824.6956 -586.81864,808.17377 -586.25533,809.35375 -589.41486,787.75241 -590.93931,777.32988 -592.62117,765.87736 -593.15232,762.30236 -594.7215,751.74067 -600.02194,704.16746 -601.67568,685.80236 -611.83628,572.96688 -588.11991,515.67793 -533.36375,520.78899 -519.70323,522.06409 -506.51659,528.94492 -495.14848,540.72984 -491.15748,544.86717 -490.36779,544.99251 -485.12939,542.32008 -481.5908,540.51483 -481.14202,539.82273 -480.10409,534.57008 -474.25647,504.9771 -469.61911,499.08506 -442.09465,486.27681 -425.06997,478.35453 -415.61338,477.84565 -387.98533,483.3651 -345.06294,491.93999 -316.12855,526.46216 -256.86911,639.80236 -241.56375,669.07553 -230.03939,693.35993 -229.04826,698.42704 -228.52377,701.10847 -227.64465,705.58669 -227.09465,708.37865 -221.2129,738.23614 -232.5079,769.55771 -258.54663,795.59644 -280.02203,817.07185 -331.19847,773.8821 -376.71712,695.86784 -381.04976,688.44215 -385.10108,682.16277 -385.72006,681.91366 -386.91415,681.43311 -415.04112,689.99475 -416.38654,691.24831 -416.82208,691.65412 -414.92428,698.59926 -412.16921,706.68197 -392.2035,765.25648 -410.86654,807.73811 -473.79646,846.96061 -483.32508,852.89954 -507.23612,855.28563 -526.00534,852.17056 z M -519.76126,810.23954 C -472.06262,798.19128 -456.71329,757.21383 -477.64456,697.80236 -479.19473,693.40236 -481.10058,688.79953 -481.87978,687.57384 -485.18034,682.38208 -468.68638,666.27399 -445.78887,652.32727 -436.98309,646.96373 -436.98309,646.96373 -422.28887,648.21574 -390.5073,650.92367 -383.33168,651.31496 -376.46907,650.71434 -368.06769,649.97904 -369.04944,648.89183 -364.48387,663.98692 -354.45356,697.14999 -326.11079,737.33898 -301.91525,752.70689 -298.2847,755.01285 -288.90783,746.33723 -281.43455,733.75783 -271.36461,716.80762 -271.46294,703.74609 -281.81062,683.80236 -285.54208,676.61047 -313.45502,630.72863 -325.61295,611.80236 -327.37951,609.05236 -333.69276,599.15236 -339.64241,589.80236 -350.49732,572.74363 -354.87266,565.98984 -377.86466,530.80236 -394.18536,505.82479 -393.14876,507.15799 -397.39054,505.68945 -403.56278,503.55257 -414.237,502.46547 -420.03985,503.38278 -430.21674,504.99153 -450.09465,516.66537 -450.09465,521.03327 -450.09465,524.11139 -444.42413,542.99583 -442.65711,545.80236 -441.96455,546.90236 -440.81888,549.60236 -440.11119,551.80236 -436.44073,563.21275 -418.82479,592.96174 -407.51976,606.84126 -400.93253,614.92861 -399.66235,614.60686 -441.34936,615.41062 -475.62065,616.0714 -483.78177,616.70683 -490.40975,619.23049 -491.95805,619.82002 -493.59947,620.30236 -494.05733,620.30236 -495.13309,620.30236 -501.29083,607.40738 -503.60794,600.30236 -504.59446,597.27736 -506.68255,592.27169 -508.24813,589.17866 -509.81372,586.08562 -511.09465,583.25837 -511.09465,582.89589 -511.09465,575.338 -527.13101,554.11618 -535.96652,549.98155 -575.77822,531.3514 -586.36837,580.89469 -569.48784,706.80236 -562.23117,760.92808 -562.33339,760.12618 -560.11827,780.30236 -557.75635,801.81554 -557.02721,803.70879 -549.25351,808.51319 -542.38794,812.75635 -532.10759,813.35812 -519.76126,810.23954 z M 1210.4054,832.30456 C 1116.1837,828.09124 1041.8426,795.58315 1020.807,749.39647 1012.8957,732.02633 1012.3721,726.02752 1018.1005,718.39323 1046.4965,680.54897 1069.314,660.67853 1093.968,652.32433 1099.9981,650.28096 1105.1865,648.35452 1105.4977,648.04336 1105.8088,647.73219 1103.4059,644.17567 1100.1577,640.13998 1086.0293,622.58636 1075.944,602.614 1077.2244,594.72394 1080.7321,573.10883 1136.1552,539.89827 1191.4054,526.30459 1241.6923,513.93209 1325.8193,513.24638 1341.8341,525.07846 1353.0461,533.36205 1380.6749,596.7986 1390.276,636.30236 1392.623,645.95901 1396.5945,664.23093 1397.3503,668.84936 1399.0439,679.19844 1377.5583,691.29555 1353.8805,693.32426 1325.0128,695.79764 1325.4649,692.81016 1348.3716,729.72643 1382.3014,784.40769 1381.3118,796.79421 1341.4054,816.91963 1312.5316,831.48115 1279.2914,835.38495 1210.4054,832.30456 z M 1298.1862,780.94315 C 1328.8474,773.00141 1337.6385,752.73826 1322.7984,724.21349 1316.4507,712.01252 1289.7252,686.30236 1283.39,686.30236 1283.0183,686.30236 1281.4681,685.41508 1279.9451,684.33062 1277.2108,682.38364 1264.1424,674.68648 1226.4054,652.7964 1196.3875,635.38389 1182.218,622.36287 1180.3111,610.43825 1178.7317,600.56092 1181.999,598.74424 1199.8163,599.59343 1210.4536,600.10042 1215.3018,600.87478 1229.4054,604.31941 1241.9422,607.38137 1312.733,631.88085 1317.175,634.69493 1321.5923,637.49346 1345.1958,645.41194 1346.1817,644.42609 1354.2253,636.38242 1347.5868,591.96339 1334.2567,564.63503 1327.1391,550.04304 1328.0119,550.48382 1299.9054,547.28729 1223.3574,538.58154 1182.4003,547.7028 1125.9054,586.03759 1113.8368,594.22678 1112.9054,595.3211 1112.9054,601.3116 1112.9054,614.76685 1126.5358,628.86461 1154.72,644.56001 1166.7357,651.25129 1178.1186,657.61866 1185.9054,662.00437 1187.8304,663.08858 1192.1054,665.47431 1195.4054,667.306 1256.7889,701.3773 1268.3903,723.87765 1219.4054,713.85335 1193.9568,708.64554 1189.4148,707.45219 1152.4054,696.24972 1087.537,676.61463 1101.5825,672.32526 1060.5481,724.30236 1043.7626,745.56393 1043.7001,745.72529 1051.6554,747.28966 1054.8178,747.91156 1061.6804,749.48054 1066.9054,750.77627 1080.2963,754.09707 1096.7066,757.88199 1108.4054,760.34799 1113.9054,761.50734 1123.5804,763.56319 1129.9054,764.91654 1173.061,774.15053 1201.9299,778.8943 1243.9054,783.64915 1256.1258,785.03345 1288.6553,783.41179 1298.1862,780.94315 z M 954.5461,755.05236 C 953.1872,753.81486 947.172,745.15236 941.1792,735.80236 922.6331,706.86715 922.8713,707.10761 920.8994,715.32701 917.832,728.11359 886.0111,738.59672 864.4054,733.93849 841.0732,728.90805 831.2058,711.68824 836.2816,684.85951 839.8449,666.02656 839.8468,666.0259 818.9736,690.6944 797.2581,716.35841 795.2594,717.39398 788.9857,706.23146 787.6666,703.88463 784.5621,699.00301 782.0866,695.38342 779.6112,691.76384 776.8175,687.67736 775.8785,686.30236 774.9396,684.92736 771.5818,679.86486 768.4168,675.05236 762.0329,665.34537 762.0741,665.36342 753.1638,668.37246 744.631,671.25403 744.6947,671.13074 740.8151,692.30236 737.4269,710.79331 737.2091,710.94965 718.3133,708.46703 704.8045,706.6922 649.10415,657.44987 648.94615,647.14241 648.89375,643.72507 678.4188,604.12452 717.784,554.81373 741.8382,524.68215 740.9777,525.06058 753.0558,539.30236 756.0877,542.87736 759.8817,547.67304 761.4869,549.95942 763.0921,552.2458 767.1054,557.50179 770.4054,561.63938 773.7054,565.77697 779.7804,573.7011 783.9054,579.24855 788.0304,584.79601 794.7804,593.81879 798.9054,599.29917 803.0304,604.77956 809.7804,613.95675 813.9054,619.69292 818.0304,625.4291 824.3304,634.1794 827.9054,639.13803 831.4804,644.09667 835.6778,650.04224 837.233,652.35042 841.0502,658.01575 841.1878,657.71283 845.3852,634.41114 849.0582,614.01991 849.0582,614.01991 845.9525,609.91114 837.6242,598.89303 837.403,598.39827 837.4412,590.87122 837.5939,560.74111 892.4053,550.57744 949.8343,570.03016 1003.6186,588.24836 1027.1084,645.26977 989.9281,667.35818 981.1611,672.56653 980.941,671.48049 993.4,684.48246 1010.0407,701.84846 1015.9833,714.44964 1011.5631,722.99734 1002.6408,740.25126 962.855,762.61883 954.5461,755.05236 z M 965.3061,718.82443 C 983.339,706.8549 986.7023,702.06845 981.3347,696.01309 973.6587,687.35346 957.1605,669.51508 949.1716,661.23729 939.8106,651.53783 939.1331,649.67248 944.6554,648.80159 958.2942,646.65066 961.8968,645.85955 965.8929,644.13795 982.1157,637.14902 981.9664,616.34233 965.5659,598.54988 935.1433,565.54526 835.0179,570.06868 860.1644,603.31167 861.947,605.66814 864.0061,608.40497 864.7403,609.39349 865.8756,610.92195 865.5226,614.15365 862.3809,630.99659 860.3491,641.88976 858.3004,654.62736 857.8283,659.30236 857.3562,663.97736 855.8329,673.65236 854.4432,680.80236 850.874,699.16432 850.9712,701.01407 855.6058,702.95053 861.8013,705.53916 872.1238,704.92098 882.4503,701.34289 895.2403,696.91126 894.4054,698.81959 894.4054,674.01647 894.4054,643.9149 896.72,640.77994 907.5791,656.17398 910.1508,659.81959 913.6387,664.44016 915.3301,666.44192 917.0215,668.44367 920.4304,672.87008 922.9054,676.27837 925.3803,679.68666 929.9745,685.92386 933.1145,690.13881 936.2546,694.35376 940.2602,699.82736 942.016,702.30236 958.5037,725.54443 956.8981,724.40539 965.3061,718.82443 z M 916.4054,638.6616 C 892.1047,637.2995 870.8151,617.90836 889.1554,613.84154 917.4074,607.57686 957.9054,612.87894 957.9054,622.84243 957.9054,629.59073 930.3691,642.0372 921.9054,639.11452 921.6303,639.01956 919.1554,638.81575 916.4054,638.6616 z M 716.9252,678.05236 C 716.9418,677.00532 717.7592,671.21419 719.3601,660.80236 719.5292,659.70236 720.2378,654.75236 720.9347,649.80236 722.5361,638.429 722.2475,638.72029 732.6535,637.97686 737.467,637.63296 746.9054,636.63617 753.6276,635.76178 769.0543,633.75517 767.0719,632.12842 779.7667,657.21147 792.4727,682.3166 790.6308,681.21589 799.1634,668.80236 815.8477,644.52976 815.3939,647.83467 804.0851,632.95729 801.6415,629.7425 798.0557,624.7925 796.1168,621.95729 792.4254,616.55979 786.4884,608.03931 781.4054,600.84433 777.9318,595.92754 768.66,583.29343 762.5977,575.21661 760.292,572.14445 756.9308,567.64445 755.1285,565.21661 740.8358,545.96274 741.3982,546.34614 736.6651,552.63021 721.4787,572.79294 687.1284,618.96833 681.9053,626.24126 678.3303,631.21929 673.5049,637.882 671.18195,641.04729 665.67565,648.55067 665.77215,649.08728 673.4749,653.80236 677.069,656.00236 681.7647,658.92736 683.9098,660.30236 686.0549,661.67736 691.094,664.7947 695.1077,667.22978 699.1215,669.66486 705.1016,673.37736 708.3971,675.47978 714.6619,679.47666 716.892,680.14938 716.9252,678.05236 z M 726.5004,620.45605 C 725.9055,619.49347 726.9775,613.02697 729.427,602.80236 730.3493,598.95236 731.4858,594.00236 731.9525,591.80236 735.6299,574.46849 734.5389,575.10494 743.5232,585.05236 759.8617,603.14217 763.8983,608.18874 762.6474,608.9618 761.1077,609.91331 728.413,621.30236 727.2209,621.30236 727.1122,621.30236 726.7881,620.92152 726.5004,620.45605 z M -193.86952,748.84812 C -224.39672,741.88974 -232.51811,712.5672 -208.59359,695.68634 -205.59465,693.57032 -205.59465,693.57032 -207.92918,685.18634 -209.21318,680.57515 -212.65493,667.80236 -215.57753,656.80236 -224.75901,622.24531 -224.38381,623.16594 -230.38607,620.46667 -251.2816,611.06975 -245.00496,585.95653 -219.23688,575.8581 -207.1941,571.13857 -201.64916,570.18118 -149.09465,563.74739 -112.45457,559.26186 -93.02802,562.23256 -76.17996,574.89748 -69.81685,579.68072 -69.81685,579.68072 -67.49107,576.74154 -60.86959,568.37372 -59.14452,566.68651 -53.10287,562.66908 -32.41343,548.91153 11.22468,543.36062 41.40535,550.64733 70.34809,557.63515 95.42737,573.93125 109.74354,595.05236 115.07087,602.91195 114.78454,602.9755 120.56316,592.65076 135.2687,566.37618 166.39985,541.97543 216.05791,517.80151 233.78796,509.17038 231.09178,508.72792 248.90535,523.19199 294.74505,560.41242 300.90535,566.31951 300.90535,573.05461 300.90535,586.62243 288.91328,594.27713 267.62397,594.29855 262.51501,594.3037 261.87945,596.4312 265.59118,601.10321 283.30767,623.40324 295.65191,643.96947 294.45345,649.18946 286.65235,683.16773 249.56664,699.87539 225.06893,680.44821 217.84528,674.7197 218.01261,674.74161 211.51731,678.67381 192.40469,690.24441 156.28172,681.60767 131.54891,659.55395 127.04836,655.5409 126.75149,655.7254 123.90818,664.30236 114.1686,693.68215 89.05454,710.76961 52.06871,713.18151 44.97253,713.64427 38.73602,714.28898 38.20978,714.61421 23.2553,723.85659 -24.03071,718.25714 -38.13814,705.57335 -43.35032,700.88715 -43.41923,700.9058 -44.52859,707.30236 -46.65378,719.55623 -62.28655,729.59481 -86.59465,734.31508 -89.89465,734.95589 -106.76965,738.63645 -124.09465,742.49409 -159.53516,750.38539 -179.24931,752.18065 -193.86952,748.84812 z M -173.59465,723.89248 C -155.46102,719.52718 -97.44353,707.36495 -82.32675,704.75995 -70.27585,702.68328 -70.60622,704.58186 -79.15851,686.55236 -82.75022,678.98052 -85.53734,674.30236 -86.45674,674.30236 -87.89042,674.30236 -117.20022,684.28937 -131.59032,689.68117 -142.48325,693.76262 -144.15294,692.08183 -147.19596,673.97182 -148.80064,664.42181 -150.49784,665.52178 -124.59311,659.32272 -104.85534,654.59943 -103.21416,651.40993 -112.93279,636.6618 -125.64713,617.36766 -128.6826,616.28479 -140.97897,626.65661 -153.92262,637.57441 -164.07573,644.72128 -165.13602,643.66099 -166.15475,642.64226 -171.09465,621.64248 -171.09465,618.33051 -171.09465,615.65375 -173.74602,616.40724 -136.09465,608.38393 -96.22882,599.88873 -94.46198,599.45962 -93.27967,597.98569 -82.39285,584.41357 -105.56445,576.35213 -142.59465,580.82892 -194.27062,587.07632 -197.84023,587.69406 -208.67226,592.26401 -222.91295,598.27204 -225.13111,604.15561 -214.36076,607.35255 -208.08953,609.21402 -207.45763,610.42892 -203.1657,628.87605 -200.99976,638.18552 -196.2727,658.4834 -192.66113,673.98246 -184.63987,708.40576 -184.58313,704.79827 -193.1765,706.75279 -204.69724,709.37312 -207.69337,712.92815 -205.07289,720.86828 -203.02747,727.06598 -191.41281,728.18183 -173.59465,723.89248 z M 5.90535,689.40338 C 11.68035,688.39351 18.20535,687.09446 20.40535,686.5166 27.55236,684.63933 39.2669,682.39673 45.40535,681.73067 74.98536,678.52105 89.06295,667.99129 94.2499,645.19591 98.06558,628.42689 97.32419,623.22664 88.63359,605.80236 71.01205,570.4719 46.91521,559.98814 -8.09465,563.71902 -44.15633,566.16479 -55.82079,573.93088 -57.7523,596.78062 -58.91454,610.52984 -56.38636,612.73562 -40.33577,611.97623 -21.08759,611.06555 -17.27381,616.21074 -16.83227,643.685 -16.59465,658.47065 -16.59465,658.47065 -23.88564,665.13651 -44.06367,683.58447 -29.35139,695.56867 5.90535,689.40338 z M 20.3979,664.2903 C 19.99048,663.63109 19.45063,661.45162 19.19822,659.44704 18.94582,657.44247 16.97008,643.90645 14.80768,629.36701 12.64529,614.82756 11.22015,602.62869 11.6407,602.2584 13.46513,600.65205 27.97983,599.60567 37.40574,600.40097 74.37647,603.52034 90.59622,651.00812 58.40535,661.88308 49.33085,664.9487 21.87935,666.68735 20.3979,664.2903 z M 54.45326,646.84679 C 61.28228,643.99344 58.96505,627.61037 51.46626,625.72829 45.85261,624.31936 45.38011,625.06396 45.68975,634.83126 46.14999,649.34909 46.69055,650.09025 54.45326,646.84679 z M -50.67747,674.05236 C -50.48255,673.36486 -49.80953,670.90964 -49.18188,668.59631 -48.5111,666.12399 -44.75424,660.01114 -40.06768,653.76642 -27.89312,637.54414 -28.87982,634.37443 -48.59465,626.37418 -52.99465,624.58866 -59.68054,621.31822 -63.45219,619.10653 -70.30974,615.08526 -70.30974,615.08526 -73.20548,617.22618 -80.38761,622.53615 -83.44545,624.20744 -88.21533,625.42993 -94.13524,626.94715 -94.60833,627.68098 -93.15238,633.08795 -92.21949,636.55245 -91.61676,637.16943 -88.61505,637.73255 -81.20966,639.12182 -78.27825,643.41713 -75.63242,656.75566 -73.98779,665.04683 -73.16932,666.26162 -69.21067,666.28705 -64.57966,666.31679 -59.17648,668.62271 -55.95873,671.9426 -52.46824,675.54387 -51.23952,676.03472 -50.67747,674.05236 z M 238.02726,661.31836 C 248.37897,656.91332 265.00082,641.31269 264.8728,636.12218 264.69799,629.03482 240.87485,591.77782 236.32858,591.48189 222.08965,590.55503 219.90535,592.34475 219.90535,604.93841 219.90535,619.80938 215.80124,626.74046 203.19519,633.15878 191.51369,639.10635 175.01289,628.79655 165.49267,609.60202 162.87029,604.31481 163.48162,602.9299 172.40242,593.94865 190.58397,575.6439 205.39494,570.51127 246.65001,568.21871 259.43457,567.50827 270.43559,566.59269 271.09671,566.18409 272.86924,565.08861 246.95261,541.84412 233.78274,532.71739 229.41947,529.69365 229.14377,529.74881 212.90535,536.89431 164.5838,558.15759 135.05389,588.24759 132.37555,618.95151 129.89194,647.42318 168.748,668.46091 197.01533,653.94925 221.33136,641.46608 221.90535,641.27328 221.90535,645.58885 221.90535,651.43591 227.86337,664.30236 230.57095,664.30236 230.81516,664.30236 234.17051,662.95956 238.02726,661.31836 z M 200.28489,618.32282 C 202.46935,616.13836 201.55531,608.82359 199.05364,608.46948 192.67635,607.56679 189.91681,611.95673 192.54926,618.81679 193.23195,620.59585 198.33791,620.2698 200.28489,618.32282 z M 384.40535,688.30227 C 348.29379,687.54501 345.81972,687.28015 331.90829,682.68238 300.34129,672.24937 294.2042,641.37678 320.77832,626.69312 327.29526,623.09215 326.82347,627.02397 325.08489,590.80236 323.16571,550.81797 323.49995,552.64353 316.93737,546.30236 310.87482,540.44435 309.90535,538.07657 309.90535,529.1277 309.90535,508.42146 328.90334,502.60252 383.90535,506.46206 434.29385,509.99786 457.23815,515.70428 471.07035,528.14065 475.68385,532.28858 476.18145,532.49672 478.70545,531.33444 521.65355,511.55678 535.35155,508.48736 545.11375,516.45376 568.19415,535.28825 569.14355,537.01449 567.71485,557.55089 566.42535,576.08707 566.42245,576.06954 571.37945,579.85044 576.15135,583.4901 577.01975,582.47742 578.03165,572.09316 578.47605,567.53322 579.53265,558.62736 580.37975,552.30236 581.22695,545.97736 582.32965,536.761 582.83035,531.82157 585.04635,509.95982 619.39755,515.19656 655.42675,542.88867 672.27695,555.83971 672.82175,557.24286 666.92535,572.50235 664.73635,578.16736 658.60785,594.27736 653.30645,608.30236 628.74495,673.28019 610.59835,694.59801 593.63185,678.4055 584.42645,669.62005 567.06715,654.74851 564.23195,653.21893 562.00025,652.01493 561.31685,652.42538 539.53785,668.04966 537.81495,669.28567 534.97945,671.31067 533.23665,672.54966 531.49395,673.78864 526.25135,677.57496 521.58665,680.96369 509.50615,689.73961 509.84445,689.60995 503.41005,687.92971 496.83865,686.21366 491.04935,682.95278 484.80565,677.45049 480.20595,673.39699 480.20595,673.39699 476.96645,676.73928 465.74475,688.31718 454.15545,689.76495 384.40535,688.30227 z M 501.96095,661.78274 C 504.32985,660.94695 507.86585,659.03445 509.81865,657.53274 511.77155,656.03103 515.02815,653.67736 517.05555,652.30236 519.08305,650.92736 525.98135,645.30236 532.38525,639.80236 558.46225,617.40593 556.39575,617.37399 578.18265,640.51016 591.05485,654.17951 595.92505,657.75435 598.29795,655.27517 599.85955,653.64376 611.90535,630.3644 611.90535,628.97811 611.90535,628.49769 612.55225,626.68661 613.34285,624.95349 616.42855,618.18955 624.32035,597.56653 629.85555,581.80236 630.82115,579.05236 633.70235,571.26868 636.25825,564.50529 641.92435,549.51172 642.10225,551.41358 634.65535,547.37219 631.21785,545.50669 627.28035,543.21643 625.90535,542.28274 612.81775,533.39558 598.61895,531.89039 597.79085,539.30236 597.45285,542.32736 596.68675,548.40236 596.08855,552.80236 594.07385,567.61881 592.68255,578.73486 591.26955,591.30236 588.09425,619.54556 589.23255,618.41377 576.21885,606.26688 559.84825,590.98667 556.60585,590.35043 544.65325,600.07285 529.80255,612.15268 524.14845,613.88852 525.23445,606.03461 525.94585,600.88947 528.61105,582.21127 529.90505,573.30236 531.21175,564.30592 533.89565,545.02023 534.84555,537.80236 536.57435,524.66559 526.67805,524.01732 499.17045,535.4654 487.93175,540.14273 486.67725,552.47243 495.01535,576.30236 501.61265,595.15695 501.48325,602.18473 494.03945,629.30236 488.52315,649.39839 488.73115,648.14605 489.94155,653.97656 491.77595,662.81307 494.33325,664.47394 501.96095,661.78274 z M 389.90535,659.87427 C 396.23035,659.91382 413.33035,660.13882 427.90535,660.37427 454.40535,660.80236 454.40535,660.80236 454.09585,657.30236 453.76375,653.54679 448.21195,631.27562 447.40725,630.47095 446.61605,629.67975 413.23415,633.28524 402.19275,635.35444 387.45385,638.11658 387.53775,638.20346 387.76045,620.39563 387.93195,606.68014 384.80955,608.68035 407.84765,607.52796 434.80965,606.1793 435.85475,605.104 428.26775,586.51694 420.45895,567.38664 416.50605,564.54803 406.07365,570.5794 399.46735,574.39874 378.43715,584.30236 376.93315,584.30236 376.27665,584.30236 375.90535,579.06379 375.90535,569.80236 375.90535,555.30236 375.90535,555.30236 414.47105,555.30236 461.47445,555.30236 459.18895,556.28729 455.36695,537.67895 453.61035,529.12654 364.07295,519.17421 340.29557,524.88846 328.90844,527.62504 327.60064,533.19298 337.09204,538.52744 342.15776,541.37454 341.76754,537.84243 342.86924,590.8193 343.99685,645.04228 344.91796,640.30236 333.25318,640.30236 320.42064,640.30236 316.09019,654.03658 327.40535,658.84897 330.38511,660.11627 355.89507,661.09724 367.90535,660.40636 373.68035,660.07416 383.58035,659.83472 389.90535,659.87427 z M 479.15335,627.05612 C 483.82675,618.05076 483.52905,602.55633 478.30305,582.80236 476.17035,574.74047 475.91275,574.59123 469.42985,577.66074 463.22725,580.59752 457.07885,582.24088 452.15535,582.27791 446.80585,582.31815 447.17945,591.29132 452.64215,593.97 459.32515,597.24702 460.90535,600.95754 460.90535,613.37269 460.90535,624.14726 460.90535,624.14726 464.65535,625.37355 466.71785,626.04801 469.97495,627.65971 471.89335,628.9551 476.13945,631.82226 476.76485,631.65868 479.15335,627.05612 z"
+       style="fill:#70778f" />
+    <path
+       style="fill:#fe8902;fill-opacity:1"
+       d="M -544.27593,815.15562 C -554.52457,812.75752 -561.81921,805.22882 -562.72896,796.11042 -564.74585,775.89532 -568.08732,750.60342 -569.90236,741.81402 -571.36304,734.74072 -572.1632,729.20122 -574.74138,708.31402 -575.5221,701.98902 -576.62818,693.88903 -577.19933,690.31403 -578.45487,682.45537 -580.90982,656.9568 -582.25394,637.81403 -587.57342,562.05449 -568.11115,525.23519 -531.81168,542.38587 -523.32213,546.39699 -515.72072,554.89627 -509.8569,566.93393 -500.33927,586.4724 -496.4382,595.04125 -494.88784,599.81403 -491.75176,609.46851 -491.44175,609.62832 -478.24708,608.39237 -471.95553,607.80304 -455.47196,607.31933 -441.61692,607.31745 -412.61149,607.31351 -413.6706,607.77009 -420.30332,598.12929 -423.07135,594.1059 -426.88742,588.48758 -428.78348,585.64413 -432.90381,579.46504 -443.89098,557.05307 -444.878,552.81403 -445.26218,551.16403 -446.14151,549.13903 -446.83206,548.31403 -448.4472,546.38442 -455.3079,524.31516 -455.3079,521.04925 -455.3079,513.42223 -451.94871,509.05147 -442.3079,504.13446 -440.9329,503.43318 -438.18943,501.87463 -436.21131,500.67102 -421.5056,491.72315 -384.3079,495.25311 -384.3079,505.59651 -384.3079,506.09608 -381.8329,510.09776 -378.8079,514.48915 -375.7829,518.88054 -373.3079,522.81787 -373.3079,523.23877 -373.3079,523.65968 -372.4079,524.81854 -371.3079,525.81403 -370.2079,526.80952 -369.29789,528.11676 -369.28566,528.71902 -369.27343,529.32127 -368.34938,530.93903 -367.2322,532.31403 -364.26375,535.96756 -344.22512,565.96802 -340.84841,571.81403 -339.25999,574.56403 -336.23856,579.10492 -334.13413,581.9049 -332.02971,584.70488 -330.3079,587.46228 -330.3079,588.03245 -330.3079,588.60263 -329.58602,589.66825 -328.70372,590.40049 -327.82143,591.13273 -326.70421,592.65033 -326.22102,593.77293 -325.73783,594.89554 -324.3222,597.40293 -323.07519,599.34492 -321.82818,601.28691 -319.9079,604.37205 -318.8079,606.20079 -317.7079,608.02952 -312.96077,615.44062 -308.25872,622.6699 -303.55667,629.89917 -299.40159,636.48903 -299.0252,637.31403 -298.64882,638.13903 -296.87095,641.31195 -295.07438,644.36496 -293.27782,647.41796 -290.4579,652.29494 -288.8079,655.20267 -287.1579,658.11041 -284.1373,663.26249 -282.09545,666.65175 -278.41516,672.76064 -274.0651,681.24467 -270.80678,688.66831 -264.47527,703.09382 -267.29834,723.82762 -277.69062,739.22602 -291.59242,759.82452 -298.65666,761.88482 -312.84628,749.47902 -326.47639,737.56242 -349.3079,711.44932 -349.3079,707.77682 -349.3079,707.37862 -350.8829,704.86062 -352.8079,702.18112 -354.7329,699.50172 -356.3079,696.93122 -356.3079,696.46902 -356.3079,696.00682 -357.42723,693.64532 -358.7953,691.22131 -360.16337,688.79731 -361.78909,685.68903 -362.40801,684.31403 -363.02693,682.93903 -364.2218,680.51092 -365.06328,678.91822 -365.90476,677.32552 -367.86135,671.79867 -369.41126,666.63633 -370.96117,661.47398 -372.45948,656.87778 -372.74084,656.42254 -373.0222,655.96729 -380.57738,655.27647 -389.53015,654.88737 -398.48291,654.49827 -408.9579,653.7618 -412.8079,653.25076 -433.57242,650.49452 -444.12742,654.62428 -464.80261,673.59427 -474.04761,682.07678 -474.04071,682.05073 -470.33814,694.50308 -468.65193,700.17412 -466.60317,707.06402 -465.78535,709.81402 -458.36136,734.77782 -461.91135,768.95712 -473.78634,786.84752 -486.69937,806.30182 -521.8264,820.40852 -544.27593,815.15562 z M 1230.1923,785.86832 C 1213.6939,784.22972 1202.3195,782.71132 1192.1923,780.79562 1187.7923,779.96332 1177.6673,778.16712 1169.6923,776.80412 1161.7173,775.44122 1153.1673,773.87212 1150.6923,773.31742 1146.5168,772.38162 1142.1401,771.49332 1130.6923,769.25812 1128.2173,768.77492 1123.0423,767.64512 1119.1923,766.74752 1115.3423,765.84992 1110.3923,764.75472 1108.1923,764.31382 1095.0569,761.68122 1091.5391,760.88592 1085.5371,759.19212 1081.8767,758.15922 1077.8267,757.30732 1076.5371,757.29902 1075.2474,757.29072 1070.5923,756.16582 1066.1923,754.79912 1061.7923,753.43252 1057.0673,752.30942 1055.6923,752.30332 1052.5131,752.28942 1043.8344,749.67682 1042.0512,748.19702 1039.2771,745.89462 1040.4043,739.00882 1044.4423,733.58982 1050.3532,725.65742 1069.3376,701.54942 1076.0697,693.42655 1096.122,669.23164 1092.9534,670.37659 1119.2659,677.81842 1140.461,683.81293 1144.9834,685.2016 1172.6923,694.2236 1177.9173,695.92482 1183.1344,697.31612 1184.2857,697.31542 1185.4371,697.31462 1189.0371,698.23182 1192.2857,699.35362 1195.5344,700.47542 1202.2423,702.03182 1207.1923,702.81222 1212.1423,703.59272 1219.7923,704.90112 1224.1923,705.71972 1233.5022,707.45172 1240.6923,707.72592 1240.6923,706.34882 1240.6923,703.51522 1224.0016,689.46208 1213.493,683.44772 1211.6776,682.40873 1207.2673,679.86091 1203.6923,677.78589 1196.2415,673.46127 1190.7397,670.37081 1183.9529,666.69786 1181.3346,665.28087 1178.7423,663.77001 1178.1923,663.3404 1177.6423,662.9108 1173.8173,660.77116 1169.6923,658.58564 1162.1001,654.56315 1158.4499,652.53812 1141.9722,643.20747 1116.0958,628.55474 1104.4749,610.65116 1108.3298,591.37674 1109.1382,587.33443 1136.9327,567.0654 1146.3364,563.66055 1147.3572,563.29097 1149.318,562.2108 1150.6938,561.26019 1184.0861,538.18766 1248.0177,530.87937 1319.8739,541.9205 1343.9601,545.62149 1369.1953,627.77648 1352.4775,648.06403 1349.6145,651.5383 1330.313,646.53962 1311.1923,637.37206 1302.3833,633.14855 1237.4573,610.91209 1226.1923,608.26049 1171.7714,595.45072 1174.8897,611.20222 1233.7374,646.37357 1241.9648,651.29082 1248.8874,655.31403 1249.1209,655.31403 1249.3544,655.31403 1253.2116,657.56403 1257.6923,660.31403 1262.173,663.06403 1266.0232,665.31403 1266.2481,665.31403 1266.473,665.31403 1269.5979,667.11403 1273.1923,669.31403 1276.7867,671.51403 1280.0146,673.31403 1280.3655,673.31403 1280.7164,673.31403 1282.4785,674.43903 1284.2812,675.81403 1286.0839,677.18903 1287.8439,678.31403 1288.1923,678.31403 1288.5407,678.31403 1290.3007,679.43903 1292.1034,680.81403 1293.9061,682.18903 1295.68,683.31403 1296.0453,683.31403 1298.5268,683.31403 1316.9098,699.94392 1323.3812,708.04302 1335.3688,723.04562 1340.8099,754.24452 1333.0342,763.39282 1332.2961,764.26112 1331.6923,765.45342 1331.6923,766.04242 1331.6923,767.84032 1321.1635,776.85802 1315.774,779.67612 1302.7416,786.49062 1264.3945,789.26512 1230.1923,785.86832 z M -203.8555,728.90832 C -216.83027,723.25672 -212.70609,702.54302 -198.05897,699.79512 -196.03507,699.41542 -193.91188,698.54182 -193.34076,697.85362 -192.31039,696.61212 -201.86643,652.08895 -204.40276,646.31403 -205.00665,644.93903 -205.8674,641.78903 -206.31553,639.31403 -207.51491,632.68995 -211.16589,618.15086 -212.26849,615.60789 -212.7946,614.39452 -215.38119,612.43166 -218.01648,611.24599 -230.5486,605.60752 -229.49256,591.82062 -216.08375,586.01375 -209.07322,582.97774 -207.03388,582.28636 -199.05716,580.24141 -194.52007,579.07825 -183.3829,577.2725 -174.3079,576.22863 -165.2329,575.18475 -149.7079,573.3912 -139.8079,572.24296 -105.3501,568.24641 -92.489539,570.06739 -89.294359,579.3954 -88.461909,581.82565 -87.423279,584.37583 -86.986309,585.06247 -86.549329,585.74911 -85.939769,589.34911 -85.631729,593.06247 -84.822549,602.81693 -83.825419,602.22727 -111.24218,608.20752 -123.50139,610.88155 -126.83597,612.64142 -121.96155,613.86482 -116.25491,615.2971 -101.42765,636.75362 -100.59948,644.77786 -99.522759,655.21024 -103.41371,658.51901 -122.3079,663.23821 -142.44642,668.26819 -141.46594,667.6979 -140.10904,673.59228 -138.16508,682.03687 -136.18164,683.77438 -131.29433,681.31403 -130.20179,680.76403 -128.41401,679.86403 -127.32147,679.31403 -126.22893,678.76403 -124.45549,678.31403 -123.38049,678.31403 -122.30548,678.31403 -121.16922,677.89865 -120.85545,677.39097 -120.54168,676.88328 -118.8424,676.15106 -117.07926,675.76381 -115.31612,675.37656 -113.18378,674.71179 -112.34072,674.28654 -111.49767,673.86129 -108.1079,672.69914 -104.8079,671.70399 -101.5079,670.70883 -98.261876,669.49756 -97.594519,669.01227 -96.927169,668.52698 -92.837539,667.88704 -88.506459,667.59019 -79.624759,666.98142 -79.339059,667.18157 -74.625739,677.31403 -73.474449,679.78903 -70.906949,685.14737 -68.920189,689.22145 -62.099459,703.20812 -63.691449,706.19302 -79.307899,708.69772 -91.598589,710.66902 -150.12673,722.85282 -168.50347,727.26552 -182.67226,730.66782 -198.16342,731.38762 -203.8555,728.90832 z M -153.09536,626.82173 C -150.18726,624.35097 -146.1204,621.19533 -144.0579,619.80919 -140.17761,617.20138 -138.84137,613.76788 -142.0579,614.67015 -143.0204,614.94014 -147.6329,615.93467 -152.3079,616.88022 -162.42679,618.92683 -164.17358,620.11865 -162.48525,623.82414 -161.83771,625.24534 -161.3079,627.51196 -161.3079,628.86108 -161.3079,632.472 -159.10063,631.92389 -153.09536,626.82173 z M 950.4804,722.06402 C 948.5815,719.72652 944.2374,713.76402 940.8269,708.81402 932.7174,697.04412 927.5252,689.8465 923.1529,684.31403 917.4015,677.03646 910.0191,667.20096 906.0922,661.58423 900.9667,654.25327 900.6921,655.03477 900.6921,676.94997 900.6921,696.46792 900.6921,696.46792 897.9421,699.18882 889.4545,707.58692 858.6781,711.35442 850.3643,705.01312 845.5258,701.32272 845.5047,697.35432 850.1921,672.60469 852.1171,662.4406 853.6938,652.70466 853.6958,650.96927 853.6978,649.23389 855.0461,640.83903 856.6921,632.31403 860.5334,612.41864 860.5251,612.17712 855.8106,606.49344 841.0116,588.65251 850.7022,571.82397 877.2772,569.21497 940.2104,563.03649 984.71623,585.59328 984.68653,623.65312 984.67433,639.3802 978.65673,646.13696 961.25753,649.96016 951.521,652.09958 950.7987,650.56566 972.72633,674.31403 997.68303,701.34302 997.63913,700.87182 976.69213,716.96202 961.99843,728.24872 956.3913,729.34012 950.4804,722.06402 z M 939.8152,628.41506 C 960.1509,618.72912 936.8238,612.26816 899.1921,617.16359 893.1578,617.94858 890.8101,625.26781 895.9641,627.22735 907.3942,631.57306 931.7973,632.23402 939.8152,628.41506 z M -21.166519,694.62248 C -39.587869,693.17692 -43.689179,673.9346 -28.615989,659.67138 -20.050159,651.56583 -20.207209,652.13135 -21.712789,634.81403 -23.173279,618.01539 -24.512659,616.75902 -41.968569,615.81364 -62.305479,614.71224 -63.850509,613.1325 -62.995899,594.31403 -62.123449,575.10295 -51.546409,560.31403 -38.679089,560.31403 -37.439849,560.31403 -36.189489,559.93145 -35.900489,559.46385 -35.254829,558.41914 -22.263979,556.66951 -4.3078979,555.20889 19.729461,553.2536 45.089441,555.96283 58.343231,561.90198 60.076351,562.67861 61.768941,563.31403 62.104541,563.31403 67.294191,563.31403 87.599151,584.5405 91.758721,594.31403 92.343921,595.68903 94.410141,600.18903 96.350331,604.31403 104.58035,621.81169 105.09612,626.18407 101.06877,644.31403 95.288271,670.33624 79.633391,682.49015 47.692101,685.75385 40.778481,686.46027 29.422061,688.64006 21.192101,690.84035 10.171973,693.78659 -9.4696676,695.54032 -21.166519,694.62248 z M 52.963451,655.55665 C 53.639211,655.02488 55.466991,654.2848 57.025191,653.91201 67.030591,651.5183 73.104501,641.62936 69.801381,633.11108 63.508801,616.88343 59.783741,611.97808 50.240901,607.35284 40.548691,602.6552 18.663661,602.87906 18.714991,607.67532 18.756221,611.52695 25.519931,655.22643 26.260251,656.4243 27.137881,657.84433 51.043361,657.06758 52.963451,655.55665 z M 705.6921,678.81403 C 702.1171,676.34573 698.8504,674.32347 698.4328,674.32012 698.0152,674.31677 693.7402,671.77214 688.9328,668.66538 684.1254,665.55863 678.6171,662.02692 676.6921,660.81713 658.4915,649.37882 657.7522,647.62341 666.2529,636.03268 668.7614,632.61242 675.0404,623.96403 680.2062,616.81403 685.372,609.66403 691.3071,601.58313 693.3954,598.85648 695.4836,596.12983 698.8292,591.38929 700.83,588.32195 702.8309,585.25461 705.1934,582.14291 706.08,581.40705 706.9667,580.6712 707.6921,579.62263 707.6921,579.0769 707.6921,578.05966 723.6572,556.55627 732.388,545.81403 741.2034,534.96762 747.6019,537.36216 759.0675,555.7985 760.0989,557.45704 762.3489,560.42361 764.0675,562.39087 765.786,564.35813 768.9921,568.5782 771.1921,571.76881 773.3921,574.95942 777.3625,580.46398 780.0153,584.00117 782.668,587.53837 785.368,591.64329 786.0153,593.12323 786.6625,594.60317 788.8946,598.06403 790.9753,600.81403 799.4475,612.01094 804.6921,619.27273 804.6921,619.80644 804.6921,620.11715 806.9421,623.27057 809.6921,626.81403 812.4421,630.35749 814.6921,633.52462 814.6921,633.85208 814.6921,634.17955 815.8171,635.92242 817.1921,637.72514 821.106,642.85652 820.6208,647.72886 815.4421,655.29761 813.1046,658.71392 810.5171,662.5499 809.6921,663.82201 791.9239,691.21961 791.4365,691.18342 776.4523,661.35412 770.5233,649.55117 765.3074,639.52929 764.8613,639.08327 763.914,638.13592 729.7162,641.85869 728.6454,643.02574 728.2476,643.4593 726.9162,651.91403 725.6866,661.81403 722.6764,686.051 719.7624,688.5286 705.6921,678.81403 z M 744.9736,607.22308 C 753.9761,604.196 754.3962,603.63266 750.4745,599.84631 748.6692,598.10333 745.7549,594.97833 743.9983,592.90187 740.5889,588.87158 738.6921,588.87903 738.6921,592.92271 738.6921,594.29256 738.0703,596.6285 737.3103,598.11369 732.1193,608.25847 734.2747,610.82059 744.9736,607.22308 z M 223.79245,664.92085 C 222.5559,663.6046 220.89752,660.5671 220.10715,658.17085 219.31679,655.7746 218.39758,653.02653 218.06448,652.06403 217.2726,649.7759 213.5843,649.82908 210.57696,652.17198 165.71159,687.12476 102.5412,633.01912 135.72465,588.06075 136.84235,586.54644 138.76514,583.82164 139.99751,582.00564 149.50288,567.9987 164.53909,553.87515 179.1921,545.19009 183.5921,542.58215 189.05197,539.29217 191.32515,537.87904 193.59833,536.4659 197.19833,534.60629 199.32515,533.74655 201.45197,532.88682 205.4421,531.09179 208.1921,529.75759 217.76397,525.11368 226.36663,522.31403 231.06437,522.31403 236.18631,522.31403 234.21665,521.00086 257.01145,539.61297 289.36518,566.03003 288.33551,570.33254 249.1921,572.28645 235.4421,572.9728 223.43418,573.93479 222.50784,574.4242 221.5815,574.91361 219.07852,575.31403 216.94567,575.31403 214.81282,575.31403 211.20497,576.21403 208.92824,577.31403 206.6515,578.41403 203.93469,579.31403 202.89089,579.31403 201.84708,579.31403 199.01285,580.65584 196.59258,582.29583 194.17232,583.93582 191.6446,585.28582 190.97543,585.29583 190.30627,585.30584 188.22601,586.77653 186.35263,588.56403 184.47926,590.35153 181.08646,593.30429 178.81308,595.12572 170.43901,601.835 170.65047,606.30486 179.83559,616.73971 189.45667,627.66982 197.93943,629.28475 206.99148,621.90958 213.37306,616.71017 214.99862,612.46082 215.63523,599.31403 216.31191,585.33981 216.81608,584.9118 233.84515,583.85461 246.7189,583.05539 244.62359,580.96643 260.54481,610.47343 273.57242,634.61765 273.77944,635.57391 267.74666,643.74018 262.5447,650.78181 250.32194,661.34355 244.68637,663.66669 242.21452,664.68565 239.41071,665.92315 238.45567,666.41669 234.72234,668.34598 226.19275,667.47585 223.79245,664.92085 z M 489.0049,664.06403 C 484.1832,658.73496 483.1777,644.72828 486.7556,632.73244 487.8906,628.92731 489.7031,622.88903 490.7834,619.31403 495.9799,602.11792 496.1812,594.29312 491.7482,581.81403 483.5153,558.63809 483.17572,539.10922 489.41062,533.28665 512.75902,511.48238 558.3721,523.33874 540.7049,546.81403 540.291,547.36403 539.6992,550.73903 539.3897,554.31403 538.4259,565.4498 536.5998,577.62244 535.1893,582.31403 530.4703,598.0099 532.2027,600.84604 541.7475,593.05073 554.982,582.24212 561.6099,582.55398 575.8758,594.65655 585.1844,602.55367 586.2804,601.48886 587.0361,583.81403 587.2477,578.86403 587.9269,570.98903 588.5454,566.31403 590.784,549.39306 591.8333,540.70129 592.3485,534.81403 593.6301,520.1672 610.5463,522.16673 641.6921,540.64656 647.5216,544.10537 649.4374,552.4099 646.0218,559.41418 642.7967,566.02782 639.6886,573.73294 639.6603,575.18487 639.6428,576.08091 638.9678,577.68754 638.1603,578.75516 637.3528,579.82278 636.6891,581.62278 636.6855,582.75516 636.6819,583.88754 635.7849,586.16403 634.6921,587.81403 633.5993,589.46403 632.687,591.48903 632.6648,592.31403 632.6425,593.13903 631.7548,595.61403 630.6921,597.81403 629.6294,600.01403 628.7447,602.51153 628.726,603.36403 628.7074,604.21653 628.334,605.34153 627.8962,605.86403 627.4585,606.38653 626.5212,608.61403 625.8133,610.81403 624.2403,615.70277 622.1285,620.87468 620.1658,624.64507 619.3553,626.20214 618.6921,628.0306 618.6921,628.7083 618.6921,630.7133 605.799,655.57133 603.4772,658.04275 597.6871,664.20604 590.7525,660.44916 572.9122,641.48402 556.7415,624.29366 558.2667,624.5147 543.6357,637.24124 529.8768,649.20915 520.6618,656.80875 519.4188,657.21288 518.7441,657.43225 516.8455,658.73252 515.1996,660.10236 507.537,666.47988 493.1584,668.6545 489.0049,664.06403 z M 443.4486,664.73725 C 443.1314,664.42002 417.0689,664.06755 385.532,663.95398 315.54315,663.70196 316.6921,663.96607 316.6921,648.12951 316.6921,636.32632 319.58014,633.17893 331.1921,632.32737 338.1921,631.81403 338.1921,631.81403 338.50193,609.31403 339.05465,569.17548 337.12245,542.90278 333.53401,541.76386 320.87658,537.74654 321.85131,521.91914 335.01715,517.68116 358.10202,510.25031 457.8369,520.67401 461.7342,530.92489 469.577,551.55289 464.6582,558.30807 441.2729,559.02523 420.9325,559.64901 420.3396,559.78007 423.7788,562.89251 430.4451,568.92539 438.6921,588.19039 438.6921,597.72987 438.6921,607.67538 435.6266,609.25726 414.0701,610.43536 392.1109,611.63546 393.6702,611.08973 393.7918,617.53265 394.0075,628.96355 393.1346,628.57173 412.6921,626.01654 440.8729,622.33471 450.6529,621.82172 452.6617,623.92001 456.9794,628.43003 462.5275,661.07861 459.4921,664.11403 458.2823,665.32381 444.568,665.85655 443.4486,664.73725 z M 392.2432,568.99886 C 408.8629,560.25157 409.1158,559.16248 394.4421,559.53128 383.1921,559.81403 383.1921,559.81403 382.8944,566.06403 382.536,573.58725 383.1557,573.7818 392.2432,568.99886 z"
+       id="path3038"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssssssssssssssssssssssssssssssssssssssscssssssssssssssscscsccscccsssscscssssssssccsssssssssssssssscssscscssssssssssssssssssssssssssssscssssssssssssccsssssssssssssssssssscsssssssssssssssssssssscccssccscccssssssscssssssscsssssssssssssssssssssssssssssssscsssccssssscsscssscsccccsssscsscssssssssssssssscssss" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path3048"
+       d="M -544.27593,815.15562 C -554.52457,812.75752 -561.81921,805.22882 -562.72896,796.11042 -564.74585,775.89532 -568.08732,750.60342 -569.90236,741.81402 -571.36304,734.74072 -572.1632,729.20122 -574.74138,708.31402 -575.5221,701.98902 -576.62818,693.88903 -577.19933,690.31403 -578.45487,682.45537 -580.90982,656.9568 -582.25394,637.81403 -587.57342,562.05449 -568.11115,525.23519 -531.81168,542.38587 -523.32213,546.39699 -515.72072,554.89627 -509.8569,566.93393 -500.33927,586.4724 -496.4382,595.04125 -494.88784,599.81403 -491.75176,609.46851 -491.44175,609.62832 -478.24708,608.39237 -471.95553,607.80304 -455.47196,607.31933 -441.61692,607.31745 -412.61149,607.31351 -413.6706,607.77009 -420.30332,598.12929 -423.07135,594.1059 -426.88742,588.48758 -428.78348,585.64413 -432.90381,579.46504 -443.89098,557.05307 -444.878,552.81403 -445.26218,551.16403 -446.14151,549.13903 -446.83206,548.31403 -448.4472,546.38442 -455.3079,524.31516 -455.3079,521.04925 -455.3079,513.42223 -451.94871,509.05147 -442.3079,504.13446 -440.9329,503.43318 -438.18943,501.87463 -436.21131,500.67102 -421.5056,491.72315 -384.3079,495.25311 -384.3079,505.59651 -384.3079,506.09608 -381.8329,510.09776 -378.8079,514.48915 -375.7829,518.88054 -373.3079,522.81787 -373.3079,523.23877 -373.3079,523.65968 -372.4079,524.81854 -371.3079,525.81403 -370.2079,526.80952 -369.29789,528.11676 -369.28566,528.71902 -369.27343,529.32127 -368.34938,530.93903 -367.2322,532.31403 -364.26375,535.96756 -344.22512,565.96802 -340.84841,571.81403 -339.25999,574.56403 -336.23856,579.10492 -334.13413,581.9049 -332.02971,584.70488 -330.3079,587.46228 -330.3079,588.03245 -330.3079,588.60263 -329.58602,589.66825 -328.70372,590.40049 -327.82143,591.13273 -326.70421,592.65033 -326.22102,593.77293 -325.73783,594.89554 -324.3222,597.40293 -323.07519,599.34492 -321.82818,601.28691 -319.9079,604.37205 -318.8079,606.20079 -317.7079,608.02952 -312.96077,615.44062 -308.25872,622.6699 -303.55667,629.89917 -299.40159,636.48903 -299.0252,637.31403 -298.64882,638.13903 -296.87095,641.31195 -295.07438,644.36496 -293.27782,647.41796 -290.4579,652.29494 -288.8079,655.20267 -287.1579,658.11041 -284.1373,663.26249 -282.09545,666.65175 -278.41516,672.76064 -274.0651,681.24467 -270.80678,688.66831 -264.47527,703.09382 -267.29834,723.82762 -277.69062,739.22602 -291.59242,759.82452 -298.65666,761.88482 -312.84628,749.47902 -326.47639,737.56242 -349.3079,711.44932 -349.3079,707.77682 -349.3079,707.37862 -350.8829,704.86062 -352.8079,702.18112 -354.7329,699.50172 -356.3079,696.93122 -356.3079,696.46902 -356.3079,696.00682 -357.42723,693.64532 -358.7953,691.22131 -360.16337,688.79731 -361.78909,685.68903 -362.40801,684.31403 -363.02693,682.93903 -364.2218,680.51092 -365.06328,678.91822 -365.90476,677.32552 -367.86135,671.79867 -369.41126,666.63633 -370.96117,661.47398 -372.45948,656.87778 -372.74084,656.42254 -373.0222,655.96729 -380.57738,655.27647 -389.53015,654.88737 -398.48291,654.49827 -408.9579,653.7618 -412.8079,653.25076 -433.57242,650.49452 -444.12742,654.62428 -464.80261,673.59427 -474.04761,682.07678 -474.04071,682.05073 -470.33814,694.50308 -468.65193,700.17412 -466.60317,707.06402 -465.78535,709.81402 -458.36136,734.77782 -461.91135,768.95712 -473.78634,786.84752 -486.69937,806.30182 -521.8264,820.40852 -544.27593,815.15562 z M 1230.1923,785.86832 C 1213.6939,784.22972 1202.3195,782.71132 1192.1923,780.79562 1187.7923,779.96332 1177.6673,778.16712 1169.6923,776.80412 1161.7173,775.44122 1153.1673,773.87212 1150.6923,773.31742 1146.5168,772.38162 1142.1401,771.49332 1130.6923,769.25812 1128.2173,768.77492 1123.0423,767.64512 1119.1923,766.74752 1115.3423,765.84992 1110.3923,764.75472 1108.1923,764.31382 1095.0569,761.68122 1091.5391,760.88592 1085.5371,759.19212 1081.8767,758.15922 1077.8267,757.30732 1076.5371,757.29902 1075.2474,757.29072 1070.5923,756.16582 1066.1923,754.79912 1061.7923,753.43252 1057.0673,752.30942 1055.6923,752.30332 1052.5131,752.28942 1043.8344,749.67682 1042.0512,748.19702 1039.2771,745.89462 1040.4043,739.00882 1044.4423,733.58982 1050.3532,725.65742 1069.3376,701.54942 1076.0697,693.42655 1096.122,669.23164 1092.9534,670.37659 1119.2659,677.81842 1140.461,683.81293 1144.9834,685.2016 1172.6923,694.2236 1177.9173,695.92482 1183.1344,697.31612 1184.2857,697.31542 1185.4371,697.31462 1189.0371,698.23182 1192.2857,699.35362 1195.5344,700.47542 1202.2423,702.03182 1207.1923,702.81222 1212.1423,703.59272 1219.7923,704.90112 1224.1923,705.71972 1233.5022,707.45172 1240.6923,707.72592 1240.6923,706.34882 1240.6923,703.51522 1224.0016,689.46208 1213.493,683.44772 1211.6776,682.40873 1207.2673,679.86091 1203.6923,677.78589 1196.2415,673.46127 1190.7397,670.37081 1183.9529,666.69786 1181.3346,665.28087 1178.7423,663.77001 1178.1923,663.3404 1177.6423,662.9108 1173.8173,660.77116 1169.6923,658.58564 1162.1001,654.56315 1158.4499,652.53812 1141.9722,643.20747 1116.0958,628.55474 1104.4749,610.65116 1108.3298,591.37674 1109.1382,587.33443 1136.9327,567.0654 1146.3364,563.66055 1147.3572,563.29097 1149.318,562.2108 1150.6938,561.26019 1184.0861,538.18766 1248.0177,530.87937 1319.8739,541.9205 1343.9601,545.62149 1369.1953,627.77648 1352.4775,648.06403 1349.6145,651.5383 1330.313,646.53962 1311.1923,637.37206 1302.3833,633.14855 1237.4573,610.91209 1226.1923,608.26049 1171.7714,595.45072 1174.8897,611.20222 1233.7374,646.37357 1241.9648,651.29082 1248.8874,655.31403 1249.1209,655.31403 1249.3544,655.31403 1253.2116,657.56403 1257.6923,660.31403 1262.173,663.06403 1266.0232,665.31403 1266.2481,665.31403 1266.473,665.31403 1269.5979,667.11403 1273.1923,669.31403 1276.7867,671.51403 1280.0146,673.31403 1280.3655,673.31403 1280.7164,673.31403 1282.4785,674.43903 1284.2812,675.81403 1286.0839,677.18903 1287.8439,678.31403 1288.1923,678.31403 1288.5407,678.31403 1290.3007,679.43903 1292.1034,680.81403 1293.9061,682.18903 1295.68,683.31403 1296.0453,683.31403 1298.5268,683.31403 1316.9098,699.94392 1323.3812,708.04302 1335.3688,723.04562 1340.8099,754.24452 1333.0342,763.39282 1332.2961,764.26112 1331.6923,765.45342 1331.6923,766.04242 1331.6923,767.84032 1321.1635,776.85802 1315.774,779.67612 1302.7416,786.49062 1264.3945,789.26512 1230.1923,785.86832 z M -203.8555,728.90832 C -216.83027,723.25672 -212.70609,702.54302 -198.05897,699.79512 -196.03507,699.41542 -193.91188,698.54182 -193.34076,697.85362 -192.31039,696.61212 -201.86643,652.08895 -204.40276,646.31403 -205.00665,644.93903 -205.8674,641.78903 -206.31553,639.31403 -207.51491,632.68995 -211.16589,618.15086 -212.26849,615.60789 -212.7946,614.39452 -215.38119,612.43166 -218.01648,611.24599 -230.5486,605.60752 -229.49256,591.82062 -216.08375,586.01375 -209.07322,582.97774 -207.03388,582.28636 -199.05716,580.24141 -194.52007,579.07825 -183.3829,577.2725 -174.3079,576.22863 -165.2329,575.18475 -149.7079,573.3912 -139.8079,572.24296 -105.3501,568.24641 -92.489539,570.06739 -89.294359,579.3954 -88.461909,581.82565 -87.423279,584.37583 -86.986309,585.06247 -86.549329,585.74911 -85.939769,589.34911 -85.631729,593.06247 -84.822549,602.81693 -83.825419,602.22727 -111.24218,608.20752 -123.50139,610.88155 -126.83597,612.64142 -121.96155,613.86482 -116.25491,615.2971 -101.42765,636.75362 -100.59948,644.77786 -99.522759,655.21024 -103.41371,658.51901 -122.3079,663.23821 -142.44642,668.26819 -141.46594,667.6979 -140.10904,673.59228 -138.16508,682.03687 -136.18164,683.77438 -131.29433,681.31403 -130.20179,680.76403 -128.41401,679.86403 -127.32147,679.31403 -126.22893,678.76403 -124.45549,678.31403 -123.38049,678.31403 -122.30548,678.31403 -121.16922,677.89865 -120.85545,677.39097 -120.54168,676.88328 -118.8424,676.15106 -117.07926,675.76381 -115.31612,675.37656 -113.18378,674.71179 -112.34072,674.28654 -111.49767,673.86129 -108.1079,672.69914 -104.8079,671.70399 -101.5079,670.70883 -98.261876,669.49756 -97.594519,669.01227 -96.927169,668.52698 -92.837539,667.88704 -88.506459,667.59019 -79.624759,666.98142 -79.339059,667.18157 -74.625739,677.31403 -73.474449,679.78903 -70.906949,685.14737 -68.920189,689.22145 -62.099459,703.20812 -63.691449,706.19302 -79.307899,708.69772 -91.598589,710.66902 -150.12673,722.85282 -168.50347,727.26552 -182.67226,730.66782 -198.16342,731.38762 -203.8555,728.90832 z M -153.09536,626.82173 C -150.18726,624.35097 -146.1204,621.19533 -144.0579,619.80919 -140.17761,617.20138 -138.84137,613.76788 -142.0579,614.67015 -143.0204,614.94014 -147.6329,615.93467 -152.3079,616.88022 -162.42679,618.92683 -164.17358,620.11865 -162.48525,623.82414 -161.83771,625.24534 -161.3079,627.51196 -161.3079,628.86108 -161.3079,632.472 -159.10063,631.92389 -153.09536,626.82173 z M 950.4804,722.06402 C 948.5815,719.72652 944.2374,713.76402 940.8269,708.81402 932.7174,697.04412 927.5252,689.8465 923.1529,684.31403 917.4015,677.03646 910.0191,667.20096 906.0922,661.58423 900.9667,654.25327 900.6921,655.03477 900.6921,676.94997 900.6921,696.46792 900.6921,696.46792 897.9421,699.18882 889.4545,707.58692 858.6781,711.35442 850.3643,705.01312 845.5258,701.32272 845.5047,697.35432 850.1921,672.60469 852.1171,662.4406 853.6938,652.70466 853.6958,650.96927 853.6978,649.23389 855.0461,640.83903 856.6921,632.31403 860.5334,612.41864 860.5251,612.17712 855.8106,606.49344 841.0116,588.65251 850.7022,571.82397 877.2772,569.21497 940.2104,563.03649 984.71623,585.59328 984.68653,623.65312 984.67433,639.3802 978.65673,646.13696 961.25753,649.96016 951.521,652.09958 950.7987,650.56566 972.72633,674.31403 997.68303,701.34302 997.63913,700.87182 976.69213,716.96202 961.99843,728.24872 956.3913,729.34012 950.4804,722.06402 z M 939.8152,628.41506 C 960.1509,618.72912 936.8238,612.26816 899.1921,617.16359 893.1578,617.94858 890.8101,625.26781 895.9641,627.22735 907.3942,631.57306 931.7973,632.23402 939.8152,628.41506 z M -21.166519,694.62248 C -39.587869,693.17692 -43.689179,673.9346 -28.615989,659.67138 -20.050159,651.56583 -20.207209,652.13135 -21.712789,634.81403 -23.173279,618.01539 -24.512659,616.75902 -41.968569,615.81364 -62.305479,614.71224 -63.850509,613.1325 -62.995899,594.31403 -62.123449,575.10295 -51.546409,560.31403 -38.679089,560.31403 -37.439849,560.31403 -36.189489,559.93145 -35.900489,559.46385 -35.254829,558.41914 -22.263979,556.66951 -4.3078979,555.20889 19.729461,553.2536 45.089441,555.96283 58.343231,561.90198 60.076351,562.67861 61.768941,563.31403 62.104541,563.31403 67.294191,563.31403 87.599151,584.5405 91.758721,594.31403 92.343921,595.68903 94.410141,600.18903 96.350331,604.31403 104.58035,621.81169 105.09612,626.18407 101.06877,644.31403 95.288271,670.33624 79.633391,682.49015 47.692101,685.75385 40.778481,686.46027 29.422061,688.64006 21.192101,690.84035 10.171973,693.78659 -9.4696676,695.54032 -21.166519,694.62248 z M 52.963451,655.55665 C 53.639211,655.02488 55.466991,654.2848 57.025191,653.91201 67.030591,651.5183 73.104501,641.62936 69.801381,633.11108 63.508801,616.88343 59.783741,611.97808 50.240901,607.35284 40.548691,602.6552 18.663661,602.87906 18.714991,607.67532 18.756221,611.52695 25.519931,655.22643 26.260251,656.4243 27.137881,657.84433 51.043361,657.06758 52.963451,655.55665 z M 705.6921,678.81403 C 702.1171,676.34573 698.8504,674.32347 698.4328,674.32012 698.0152,674.31677 693.7402,671.77214 688.9328,668.66538 684.1254,665.55863 678.6171,662.02692 676.6921,660.81713 658.4915,649.37882 657.7522,647.62341 666.2529,636.03268 668.7614,632.61242 675.0404,623.96403 680.2062,616.81403 685.372,609.66403 691.3071,601.58313 693.3954,598.85648 695.4836,596.12983 698.8292,591.38929 700.83,588.32195 702.8309,585.25461 705.1934,582.14291 706.08,581.40705 706.9667,580.6712 707.6921,579.62263 707.6921,579.0769 707.6921,578.05966 723.6572,556.55627 732.388,545.81403 741.2034,534.96762 747.6019,537.36216 759.0675,555.7985 760.0989,557.45704 762.3489,560.42361 764.0675,562.39087 765.786,564.35813 768.9921,568.5782 771.1921,571.76881 773.3921,574.95942 777.3625,580.46398 780.0153,584.00117 782.668,587.53837 785.368,591.64329 786.0153,593.12323 786.6625,594.60317 788.8946,598.06403 790.9753,600.81403 799.4475,612.01094 804.6921,619.27273 804.6921,619.80644 804.6921,620.11715 806.9421,623.27057 809.6921,626.81403 812.4421,630.35749 814.6921,633.52462 814.6921,633.85208 814.6921,634.17955 815.8171,635.92242 817.1921,637.72514 821.106,642.85652 820.6208,647.72886 815.4421,655.29761 813.1046,658.71392 810.5171,662.5499 809.6921,663.82201 791.9239,691.21961 791.4365,691.18342 776.4523,661.35412 770.5233,649.55117 765.3074,639.52929 764.8613,639.08327 763.914,638.13592 729.7162,641.85869 728.6454,643.02574 728.2476,643.4593 726.9162,651.91403 725.6866,661.81403 722.6764,686.051 719.7624,688.5286 705.6921,678.81403 z M 744.9736,607.22308 C 753.9761,604.196 754.3962,603.63266 750.4745,599.84631 748.6692,598.10333 745.7549,594.97833 743.9983,592.90187 740.5889,588.87158 738.6921,588.87903 738.6921,592.92271 738.6921,594.29256 738.0703,596.6285 737.3103,598.11369 732.1193,608.25847 734.2747,610.82059 744.9736,607.22308 z M 223.79245,664.92085 C 222.5559,663.6046 220.89752,660.5671 220.10715,658.17085 219.31679,655.7746 218.39758,653.02653 218.06448,652.06403 217.2726,649.7759 213.5843,649.82908 210.57696,652.17198 165.71159,687.12476 102.5412,633.01912 135.72465,588.06075 136.84235,586.54644 138.76514,583.82164 139.99751,582.00564 149.50288,567.9987 164.53909,553.87515 179.1921,545.19009 183.5921,542.58215 189.05197,539.29217 191.32515,537.87904 193.59833,536.4659 197.19833,534.60629 199.32515,533.74655 201.45197,532.88682 205.4421,531.09179 208.1921,529.75759 217.76397,525.11368 226.36663,522.31403 231.06437,522.31403 236.18631,522.31403 234.21665,521.00086 257.01145,539.61297 289.36518,566.03003 288.33551,570.33254 249.1921,572.28645 235.4421,572.9728 223.43418,573.93479 222.50784,574.4242 221.5815,574.91361 219.07852,575.31403 216.94567,575.31403 214.81282,575.31403 211.20497,576.21403 208.92824,577.31403 206.6515,578.41403 203.93469,579.31403 202.89089,579.31403 201.84708,579.31403 199.01285,580.65584 196.59258,582.29583 194.17232,583.93582 191.6446,585.28582 190.97543,585.29583 190.30627,585.30584 188.22601,586.77653 186.35263,588.56403 184.47926,590.35153 181.08646,593.30429 178.81308,595.12572 170.43901,601.835 170.65047,606.30486 179.83559,616.73971 189.45667,627.66982 197.93943,629.28475 206.99148,621.90958 213.37306,616.71017 214.99862,612.46082 215.63523,599.31403 216.31191,585.33981 216.81608,584.9118 233.84515,583.85461 246.7189,583.05539 244.62359,580.96643 260.54481,610.47343 273.57242,634.61765 273.77944,635.57391 267.74666,643.74018 262.5447,650.78181 250.32194,661.34355 244.68637,663.66669 242.21452,664.68565 239.41071,665.92315 238.45567,666.41669 234.72234,668.34598 226.19275,667.47585 223.79245,664.92085 z M 489.0049,664.06403 C 484.1832,658.73496 483.1777,644.72828 486.7556,632.73244 487.8906,628.92731 489.7031,622.88903 490.7834,619.31403 495.9799,602.11792 496.1812,594.29312 491.7482,581.81403 483.5153,558.63809 475.72585,535.25801 488.2742,531.39261 518.80493,521.98791 558.3721,523.33874 540.7049,546.81403 540.291,547.36403 539.6992,550.73903 539.3897,554.31403 538.4259,565.4498 536.5998,577.62244 535.1893,582.31403 530.4703,598.0099 532.2027,600.84604 541.7475,593.05073 554.982,582.24212 561.6099,582.55398 575.8758,594.65655 585.1844,602.55367 586.2804,601.48886 587.0361,583.81403 587.2477,578.86403 587.9269,570.98903 588.5454,566.31403 590.784,549.39306 591.8333,540.70129 592.3485,534.81403 593.6301,520.1672 610.5463,522.16673 641.6921,540.64656 647.5216,544.10537 649.4374,552.4099 646.0218,559.41418 642.7967,566.02782 639.6886,573.73294 639.6603,575.18487 639.6428,576.08091 638.9678,577.68754 638.1603,578.75516 637.3528,579.82278 636.6891,581.62278 636.6855,582.75516 636.6819,583.88754 635.7849,586.16403 634.6921,587.81403 633.5993,589.46403 632.687,591.48903 632.6648,592.31403 632.6425,593.13903 631.7548,595.61403 630.6921,597.81403 629.6294,600.01403 628.7447,602.51153 628.726,603.36403 628.7074,604.21653 628.334,605.34153 627.8962,605.86403 627.4585,606.38653 626.5212,608.61403 625.8133,610.81403 624.2403,615.70277 622.1285,620.87468 620.1658,624.64507 619.3553,626.20214 618.6921,628.0306 618.6921,628.7083 618.6921,630.7133 605.799,655.57133 603.4772,658.04275 597.6871,664.20604 590.7525,660.44916 572.9122,641.48402 556.7415,624.29366 558.2667,624.5147 543.6357,637.24124 529.8768,649.20915 520.6618,656.80875 519.4188,657.21288 518.7441,657.43225 516.8455,658.73252 515.1996,660.10236 507.537,666.47988 493.1584,668.6545 489.0049,664.06403 z M 443.4486,664.73725 C 443.1314,664.42002 417.0689,664.06755 385.532,663.95398 315.54315,663.70196 316.6921,663.96607 316.6921,648.12951 316.6921,636.32632 319.58014,633.17893 331.1921,632.32737 338.1921,631.81403 338.1921,631.81403 338.50193,609.31403 339.05465,569.17548 337.12245,542.90278 333.53401,541.76386 320.87658,537.74654 321.85131,521.91914 335.01715,517.68116 358.10202,510.25031 457.8369,520.67401 461.7342,530.92489 469.577,551.55289 464.6582,558.30807 441.2729,559.02523 420.9325,559.64901 420.3396,559.78007 423.7788,562.89251 430.4451,568.92539 438.6921,588.19039 438.6921,597.72987 438.6921,607.67538 435.6266,609.25726 414.0701,610.43536 392.1109,611.63546 393.6702,611.08973 393.7918,617.53265 394.0075,628.96355 393.1346,628.57173 412.6921,626.01654 440.8729,622.33471 450.6529,621.82172 452.6617,623.92001 456.9794,628.43003 462.5275,661.07861 459.4921,664.11403 458.2823,665.32381 444.568,665.85655 443.4486,664.73725 z M 392.2432,568.99886 C 408.8629,560.25157 409.1158,559.16248 394.4421,559.53128 383.1921,559.81403 383.1921,559.81403 382.8944,566.06403 382.536,573.58725 383.1557,573.7818 392.2432,568.99886 z"
+       style="fill:url(#radialGradient3824);fill-opacity:1"
+       sodipodi:nodetypes="sssssssssssssssssssssssssssssssssssssssscssssssssssssssscscsccscccsssscscssssssssccsssssssssssssssscssscscssssssssssssssssssssssssssssscssssssssssssccsssssssssssssssssssscsssssssssssssssssssssscccssccscccssssssscssssssscsssssssssssssssssssssssssssssssscsssccssssscsscssscsccccsssscsscssssssssssssssscssss" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path3853"
+       d="M -522.09465,847.72778 C -540.13249,844.46729 -551.47942,838.2229 -565.35896,823.91877 -571.98148,817.09366 -582.08972,804.46587 -582.11446,802.98685 -582.12535,802.33538 -582.59784,798.65236 -583.16443,794.80236 -597.68191,696.15567 -602.28805,619.14684 -595.48593,588.80236 -581.1576,524.88309 -539.61579,506.04275 -498.97265,545.03097 -488.57063,555.00945 -476.86867,548.93012 -473.65584,531.87853 -469.65452,510.64221 -463.70371,502.03813 -447.75698,494.43221 -423.32451,482.77897 -427.68475,483.90332 -412.08358,485.23329 -363.12514,489.4069 -342.62575,505.19814 -301.82411,570.16922 -297.38911,577.23136 -280.09465,607.30051 -280.09465,607.94932 -280.09465,608.19474 -278.10803,611.86208 -275.67994,616.09895 -258.20601,646.58991 -234.34088,695.61953 -232.99039,703.80236 -227.12427,739.34598 -234.95011,763.74999 -260.80923,790.55236 -266.94764,796.91467 -266.38453,796.72437 -274.66099,795.23352 -301.40838,790.41548 -334.02679,756.88693 -368.96093,698.30236 -382.17312,676.14551 -382.43914,675.76873 -384.62063,676.12234 -385.70634,676.29832 -395.03215,679.13011 -405.34465,682.41519 -425.66594,688.8886 -425.80277,688.98911 -422.24188,694.82828 -391.75462,744.82145 -413.25847,803.35912 -476.61739,842.849 -483.63694,847.22409 -509.51979,850.00079 -522.09465,847.72778 z M -520.59465,811.18974 C -477.95684,800.25856 -458.20495,762.88429 -470.9762,717.30236 -474.98109,703.0085 -478.27688,692.98963 -480.29863,688.96312 -483.6049,682.37836 -469.77819,668.05202 -446.23079,653.66421 -436.86693,647.94276 -436.86693,647.94276 -421.73079,649.23032 -392.02524,651.75724 -385.48866,652.10216 -377.46834,651.566 -368.18353,650.94531 -369.80444,649.03438 -364.54437,666.80236 -355.8246,696.25687 -333.76864,727.79206 -305.96896,750.55236 -299.10903,756.16876 -297.681,755.72616 -289.0301,745.30236 -277.1274,730.96035 -273.92807,723.47581 -273.85534,709.80236 -273.78168,695.95558 -276.87666,688.53747 -294.65728,659.94377 -297.44172,655.46599 -304.59643,643.92736 -310.55663,634.30236 -330.34049,602.35382 -349.67892,572.11686 -375.74486,532.37611 -394.54121,503.71874 -392.61474,505.83237 -401.80096,503.78863 -438.74052,495.57036 -458.79671,517.4265 -442.47851,548.11681 -441.16739,550.58269 -440.09465,553.22245 -440.09465,553.98293 -440.09465,558.62546 -420.97953,591.14331 -410.39954,604.49901 -402.0581,615.02888 -400.18018,614.42553 -442.45284,614.79719 -468.82264,615.02902 -477.22933,615.43255 -483.59465,616.772 -487.99465,617.6979 -492.22079,618.5335 -492.98607,618.6289 -494.8029,618.85539 -498.6048,611.80858 -502.06434,601.80236 -503.5856,597.40236 -505.73868,592.00236 -506.84897,589.80236 -507.95927,587.60236 -510.37361,582.42736 -512.21417,578.30236 -522.49482,555.26178 -532.83427,546.29352 -549.09465,546.31285 -574.8728,546.3435 -583.54929,586.0402 -575.10213,665.30236 -571.5485,698.64713 -569.68479,713.90826 -567.10315,730.80236 -564.33447,748.92051 -560.0832,782.09593 -559.19332,792.52783 -558.37405,802.13216 -557.66347,803.4182 -550.41214,808.42036 -543.52873,813.16873 -532.35999,814.20605 -520.59465,811.18974 z M 1209.4054,827.32372 C 1187.5954,826.37302 1169.2119,824.11375 1144.4054,819.33545 1070.9866,805.1933 1001.6735,748.90315 1022.9042,720.66266 1054.5002,678.63454 1087.6297,653.4075 1111.3853,653.28705 1117.761,653.25472 1117.8437,651.82624 1111.8313,645.58687 1093.8636,626.94093 1079.6364,600.6839 1083.432,593.17491 1108.7757,543.03822 1258.9377,504.38951 1337.0889,527.88871 1350.4134,531.89525 1398.9343,663.12816 1390.7411,673.00031 1384.6349,680.35775 1368.371,686.94668 1352.9054,688.32843 1347.1303,688.84439 1339.0304,689.55915 1334.9054,689.91679 1321.2778,691.09832 1321.7907,697.66818 1337.3947,721.80236 1339.884,725.65236 1342.8206,730.37736 1343.9208,732.30236 1345.0207,734.22736 1348.4386,739.85236 1351.5158,744.80236 1362.7867,762.93297 1367.489,775.84853 1366.6062,786.25014 1365.771,796.09044 1367.1131,794.48004 1350.348,805.75739 1321.1464,825.40028 1286.5887,830.68813 1209.4054,827.32372 z M 1299.3247,781.41634 C 1328.7961,774.23007 1338.166,752.55253 1323.9627,724.41589 1317.8568,712.32042 1307.1273,700.90937 1292.9054,691.38635 1284.0646,685.46648 1279.6043,682.78656 1243.9054,661.94475 1232.0804,655.04106 1219.5523,647.68479 1216.0651,645.59747 1172.9329,619.77993 1167.9722,594.79083 1207.1695,600.78727 1228.5079,604.05164 1305.022,628.13435 1315.3205,634.82764 1318.5515,636.92754 1341.9636,645.30236 1344.603,645.30236 1350.116,645.30236 1351.4931,614.3341 1346.8042,595.80236 1343.8382,584.08024 1337.7802,567.91441 1333.6882,560.80236 1333.0552,559.70236 1331.9486,557.63763 1331.2289,556.21407 1329.0762,551.95622 1326.7411,550.52869 1319.9054,549.29154 1289.3955,543.76972 1242.5642,541.83144 1221.9054,545.23546 1207.4625,547.61526 1202.9911,548.58114 1193.706,551.32681 1171.0801,558.01751 1146.854,570.18714 1123.4054,586.64121 1112.7673,594.10607 1111.6089,595.84926 1112.3888,603.21908 1114.0192,618.62476 1124.8421,628.74858 1161.9054,649.53729 1173.1804,655.8614 1183.9804,661.9216 1185.9054,663.0044 1187.8304,664.0872 1191.4304,666.10243 1193.9054,667.48269 1196.3803,668.86295 1202.6804,672.38019 1207.9054,675.29879 1243.959,695.43771 1260.2863,717.31455 1237.9054,715.49551 1224.3604,714.39463 1212.1306,712.1433 1194.9054,707.57988 1189.6804,706.19564 1183.4503,704.67254 1181.0606,704.19522 1178.6711,703.7179 1168.3211,700.6558 1158.0606,697.39054 1129.9395,688.44128 1101.3673,680.30236 1098.0717,680.30236 1094.5271,680.30236 1093.4434,681.46532 1074.4054,705.69754 1066.7054,715.49835 1057.181,727.46105 1053.2399,732.28132 1042.776,745.08013 1043.2741,747.37558 1056.9345,749.30647 1060.1809,749.76535 1065.8899,751.03289 1069.6212,752.12324 1073.3525,753.21359 1078.8803,754.61158 1081.9054,755.22989 1084.9304,755.8482 1091.4554,757.25508 1096.4054,758.3563 1101.3554,759.45752 1107.2054,760.75613 1109.4054,761.24212 1111.6054,761.7281 1116.5554,762.8579 1120.4054,763.75279 1124.2553,764.64767 1129.8803,765.80701 1132.9054,766.32909 1135.9304,766.85116 1140.2054,767.68834 1142.4054,768.18948 1155.2662,771.11909 1165.4824,773.06573 1179.9054,775.33501 1182.9304,775.81095 1190.5804,777.07572 1196.9054,778.14561 1236.1913,784.79089 1279.7771,786.18279 1299.3247,781.41634 z M 957.7126,751.05236 C 956.8464,750.36486 953.3158,745.30236 949.8668,739.80236 941.4107,726.31729 926.5077,704.4545 923.4131,700.99447 920.2088,697.41178 919.522,697.92043 917.996,705.00672 914.9834,718.99606 915.7981,717.8318 905.618,722.69694 873.8803,737.86454 846.2982,729.9276 839.9563,703.80236 838.822,699.12974 839.239,696.09919 846.324,657.51696 855.359,608.31574 855.1629,611.78505 849.2827,605.16421 837.2948,591.66642 842.03306,579.97164 860.95686,571.03045 866.35566,568.47957 904.01064,567.26591 912.8104,567.27679 914.60555,567.24585 917.3247,568.16122 917.7809,567.87932 922.5261,564.94663 962.8536,578.90626 974.4111,587.48223 1009.9942,613.88565 1011.1266,656.03382 976.5826,668.30541 972.5093,669.75245 973.0754,670.668 986.972,685.10941 1007.7041,706.65424 1011.336,714.86101 1004.3501,724.37765 994.8296,737.34708 963.2224,755.42514 957.7126,751.05236 z M 966.3142,718.82627 C 983.5359,707.51498 988.0104,701.65591 983.285,696.60388 981.8438,695.06304 973.8563,686.37736 965.535,677.30236 957.2137,668.22736 948.441,658.89969 946.04,656.57421 940.5455,651.25239 941.0331,649.76409 948.576,648.83332 974.1559,645.67683 982.2837,637.08295 977.4817,618.26983 969.8354,588.31332 929.0102,570.92307 879.0869,576.35673 854.6992,579.01112 847.9975,590.50506 861.3422,606.79056 865.1331,611.41685 865.1331,611.41685 863.0244,623.6096 861.8647,630.31562 860.2137,640.30236 859.3557,645.80236 858.4976,651.30236 856.2339,665.02736 854.3253,676.30236 850.1692,700.85485 850.1713,700.77498 853.6099,703.02931 861.0586,707.91258 891.722,702.43452 894.2821,695.76317 894.6249,694.86976 894.9054,684.97568 894.9054,673.77634 894.9054,643.81337 896.5041,642.264 909.4054,659.7233 914.6316,666.79593 918.0138,671.3259 922.6451,677.45611 924.1632,679.46567 927.4304,683.88212 929.9054,687.27043 932.3803,690.65875 935.8884,695.26913 937.7009,697.51573 939.5134,699.76232 942.6463,704.12088 944.6629,707.2014 956.4054,725.13882 956.5692,725.22677 966.3142,718.82627 z M 909.9054,637.25171 C 887.8001,634.2105 888.435,634.57244 888.1142,624.8291 887.7187,612.82193 885.1946,613.93403 915.5793,612.72854 955.6063,611.14049 969.9243,623.09202 942.0568,634.82998 934.5872,637.97624 922.0407,638.92127 909.9054,637.25171 z M -184.46985,745.18023 C -217.74827,741.77679 -230.38292,708.86744 -202.48356,698.26012 -201.16966,697.76058 -200.09465,696.6282 -200.09465,695.74372 -200.09465,693.36602 -203.98691,678.13767 -205.21991,675.69128 -205.80511,674.53018 -208.46334,664.85518 -211.12707,654.19128 -220.10856,618.23513 -219.38998,619.99211 -226.4716,616.67257 -233.88994,613.19519 -236.49565,608.94596 -236.55604,600.2275 -236.66179,584.96013 -220.18326,577.39738 -174.59465,571.79058 -167.99465,570.97887 -158.99465,569.85393 -154.59465,569.29071 -109.36667,563.50137 -90.30719,567.11528 -73.97682,584.5768 -68.65032,590.27225 -66.09465,591.2777 -66.09465,587.6778 -66.09465,578.57769 -54.981937,564.52964 -42.631617,560.28051 22.653033,537.8193 87.28605,559.70931 113.85478,612.17134 116.38403,617.16554 117.15732,616.79709 118.82684,609.80236 125.48628,581.90139 162.57431,549.37335 219.025,521.92361 233.18193,515.03966 229.95957,514.46742 244.81483,526.50343 287.51487,561.09979 296.16374,569.26145 295.66173,574.48601 294.75706,583.90101 285.55778,589.16617 269.83685,589.26674 264.25774,589.30243 254.42966,591.645 253.49167,593.16269 253.21689,593.60729 257.81215,600.02019 263.70336,607.41357 290.07883,640.51439 292.27161,646.58302 283.35447,661.79897 278.72506,669.69847 254.29518,687.30236 247.96203,687.30236 245.14273,687.30236 227.97159,676.88039 223.1093,672.21809 216.99233,666.35269 217.21288,666.38271 213.00575,670.84308 197.08899,687.71789 156.19506,677.74218 130.25039,650.65564 122.25719,642.31065 122.41189,642.29867 121.47204,651.33563 119.07276,674.40554 102.14926,694.99692 78.90535,703.12792 67.10146,707.25706 65.06838,707.66943 54.90535,707.99588 49.13035,708.18138 42.38035,708.7967 39.90535,709.36326 -24.72491,724.15803 -65.05396,696.03075 -35.77343,656.58151 -21.34424,637.14127 -27.38775,623.8587 -52.42052,619.99412 -58.93713,618.98808 -64.63293,614.94311 -66.73692,609.82709 -68.96803,604.40194 -69.89594,604.2485 -72.85433,608.81548 -77.08376,615.34463 -86.30843,620.75361 -95.56097,622.12973 -99.13016,622.66057 -100.53425,623.30373 -100.38705,624.34037 -98.44803,637.99592 -96.42776,641.86021 -90.83543,642.6103 -84.76245,643.42486 -82.8169,646.38236 -80.64573,658.10005 -78.52287,669.55697 -77.55938,670.96345 -71.77388,671.05091 -62.50519,671.19103 -56.14497,676.51506 -54.12541,685.82414 -53.53141,688.56216 -52.10752,693.02462 -50.96121,695.74071 -43.79882,712.71139 -57.54019,723.55505 -96.059,731.32852 -104.05361,732.94191 -120.55829,736.49361 -132.73608,739.22118 -144.91386,741.94876 -158.86386,744.45933 -163.73608,744.80023 -168.60829,745.14113 -173.49465,745.54731 -174.59465,745.70285 -175.69465,745.85838 -180.13849,745.62321 -184.46985,745.18023 z M -169.82752,723.77211 C -149.86515,719.08261 -96.27279,707.93779 -83.09465,705.73554 -68.56769,703.30788 -68.95792,705.78153 -79.65722,683.94572 -85.54927,671.92085 -89.1161,671.95545 -119.59465,684.33306 -132.80015,689.69593 -140.52642,692.2544 -141.20817,691.49014 -142.27613,690.29291 -144.23599,684.07084 -146.14959,675.80236 -148.3401,666.33733 -148.2045,666.09124 -139.59465,663.9061 -136.29465,663.06857 -130.66965,661.64759 -127.09465,660.74836 -102.79643,654.63657 -101.52613,652.2221 -113.34465,634.61375 -124.65342,617.76487 -129.64801,615.73155 -139.14503,624.11026 -146.35627,630.47234 -164.15989,643.57046 -164.76874,642.96161 -166.55852,641.17183 -170.89159,616.30236 -169.41364,616.30236 -168.53707,616.30236 -117.49788,605.67217 -109.59465,603.84356 -89.96321,599.30133 -90.33022,599.68206 -94.15909,587.83042 -97.16776,578.51757 -97.83148,578.23215 -116.37942,578.27505 -128.89846,578.30401 -145.21522,579.95033 -184.59465,585.15778 -214.09672,589.05907 -232.58906,603.26424 -214.6897,608.27575 -208.40805,610.0345 -208.75526,609.25815 -202.55994,635.39721 -199.50889,648.27004 -195.94416,663.30236 -194.63831,668.80236 -185.62524,706.76375 -185.75407,704.74676 -192.27502,705.80215 -205.59461,707.95789 -210.27879,714.98692 -204.38755,723.9781 -201.44252,728.47277 -189.53536,728.4018 -169.82752,723.77211 z M 7.73613,689.89967 C 12.86806,689.06022 18.49306,687.93489 20.23613,687.39893 24.42085,686.11223 37.66029,683.53173 46.40535,682.29829 56.90327,680.81762 66.75082,678.66982 68.15637,677.55428 68.84331,677.00908 71.05492,676.03198 73.07106,675.38295 77.06457,674.09737 84.61515,667.92302 87.99038,663.18295 93.85869,654.94167 99.11291,631.57329 96.84485,623.80236 89.94265,600.15382 74.69877,579.36889 57.99252,570.82747 31.51002,557.28775 -33.20132,559.65921 -49.94144,574.78291 -57.98257,582.04759 -62.20578,604.51456 -56.52063,609.78338 -53.44245,612.63614 -54.16202,612.51852 -40.09465,612.46823 -23.42289,612.40863 -19.31956,616.46917 -17.52514,634.80236 -15.52692,655.21778 -15.88971,656.85644 -24.04672,664.25887 -45.66213,683.87469 -30.45118,696.14611 7.73613,689.89967 z M 24.90535,664.30236 C 20.40535,663.80236 20.40535,663.80236 16.71012,638.80236 11.79877,605.57477 11.4798,602.3342 13.10479,602.17474 13.8201,602.10454 15.53035,601.86728 16.90535,601.64748 38.09303,598.26053 55.26429,602.76686 64.11196,614.03612 68.06265,619.0681 69.72768,622.27856 73.9987,633.09941 77.04079,640.80673 71.83016,657.30236 66.35348,657.30236 65.6917,657.30236 64.59004,657.97736 63.90535,658.80236 63.22066,659.62736 61.92806,660.30513 61.03291,660.30852 60.13775,660.31191 58.21323,660.93668 56.75619,661.6969 52.44092,663.94843 34.74671,665.39584 24.90535,664.30236 z M 57.69666,651.03337 C 65.88901,647.23416 66.59908,638.7954 59.82648,625.72168 56.2864,618.88796 39.2109,618.1631 39.55757,624.86126 40.38986,640.94226 41.53281,651.69136 42.61091,653.57696 43.32712,654.82961 53.04328,653.19138 57.69666,651.03337 z M 235.45535,663.45274 C 235.97785,662.98545 238.37415,661.84157 240.78046,660.91078 246.22853,658.8034 258.90228,647.54061 262.98499,641.17826 266.42873,635.81165 266.49575,636.10826 258.60681,621.80236 256.78703,618.50236 252.89499,611.30236 249.95781,605.80236 241.22877,589.4568 242.33814,590.39908 232.36977,590.86325 219.27648,591.47293 219.68183,590.95769 219.43649,607.30236 219.24982,619.73834 210.60446,630.88682 198.52456,634.26898 189.64066,636.75632 176.90445,627.54835 167.73429,612.00835 158.13167,595.73549 196.10764,571.44554 233.90535,569.68444 238.58035,569.46662 246.00535,569.0421 250.40535,568.74106 254.80535,568.44003 260.88049,568.23743 263.90567,568.29086 277.13176,568.52443 274.12542,563.8706 246.72358,541.69294 230.81435,528.81681 226.81637,527.54317 219.60889,533.05498 218.94694,533.56119 215.70535,535.03525 212.40535,536.33066 155.42125,558.69974 116.7091,610.18067 136.1761,637.70329 145.52571,650.92184 170.38371,663.78525 179.57818,660.1628 180.58312,659.76687 182.94678,659.4113 184.83076,659.37265 188.56813,659.29596 201.71598,653.29877 206.23208,649.61076 207.78677,648.34114 209.81177,647.30068 210.73208,647.29862 211.65238,647.29657 213.92306,646.36961 215.77803,645.23871 220.0723,642.62069 221.87192,643.30394 221.76013,647.5099 221.712,649.32075 222.39721,652.15236 223.28283,653.80236 224.16844,655.45236 224.8958,657.48973 224.89919,658.32985 224.91746,662.85929 232.1787,666.38316 235.45535,663.45274 z M 200.40535,624.28359 C 205.50176,622.36809 208.41416,613.45009 206.47131,605.70915 205.86855,603.30755 189.40566,602.46871 187.14973,604.72464 184.11253,607.76185 187.65436,622.86317 191.90535,625.00121 194.26525,626.18812 195.64894,626.0713 200.40535,624.28359 z M 794.9054,706.42261 C 794.9054,705.13882 768.1724,665.2268 765.4455,662.43924 763.1337,660.07612 763.1337,660.07612 753.0246,663.2168 740.2535,667.18447 739.3698,668.61633 735.9035,690.95706 735.114,696.04617 733.0407,703.11318 731.9211,704.53252 726.1767,711.81416 706.4918,701.32308 685.5931,679.84202 673.5777,667.49169 662.89715,657.11715 661.85845,656.78748 660.27125,656.28372 653.90535,648.22827 653.90535,646.72356 653.90535,646.46036 656.06925,643.44542 658.71405,640.02369 665.72755,630.94981 715.7278,565.44198 728.3405,548.80236 736.1882,538.44929 740.85324,535.32254 744.0868,536.9545 748.07837,538.96903 782.17272,584.9077 786.8208,592.12341 788.13162,594.15833 791.7493,598.9481 794.8208,602.79289 797.8924,606.63769 800.9835,610.88161 801.69,612.22382 802.3965,613.56604 805.3731,617.6203 808.3049,621.23329 811.2366,624.84628 814.174,628.83753 814.8325,630.10273 815.4909,631.36794 818.3051,635.25803 821.0862,638.74739 829.3033,649.05707 836.8104,660.65261 836.0826,661.91084 835.7101,662.55481 830.4554,668.91104 824.4054,676.03582 818.3554,683.16059 810.0587,693.11024 805.9682,698.14615 799.4322,706.19293 794.9054,709.57959 794.9054,706.42261 z M 717.2471,679.55236 C 717.4999,679.13986 718.7515,670.53924 720.0282,660.43987 722.7263,639.09591 722.5524,639.45856 730.4054,638.80553 733.7054,638.53112 739.5554,637.90292 743.4054,637.40954 767.0438,634.38025 767.2308,634.41304 771.3142,642.30236 776.4646,652.25281 788.6498,676.91197 789.2269,678.55236 789.5656,679.51486 790.5459,680.30236 791.4054,680.30236 792.2649,680.30236 793.2703,679.51486 793.6394,678.55236 794.0088,677.58986 795.6822,674.85567 797.3582,672.47637 817.6415,643.68123 817.4247,650.17821 798.9732,624.07306 796.5354,620.62418 792.5309,614.87736 790.0742,611.30236 787.6176,607.72736 784.744,603.67736 783.6886,602.30236 782.6331,600.92736 779.3497,596.42736 776.3921,592.30236 768.6172,581.45824 758.1751,567.56248 747.6566,554.06261 740.6283,545.04207 738.1793,546.96016 714.9159,579.7057 714.0966,580.85886 710.2494,586.07736 706.3664,591.30236 688.7472,615.01089 675.6565,633.08526 674.9053,634.74052 674.6303,635.34647 672.49285,638.34917 670.15535,641.41318 665.17075,647.94699 664.98335,649.21594 668.66165,651.52371 673.8318,654.76738 675.4086,655.75972 677.8083,657.28002 683.5566,660.92166 686.7758,662.93089 689.8607,664.80236 691.6738,665.90236 694.4032,667.81486 695.9258,669.05236 697.4483,670.28986 699.2217,671.30236 699.8665,671.30236 700.5113,671.30236 702.5138,672.42736 704.3165,673.80236 706.1192,675.17736 708.0445,676.30236 708.5948,676.30236 709.1451,676.30236 710.4099,677.20236 711.4054,678.30236 713.2107,680.29724 716.3754,680.97441 717.2471,679.55236 z M 727.3412,615.55236 C 727.5205,613.48986 728.8547,607.57384 730.3061,602.40564 731.7577,597.23745 732.7508,592.81438 732.513,592.57661 732.2752,592.33883 732.6787,590.26735 733.4097,587.97332 734.1406,585.67929 735.0392,582.45236 735.4064,580.80236 736.0741,577.80236 736.0741,577.80236 738.0867,580.30236 740.2066,582.93577 750.0659,593.99087 758.2836,602.949 761.7037,606.67738 762.7499,608.42067 761.7836,608.78177 733.9537,619.18177 726.9052,620.56737 727.3412,615.55236 z M 360.90535,683.54921 C 323.40107,679.75149 303.74675,664.7983 310.43999,645.15471 312.53568,639.00421 319.31936,632.53272 326.07051,630.24351 332.2277,628.15571 332.00879,630.45492 330.06374,588.30236 328.17697,547.41273 328.1017,547.00662 321.80621,543.75109 315.60101,540.54226 313.02721,529.90414 316.70968,522.68591 322.90671,510.53873 338.15759,507.85603 381.90535,511.2177 444.45005,516.02376 464.45085,522.48852 475.70195,541.53513 477.84365,545.16078 478.36365,545.03429 479.74225,540.55236 481.94255,533.39905 500.93295,523.37298 519.06975,519.7893 523.10435,518.99209 528.34435,517.64947 530.71435,516.8057 535.89255,514.96207 534.71355,514.27795 550.45115,528.25721 564.49185,540.72916 563.82495,538.96212 562.35395,559.79477 560.92735,579.99942 560.33395,577.94257 569.60185,584.91782 580.86945,593.39806 581.17185,593.14167 582.82315,573.70724 583.24815,568.70493 583.91925,564.08883 584.31455,563.44924 584.70985,562.80966 585.42375,558.35246 585.90105,553.54436 589.06035,521.71658 588.49285,522.92535 599.83955,523.8563 619.81755,525.4954 657.80735,545.80026 665.13035,558.75307 666.25715,560.74609 640.74095,627.83297 632.80145,643.75205 623.73665,661.92722 613.94255,675.07871 606.59775,678.93802 603.39615,680.62031 605.52785,682.14307 583.01095,662.08907 571.96475,652.25115 564.10845,646.29937 562.17525,646.30434 561.14085,646.307 547.33675,655.95203 526.39785,671.30236 524.52225,672.67736 521.37555,674.92736 519.40535,676.30236 517.43515,677.67736 514.21135,680.03457 512.24145,681.54061 505.17845,686.94058 488.33805,677.74091 480.82905,664.38039 478.26665,659.82123 476.90535,659.9368 476.90535,664.71349 476.90535,671.70651 469.07195,678.62548 457.40535,681.93707 452.02655,683.46386 373.08617,684.78265 360.90535,683.54921 z M 454.90535,658.23244 C 454.90535,654.90369 449.31485,631.61877 448.20755,630.3353 446.93245,628.85744 418.54065,631.44007 402.12805,634.52686 388.28295,637.13079 388.85065,637.61623 388.25295,622.66321 387.63895,607.30502 386.02735,608.50002 408.35255,607.75972 437.12505,606.80562 438.47975,604.49546 425.57525,578.38902 419.30515,565.70424 415.33875,563.93654 405.90535,569.62278 380.02905,585.22048 375.91705,585.14035 376.63075,569.05236 377.19635,556.30236 377.19635,556.30236 415.55085,556.30236 461.11665,556.30236 458.34095,557.05119 457.27485,545.04597 456.27125,533.7436 453.69975,532.06446 432.40535,528.80634 426.90535,527.96482 419.70535,526.8316 416.40535,526.28808 395.33525,522.81777 354.01559,521.23246 342.59154,523.45606 331.04545,525.70342 325.78193,533.12335 332.93975,537.06209 340.8956,541.43996 340.50836,540.41975 341.45788,559.50374 344.32708,617.17054 342.66269,638.78758 335.33274,639.05669 323.47005,639.49222 320.90535,641.45851 320.90535,650.11784 320.90535,659.77338 325.28491,661.23894 353.90535,661.16089 418.64585,660.98432 440.74475,661.21106 446.40535,662.10994 453.77225,663.27976 454.90535,662.76286 454.90535,658.23244 z M 504.18745,661.80848 C 509.23325,659.466 519.64725,651.68964 532.31855,640.80236 558.35395,618.43261 555.71365,618.44605 577.27765,640.57352 595.81365,659.59379 598.49155,660.38495 603.43825,648.30236 604.45155,645.82736 605.80695,643.12736 606.45025,642.30236 608.05165,640.24849 612.90535,629.69637 612.90535,628.26858 612.90535,627.63188 613.56625,625.91651 614.37405,624.45665 616.21955,621.12134 620.08475,611.6356 622.79015,603.80236 623.92985,600.50236 625.52855,596.00236 626.34285,593.80236 627.15715,591.60236 628.99015,586.65236 630.41615,582.80236 631.84215,578.95236 634.09115,572.87736 635.41395,569.30236 636.73675,565.72736 638.73845,560.33371 639.86215,557.31648 642.52945,550.15489 642.87225,550.92591 635.15535,546.73061 631.44285,544.71231 627.21925,542.23979 625.76955,541.23612 621.84245,538.51737 611.38705,534.48026 604.69125,533.09726 598.00855,531.71698 596.93545,532.3681 596.93665,537.80236 596.93695,539.45236 596.27895,545.07736 595.47425,550.30236 592.57985,569.09702 590.67005,587.32286 590.77215,595.17581 590.80345,597.5812 590.22605,600.7312 589.48905,602.17581 588.75195,603.62041 588.34765,606.15236 588.59045,607.80236 589.72345,615.50074 586.72585,615.36236 578.75765,607.34843 570.35515,598.89771 560.79875,592.29552 557.00035,592.3171 553.80125,592.33528 552.04105,593.33124 542.75375,600.37809 538.71215,603.44474 533.98585,606.93224 532.25095,608.12809 526.20555,612.29516 523.55435,610.13622 526.29755,603.28009 527.18185,601.07008 527.91065,596.68349 527.91725,593.53212 527.92375,590.38075 528.57475,585.3763 529.36395,582.41111 530.15315,579.44592 530.55255,575.78839 530.25155,574.28328 529.95055,572.77816 530.21185,570.59817 530.83225,569.43886 532.03205,567.19704 534.89045,547.29717 535.62705,536.05871 536.43945,523.66123 518.79775,523.93 494.12055,536.69106 487.09715,540.32302 487.24225,556.40405 494.49285,577.96249 499.65275,593.30422 500.52135,598.30089 499.00665,603.92614 498.39895,606.18284 497.66755,610.38244 497.38125,613.2586 497.09495,616.13476 496.24715,619.68372 495.49715,621.14517 494.74725,622.60663 493.60145,626.50236 492.95095,629.80236 492.30055,633.10236 491.03765,637.37736 490.14455,639.30236 487.50825,644.98449 488.62495,657.60081 492.15815,662.05236 493.51565,663.76279 500.27295,663.62579 504.18745,661.80848 z M 480.76025,635.31292 C 488.66585,622.05891 489.93865,607.14461 484.81885,587.75424 483.08315,581.1807 481.20605,573.55236 480.64735,570.80236 479.23605,563.85468 478.59155,563.54948 474.33025,567.81079 468.58945,573.55158 460.96545,576.55982 451.40535,576.85635 446.33265,577.01369 443.44195,577.5066 443.50535,578.20342 443.56035,578.80784 443.67285,583.1093 443.75535,587.76222 443.90535,596.22208 443.90535,596.22208 448.04105,597.46116 454.55875,599.41392 456.00835,602.66288 455.77805,614.80236 455.53465,627.63462 455.95745,628.89517 460.76275,629.66356 465.88955,630.48338 470.97985,634.07361 473.40535,638.58062 476.00555,643.41224 475.90165,643.45839 480.76025,635.31292 z"
+       style="fill:#a05116"
+       sodipodi:nodetypes="sscsssssssssssssssssssssssssssssssssssssssssssssssssssscssssccsssssssssssssccssssssscssscssscsssssssssssccsssssssccsssscssssssssccsscssccsssscssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssscssssssssssscsccssssssscsccssssscsssccscsccccscsssccccsssccsccccccsssssssssssscsssssssssssssssssssscsssssssssssssssssssssscscsssscscscscccssssccssccsscsccccssscsscssssss" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path3851"
+       d="M -522.09465,847.72778 C -540.13249,844.46729 -551.47942,838.2229 -565.35896,823.91877 -571.98148,817.09366 -582.08972,804.46587 -582.11446,802.98685 -582.12535,802.33538 -582.59784,798.65236 -583.16443,794.80236 -597.68191,696.15567 -602.28805,619.14684 -595.48593,588.80236 -581.1576,524.88309 -539.61579,506.04275 -498.97265,545.03097 -488.57063,555.00945 -476.86867,548.93012 -473.65584,531.87853 -469.65452,510.64221 -463.70371,502.03813 -447.75698,494.43221 -423.32451,482.77897 -427.68475,483.90332 -412.08358,485.23329 -363.12514,489.4069 -342.62575,505.19814 -301.82411,570.16922 -297.38911,577.23136 -280.09465,607.30051 -280.09465,607.94932 -280.09465,608.19474 -278.10803,611.86208 -275.67994,616.09895 -258.20601,646.58991 -234.34088,695.61953 -232.99039,703.80236 -227.12427,739.34598 -234.95011,763.74999 -260.80923,790.55236 -266.94764,796.91467 -266.38453,796.72437 -274.66099,795.23352 -301.40838,790.41548 -334.02679,756.88693 -368.96093,698.30236 -382.17312,676.14551 -382.43914,675.76873 -384.62063,676.12234 -385.70634,676.29832 -395.03215,679.13011 -405.34465,682.41519 -425.66594,688.8886 -425.80277,688.98911 -422.24188,694.82828 -391.75462,744.82145 -413.25847,803.35912 -476.61739,842.849 -483.63694,847.22409 -509.51979,850.00079 -522.09465,847.72778 z M -519.8157,818.81739 C -473.75626,808.13549 -451.30346,770.13269 -462.05419,721.05236 -462.62644,718.43986 -463.52281,714.38986 -464.04611,712.05236 -464.56941,709.71486 -466.59441,703.10144 -468.54611,697.35588 -472.9311,684.44697 -472.95786,685.19415 -467.91458,679.72284 -456.53842,667.38115 -436.82412,654.86736 -430.09465,655.71636 -418.85522,657.13433 -390.81749,659.27897 -383.37376,659.29008 -375.15287,659.30236 -375.15287,659.30236 -371.99671,669.55236 -363.51647,697.09301 -346.4852,723.32074 -321.73205,746.95866 -302.04966,765.75428 -298.42932,766.59797 -287.37862,754.96446 -257.89003,723.92065 -257.8275,705.84141 -287.04149,657.49691 -314.57896,611.92679 -338.59025,573.8371 -377.88518,513.38938 -388.21358,497.50112 -391.66807,495.51852 -410.59465,494.61683 -431.20059,493.63514 -460.19599,509.69671 -460.0651,522.02024 -459.94546,533.28437 -442.42966,572.58419 -427.93684,594.10573 -418.59399,607.97967 -417.57796,607.17511 -444.28494,607.05134 -457.014,606.99236 -471.44372,607.51111 -477.8863,608.25933 -490.94904,609.77638 -490.59816,609.95308 -493.57628,600.35814 -494.52472,597.30246 -496.82935,591.55266 -498.69768,587.58081 -500.56601,583.60896 -502.09243,580.00896 -502.08972,579.58081 -502.02872,569.9441 -522.01718,545.49499 -533.61941,541.0149 -573.88559,525.46652 -593.76603,567.8967 -585.29402,651.30236 -583.03659,673.5264 -581.04187,690.50483 -579.06729,704.30236 -575.64032,728.24863 -568.31121,784.57798 -567.61746,792.30236 -565.61109,814.64186 -546.80085,825.07567 -519.8157,818.81739 z M 1209.4054,827.32372 C 1187.5954,826.37302 1169.2119,824.11375 1144.4054,819.33545 1070.9866,805.1933 1001.6735,748.90315 1022.9042,720.66266 1054.5002,678.63454 1087.6297,653.4075 1111.3853,653.28705 1117.761,653.25472 1117.8437,651.82624 1111.8313,645.58687 1093.8636,626.94093 1079.6364,600.6839 1083.432,593.17491 1108.7757,543.03822 1258.9377,504.38951 1337.0889,527.88871 1350.4134,531.89525 1398.9343,663.12816 1390.7411,673.00031 1384.6349,680.35775 1368.371,686.94668 1352.9054,688.32843 1347.1303,688.84439 1339.0304,689.55915 1334.9054,689.91679 1321.2778,691.09832 1321.7907,697.66818 1337.3947,721.80236 1339.884,725.65236 1342.8206,730.37736 1343.9208,732.30236 1345.0207,734.22736 1348.4386,739.85236 1351.5158,744.80236 1362.7867,762.93297 1367.489,775.84853 1366.6062,786.25014 1365.771,796.09044 1367.1131,794.48004 1350.348,805.75739 1321.1464,825.40028 1286.5887,830.68813 1209.4054,827.32372 z M 1301.3582,788.84548 C 1336.7813,779.4423 1347.8224,754.33125 1330.9641,721.51171 1319.7877,699.75354 1309.6466,691.69554 1248.9054,656.30823 1165.3836,607.64924 1169.4691,592.01126 1257.9054,621.8584 1293.1914,633.76736 1306.1339,638.41255 1311.3419,641.0372 1321.9131,646.3648 1346.1892,654.4717 1349.6354,653.82519 1367.3434,650.50314 1356.5133,572.5652 1334.9274,547.98018 1331.1346,543.66043 1328.7879,542.76208 1316.4054,540.88976 1227.6702,527.4724 1174.6555,538.80721 1112.7739,584.42715 1099.4558,594.24544 1100.7716,610.3989 1116.2406,626.98335 1126.557,638.04382 1131.1573,640.93346 1194.3747,676.06312 1218.3129,689.36546 1236.9054,702.67099 1236.9054,706.49971 1236.9054,708.24346 1224.8276,706.8829 1209.4054,703.40184 1207.2054,702.90526 1203.3803,702.05286 1200.9054,701.50763 1190.2227,699.15425 1172.2629,694.19548 1157.4054,689.49708 1087.8982,667.5168 1095.011,667.0811 1073.074,694.66284 1027.0079,752.58257 1027.8975,750.18497 1050.5309,755.423 1055.4119,756.55261 1063.6804,758.52823 1068.9054,759.81327 1078.8911,762.26918 1091.6711,765.18945 1103.4054,767.69668 1116.4927,770.49298 1134.3921,774.37623 1138.4054,775.28986 1162.3292,780.73612 1211.624,788.77102 1236.4054,791.26351 1254.9349,793.1272 1290.1697,791.8155 1301.3582,788.84548 z M 957.7126,751.05236 C 956.8464,750.36486 953.3158,745.30236 949.8668,739.80236 941.4107,726.31729 926.5077,704.4545 923.4131,700.99447 920.2088,697.41178 919.522,697.92043 917.996,705.00672 914.9834,718.99606 915.7981,717.8318 905.618,722.69694 873.8803,737.86454 846.2982,729.9276 839.9563,703.80236 838.822,699.12974 839.239,696.09919 846.324,657.51696 850.4938,634.81 853.9054,615.02607 853.9054,613.55268 853.9054,611.19207 854.0805,611.04897 855.3799,612.34825 856.6791,613.64753 856.3869,616.36526 852.92,635.22297 850.7561,646.99311 849.1825,656.94169 849.4229,657.33092 849.6636,657.72015 848.2986,666.53546 846.3898,676.92049 842.1868,699.78659 842.1052,702.19791 845.4017,706.11556 852.0602,714.02882 868.5164,715.22471 886.3176,709.08899 901.3195,703.91814 902.9054,701.26467 902.9054,681.33448 902.9054,661.96678 901.1497,660.85722 927.3811,696.80236 930.9935,701.75236 935.1767,707.43266 936.6772,709.42525 938.1777,711.41784 941.8541,716.47 944.8471,720.65227 955.2069,735.12884 963.1746,733.86269 985.1845,714.24223 998.8148,702.09164 998.5247,701.28498 969.3893,670.32146 954.7707,654.78583 955.3166,655.65655 959.6554,654.79335 984.8755,649.77581 993.6782,630.0449 981.3432,606.18054 956.6574,558.42109 831.4996,552.81071 848.021,600.20418 849.6456,604.86437 848.4399,605.06712 845.502,600.62775 830.3849,577.78425 873.1461,556.5963 912.8104,567.27679 915.0881,567.89009 917.3247,568.16122 917.7809,567.87932 922.5261,564.94663 962.8536,578.90626 974.4111,587.48223 1009.9942,613.88565 1011.1266,656.03382 976.5826,668.30541 972.5093,669.75245 973.0754,670.668 986.972,685.10941 1007.7041,706.65424 1011.336,714.86101 1004.3501,724.37765 994.8296,737.34708 963.2224,755.42514 957.7126,751.05236 z M -184.46985,745.18023 C -208.7742,742.69459 -226.90796,722.22981 -214.93195,710.80236 -214.20538,710.10907 -214.09696,710.81271 -214.57845,713.0965 -218.59016,732.12468 -202.23873,739.08826 -170.86327,731.71348 -148.51068,726.45951 -97.514,715.76246 -83.08711,713.30157 -60.23003,709.40269 -59.52283,707.90587 -70.05593,685.72042 -76.91922,671.26454 -76.79673,671.71922 -74.02345,670.99399 -66.00128,668.89615 -56.05483,676.36023 -54.05857,685.97617 -53.43616,688.9743 -52.01374,693.4917 -50.89764,696.01484 -43.60053,712.51115 -57.78817,723.60509 -96.059,731.32852 -104.05361,732.94191 -120.55829,736.49361 -132.73608,739.22118 -144.91386,741.94876 -158.86386,744.45933 -163.73608,744.80023 -168.60829,745.14113 -173.49465,745.54731 -174.59465,745.70285 -175.69465,745.85838 -180.13849,745.62321 -184.46985,745.18023 z M -10.84099,712.87673 C -42.64385,706.80949 -54.00064,681.19524 -35.80105,656.58151 -31.82413,651.20298 -27.96169,645.45236 -27.21786,643.80236 -25.86544,640.80236 -25.86544,640.80236 -24.89778,643.30236 -22.53763,649.39993 -24.38559,654.10674 -31.91934,661.18649 -39.56823,668.37443 -40.64952,670.86804 -40.44915,680.85729 -40.05822,700.34692 -18.31938,704.58505 25.90535,693.79355 29.48035,692.9212 38.03035,691.36228 44.90535,690.32929 86.15609,684.13124 99.95744,671.43987 104.92846,635.13356 107.29996,617.81309 90.39785,583.89597 73.2707,571.60661 66.08466,566.45036 65.65283,564.51048 72.53139,568.28549 88.5881,577.09752 104.82494,594.34121 113.85478,612.17134 116.38403,617.16554 117.15732,616.79709 118.82684,609.80236 121.37357,599.13236 143.20908,567.30236 147.98202,567.30236 149.58849,567.30236 149.01817,568.26601 144.55362,573.0952 97.15669,624.36331 145.406,693.46919 204.72131,659.27137 213.46203,654.23198 214.60862,654.39324 217.07298,661.00851 222.79846,676.37785 240.4052,674.48656 260.03137,656.39398 277.47721,640.31136 277.47406,640.63587 260.49225,609.00603 253.77596,596.49647 255.16495,596.48425 265.00595,608.96632 290.04079,640.71988 292.14943,646.7915 283.35447,661.79897 278.72506,669.69847 254.29518,687.30236 247.96203,687.30236 245.14273,687.30236 227.97159,676.88039 223.1093,672.21809 216.99233,666.35269 217.21288,666.38271 213.00575,670.84308 197.08899,687.71789 156.19506,677.74218 130.25039,650.65564 122.25719,642.31065 122.41189,642.29867 121.47204,651.33563 119.07276,674.40554 102.14926,694.99692 78.90535,703.12792 67.10146,707.25706 65.06838,707.66943 54.90535,707.99588 49.13035,708.18138 42.38035,708.7967 39.90535,709.36326 21.1445,713.65788 0.68035,715.07474 -10.84099,712.87673 z M 794.9054,706.42261 C 794.9054,705.13882 768.1724,665.2268 765.4455,662.43924 763.1337,660.07612 763.1337,660.07612 753.0246,663.2168 740.2535,667.18447 739.3698,668.61633 735.9035,690.95706 735.114,696.04617 733.0407,703.11318 731.9211,704.53252 726.4325,711.48992 706.4671,701.32908 687.7421,682.04878 676.9272,670.91325 668.47565,661.65706 668.96075,661.47947 669.44585,661.30188 676.0442,665.04867 683.624,669.80568 714.1447,688.96033 713.1097,688.39846 717.3054,688.08952 723.559,687.62907 724.5576,685.37236 727.3331,665.42963 730.2376,644.55912 728.3126,646.65258 746.341,644.75889 764.909,642.80853 761.9985,640.69859 773.9713,664.78919 789.6328,696.30187 790.564,696.40705 809.5043,668.80236 822.7594,649.48349 823.8616,646.40177 819.6978,640.30236 813.0131,630.51014 816.2599,631.98566 823.7997,642.16642 832.6021,654.05218 836.759,660.74222 836.0757,661.92316 835.7071,662.56035 830.4554,668.91104 824.4054,676.03582 818.3554,683.16059 810.0587,693.11024 805.9682,698.14615 799.4322,706.19293 794.9054,709.57959 794.9054,706.42261 z M -208.75374,702.49815 C -207.74123,701.36835 -205.37873,699.71599 -203.50374,698.82624 -201.62874,697.9365 -200.09465,696.51711 -200.09465,695.67206 -200.09465,693.34943 -204.00667,678.09845 -205.21991,675.69128 -205.80511,674.53018 -208.46334,664.85518 -211.12707,654.19128 -220.10856,618.23513 -219.38998,619.99211 -226.4716,616.67257 -233.88994,613.19519 -236.49565,608.94596 -236.55604,600.2275 -236.66179,584.96013 -220.18326,577.39738 -174.59465,571.79058 -167.99465,570.97887 -158.99465,569.85393 -154.59465,569.29071 -109.2645,563.4883 -88.07067,567.65674 -73.19282,585.30099 -70.87335,588.05174 -68.27553,590.30236 -67.4199,590.30236 -66.11446,590.30236 -65.97273,591.22732 -66.53884,596.05236 -67.4136,603.50811 -67.96934,605.29964 -69.41204,605.31474 -70.06247,605.32155 -71.6115,606.89688 -72.85433,608.81548 -77.08376,615.34463 -86.30843,620.75361 -95.56097,622.12973 -99.13016,622.66057 -100.53425,623.30373 -100.38705,624.34037 -98.44803,637.99592 -96.42776,641.86021 -90.83543,642.6103 -85.24041,643.36075 -82.75222,646.58975 -81.19813,655.11692 -80.52799,658.79391 -79.71469,662.88295 -79.39079,664.20366 -78.8237,666.51602 -78.9601,666.58375 -83.07326,666.03205 -85.42252,665.71695 -88.30089,665.84052 -89.46965,666.30665 -90.6384,666.77278 -96.76965,668.80983 -103.09465,670.83342 -109.41965,672.85702 -119.24732,676.3152 -124.93392,678.51826 -136.50084,682.99943 -137.04828,682.8934 -137.82282,676.0217 -138.36734,671.19067 -135.57532,669.7308 -119.04881,666.20532 -100.50507,662.24951 -93.6929,651.69569 -101.27499,638.66905 -104.81322,632.59009 -113.03211,621.11995 -116.39536,617.56734 -120.17963,613.57 -120.07402,613.46759 -109.88877,611.25764 -84.17433,605.67824 -80.95576,602.55878 -85.68831,587.80236 -92.21401,567.45479 -94.98993,567.08585 -172.59465,576.25211 -222.38888,582.13354 -247.63778,601.7809 -221.0722,613.97478 -214.5836,616.95311 -214.72077,616.72647 -212.09811,628.80236 -211.50085,631.55236 -207.60557,648.17171 -203.44191,665.73424 -195.21412,700.43955 -195.22211,700.29464 -201.53578,700.3061 -202.66816,700.30815 -205.16965,701.2644 -207.09465,702.43109 -210.5351,704.51626 -210.56333,704.5174 -208.75374,702.49815 z M 360.90535,683.54921 C 322.94212,679.70501 303.09593,664.22037 310.70973,644.38496 311.64232,641.95539 312.97142,639.7792 313.66329,639.54898 314.62585,639.22869 314.68455,639.7529 313.91329,641.78148 310.48517,650.79813 313.89895,660.76818 321.75894,664.69495 329.29969,668.46223 329.75051,668.48703 395.35575,668.74498 472.64235,669.04885 466.19905,671.53679 459.95195,643.80236 458.19325,635.99421 457.38665,630.43577 457.93245,629.88446 460.54795,627.24246 471.60635,633.75208 473.89695,639.28211 475.61005,643.41789 476.23785,643.1469 479.87545,636.70129 483.81475,629.72127 484.43375,630.21225 482.45445,638.74685 476.60805,663.95593 488.05535,676.84452 508.32855,667.87876 515.19195,664.84341 520.94235,660.61765 539.15015,645.22901 557.78445,629.4799 554.91865,629.31901 572.64855,647.10965 599.74045,674.29432 605.06315,671.35546 625.72775,617.80236 652.74535,547.78518 652.92255,547.00537 642.97825,541.86668 617.61905,528.76232 609.99135,523.69355 628.64825,532.34405 641.09435,538.11483 662.03075,553.27045 665.13035,558.75307 666.25715,560.74609 640.74095,627.83297 632.80145,643.75205 623.73665,661.92722 613.94255,675.07871 606.59775,678.93802 603.39615,680.62031 605.52785,682.14307 583.01095,662.08907 571.96475,652.25115 564.10845,646.29937 562.17525,646.30434 561.14085,646.307 547.33675,655.95203 526.39785,671.30236 524.52225,672.67736 521.37555,674.92736 519.40535,676.30236 517.43515,677.67736 514.21135,680.03457 512.24145,681.54061 505.17845,686.94058 488.33805,677.74091 480.82905,664.38039 478.26665,659.82123 476.90535,659.9368 476.90535,664.71349 476.90535,671.70651 469.07195,678.62548 457.40535,681.93707 452.02655,683.46386 373.08617,684.78265 360.90535,683.54921 z M 28.2249,656.18739 C 26.88601,654.57413 20.51734,611.75588 21.30931,609.69205 22.0704,607.70867 37.94625,607.82837 44.81882,609.8693 60.28415,614.46201 72.63071,640.03155 63.69684,648.96541 58.08286,654.57939 31.39914,660.01212 28.2249,656.18739 z M 57.69666,651.03337 C 65.88901,647.23416 66.59908,638.7954 59.82648,625.72168 56.2864,618.88796 39.2109,618.1631 39.55757,624.86126 40.38986,640.94226 41.53281,651.69136 42.61091,653.57696 43.32712,654.82961 53.04328,653.19138 57.69666,651.03337 z M 654.43165,648.14162 C 653.96485,646.98757 656.26895,643.17384 661.98365,635.64162 673.3264,620.69136 676.3743,617.86073 668.18485,629.88253 664.51625,635.26779 657.70175,645.57661 656.25435,647.93049 655.21225,649.62539 655.03985,649.64535 654.43165,648.14162 z M -30.95221,630.64712 C -32.79887,628.79259 -36.95669,626.04384 -40.1918,624.5388 -47.95109,620.92902 -47.63871,620.30236 -38.07995,620.30236 -28.92222,620.30236 -26.1062,622.71141 -26.09839,630.55236 -26.09392,635.0304 -26.57813,635.03985 -30.95221,630.64712 z M 321.36646,632.21003 C 322.44508,631.52619 325.14508,630.42875 327.36646,629.77127 332.05167,628.38457 331.9707,629.62939 330.06374,588.30236 328.17697,547.41273 328.1017,547.00662 321.80621,543.75109 315.60101,540.54226 313.02721,529.90414 316.70968,522.68591 322.90671,510.53873 338.15759,507.85603 381.90535,511.2177 444.45005,516.02376 464.45085,522.48852 475.70195,541.53513 477.86045,545.18927 478.36745,545.04104 479.77465,540.34434 481.71965,533.85253 483.20105,534.21039 482.24135,540.94021 480.39515,553.88635 481.36475,562.77282 486.20885,577.30236 491.66815,593.67734 491.97685,595.69463 490.53795,605.59439 489.17835,614.94819 487.52045,615.37794 487.80675,606.30236 487.95305,601.66426 487.10245,596.36501 484.83745,587.80236 483.09155,581.20236 481.20605,573.55236 480.64735,570.80236 479.23605,563.85468 478.59155,563.54948 474.33025,567.81079 468.58945,573.55158 460.96545,576.55982 451.40535,576.85635 446.33265,577.01369 443.44195,577.5066 443.50535,578.20342 443.56035,578.80784 443.67285,583.1093 443.75535,587.76222 443.90535,596.22208 443.90535,596.22208 448.04105,597.46116 454.22655,599.31439 455.89695,602.74054 455.90165,613.58374 455.90565,623.03902 455.06425,624.52816 450.95935,622.33126 449.33985,621.46455 443.63755,621.83106 426.13125,623.92705 394.27235,627.74143 396.40535,627.89389 396.40535,621.80236 396.40535,616.0703 397.82765,615.5692 414.60615,615.38997 443.08405,615.08575 447.65695,602.05701 430.35465,570.52045 426.25505,563.04813 425.18595,563.63807 444.19895,562.88064 466.14525,562.00635 469.42905,557.35162 463.79355,535.10598 459.18615,516.91881 339.9261,507.19251 325.27462,523.80901 319.58448,530.2623 319.98691,535.67885 326.55908,541.09705 328.67453,542.84106 331.13906,544.89692 332.03582,545.66564 338.35145,551.07948 335.28404,630.92716 328.73685,631.54123 325.80452,631.81626 322.50535,632.359 321.40535,632.74732 319.43579,633.44263 319.4352,633.43445 321.36646,632.21003 z M 812.0277,628.78886 C 810.331,626.85644 808.2406,623.81894 807.3824,622.03886 805.3609,617.84622 812.1297,624.97003 814.5214,629.55236 816.4418,633.23165 815.7398,633.01673 812.0277,628.78886 z M 903.4054,628.98602 C 895.6326,627.14596 893.2286,623.80533 897.884,621.31377 901.1992,619.5396 933.5477,618.95249 939.4042,620.5602 957.5189,625.53297 922.9739,633.6185 903.4054,628.98602 z M -160.68344,626.8046 C -161.68102,622.82995 -160.70824,621.84393 -154.50597,620.54299 -146.45222,618.8537 -145.79838,620.25887 -152.34002,625.19786 -158.66686,629.97467 -159.83151,630.19896 -160.68344,626.8046 z M 181.48393,617.98135 C 171.72081,607.63792 171.96309,604.74698 183.40535,595.05497 199.08126,581.7769 211.72886,578.16216 250.33523,575.9261 293.37424,573.43331 293.4005,570.06321 250.65236,535.22083 231.23109,519.3913 233.11045,519.85767 216.1821,526.66687 191.75563,536.49209 190.81143,536.32885 211.25481,525.81496 233.30362,514.47541 229.899,514.41705 244.6729,526.38783 287.53534,561.11781 296.16413,569.25741 295.66173,574.48601 294.74863,583.98874 285.66352,589.1144 269.40535,589.29938 266.10535,589.33693 260.93035,590.23775 257.90535,591.3012 252.77107,593.10617 252.33886,593.12222 251.40535,591.54258 247.06822,584.20342 244.40743,583.01292 233.62559,583.58745 213.66835,584.6509 212.46747,585.66574 211.52964,602.26017 210.87253,613.8874 209.25294,620.30236 206.9745,620.30236 206.49078,620.30236 206.33619,617.64251 206.63098,614.39157 207.63756,603.29076 207.28232,602.91145 196.63217,603.71543 191.59137,604.09596 187.34738,604.527 187.20108,604.67329 186.48641,605.38796 186.55344,617.1436 187.28592,619.55236 188.53943,623.67454 186.28034,623.06285 181.48393,617.98135 z M 799.4621,611.07985 C 797.5289,608.31995 797.434,606.66621 799.2973,608.21267 800.5609,609.26136 802.2053,613.30236 801.3685,613.30236 801.1762,613.30236 800.3183,612.30223 799.4621,611.07985 z M 737.9054,606.24783 C 737.9054,597.54679 741.3945,594.45491 745.3545,599.64675 749.2494,604.75326 748.5089,606.18473 741.1554,607.7635 738.2574,608.38569 737.9054,608.22151 737.9054,606.24783 z M 576.31415,594.27423 C 563.26695,583.34857 553.06615,582.46287 541.92325,591.28818 536.38095,595.67779 535.50615,595.3253 536.37435,589.05236 537.64755,579.85347 538.93955,570.98012 539.90535,564.80236 546.41855,523.13978 546.97095,525.79155 530.42715,519.30499 527.20295,518.04082 527.88725,517.17007 533.07235,515.93908 535.41275,515.38345 537.31115,516.69075 548.57235,526.613 564.66885,540.79554 563.87995,538.89923 562.37665,559.79477 560.92325,579.99649 560.33215,577.94125 569.60185,584.91782 578.74745,591.80094 580.11095,592.05591 580.95845,587.04132 582.29085,579.15762 583.16975,580.84569 582.91665,590.80236 582.71405,598.77112 582.08145,599.10377 576.31415,594.27423 z M 583.34485,568.84276 C 584.08975,562.46965 585.90535,560.39101 585.90535,565.91123 585.90535,568.11611 585.19875,570.79361 584.33525,571.86123 582.87165,573.67067 582.80445,573.46589 583.34485,568.84276 z M 384.31655,568.8046 C 383.15125,564.16161 384.26635,563.30236 391.45725,563.30236 399.54865,563.30236 399.65115,564.64241 391.85425,568.49416 385.08075,571.84034 385.07855,571.84043 384.31655,568.8046 z M 33.40535,556.20656 C 24.98097,554.75661 8.92673,554.30084 -1.59465,555.21293 -12.1692,556.12962 -17.74345,555.15166 -10.56538,553.63908 -3.87848,552.23 27.68548,552.63307 34.40535,554.21336 44.81453,556.66124 44.11764,558.05028 33.40535,556.20656 z M 738.9054,538.4248 C 738.9054,536.40224 741.8514,535.01271 743.4054,536.30236 745.7282,538.2302 745.1922,539.30236 741.9054,539.30236 740.2553,539.30236 738.9054,538.90746 738.9054,538.4248 z M 588.90535,528.60812 C 588.90535,524.74856 590.55935,523.29 594.85535,523.36117 598.04685,523.41404 598.20645,523.54027 596.43575,524.61117 595.35245,525.26632 593.21495,527.08745 591.68575,528.65812 588.90535,531.51387 588.90535,531.51387 588.90535,528.60812 z M 609.90535,526.5815 C 607.07905,526.07448 604.64575,524.25726 606.95535,524.37844 607.75285,524.42028 609.98035,525.06105 611.90535,525.80236 615.39305,527.14547 614.65395,527.43339 609.90535,526.5815 z"
+       style="fill:#211c19" />
+  </g>
+</svg>
Binary file share/hedgewars/Data/Graphics/knife.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Graphics/knife.svg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="88.075012"
+   height="87.070312"
+   id="svg3752">
+  <defs
+     id="defs3754" />
+  <metadata
+     id="metadata3757">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(-2.1662407,-506.55386)"
+     id="layer1">
+    <path
+       d="M 2.1662407,543.58023 13.199835,541.19373 13.168135,543.54718 z"
+       id="path3402-7-9"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.1972407,543.59572 13.199835,545.92022 13.190305,543.47379 z"
+       id="path3402-8-4-8"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 16.470727,543.54525 13.168845,541.186 13.176945,543.53944 z"
+       id="path3402-9-7-0"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 16.387977,543.54414 13.168845,545.91247 13.176945,543.46606 z"
+       id="path3402-8-9-0-1"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(1.1667397,0,0,1.1667424,-8.6954437,341.10327)"
+       id="path4221-8-4"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182015"
+       height="1.4025967"
+       x="15.452051"
+       y="542.81061"
+       id="rect4268-6"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705657"
+       height="1.8286022"
+       x="15.834251"
+       y="542.58386"
+       id="rect4219-8-6"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.2582467,558.06679 12.614252,553.5736 13.042291,555.88802 z"
+       id="path3402-7-0-4"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.2916667,558.07593 13.53634,558.20926 13.049721,555.81172 z"
+       id="path3402-8-4-4-2"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 16.281044,555.24182 12.582342,553.57206 13.049421,555.8787 z"
+       id="path3402-9-7-8-5"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 16.199674,555.25687 13.50443,558.20772 13.035101,555.80672 z"
+       id="path3402-8-9-0-7-7"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(1.1443211,-0.22762015,0.22761962,1.1443238,-47.895948,361.59938)"
+       id="path4221-8-5-2"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182025"
+       height="1.4025966"
+       x="-93.372536"
+       y="547.01453"
+       transform="matrix(0.98078519,-0.19509076,0.19508988,0.98078537,0,0)"
+       id="rect4268-2-5"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705662"
+       height="1.8286021"
+       x="-92.990326"
+       y="546.78778"
+       transform="matrix(0.98078519,-0.19509076,0.19508988,0.98078537,0,0)"
+       id="rect4219-8-3-4"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.2916667,574.18969 11.572105,567.76248 12.443443,569.94892 z"
+       id="path3402-7-0-2-3"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.3262267,574.19215 13.380841,572.12918 12.435843,569.87263 z"
+       id="path3402-8-4-4-7-8"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 15.493896,568.6833 11.540505,567.76719 12.448613,569.93841 z"
+       id="path3402-9-7-8-6-6"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 15.417026,568.71394 13.349251,572.13389 12.420533,569.8706 z"
+       id="path3402-8-9-0-7-0-9"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(1.0779269,-0.44649298,0.44649193,1.0779294,-85.227629,391.28198)"
+       id="path4221-8-5-0-7"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182039"
+       height="1.4025962"
+       x="-204.32942"
+       y="530.58929"
+       transform="matrix(0.92387922,-0.3826842,0.38268266,0.92387985,0,0)"
+       id="rect4268-2-0-3"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705676"
+       height="1.8286016"
+       x="-203.94722"
+       y="530.36255"
+       transform="matrix(0.92387922,-0.3826842,0.38268266,0.92387985,0,0)"
+       id="rect4219-8-3-3-5"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.2916667,593.46239 10.139897,585.34813 11.421044,587.32256 z"
+       id="path3402-7-0-2-4-6"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 2.3260366,593.45804 12.765781,589.27806 11.398714,587.24923 z"
+       id="path3402-8-4-4-7-7-9"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 14.165978,585.48614 10.109827,585.35892 11.424074,587.31125 z"
+       id="path3402-9-7-8-6-1-9"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 14.096558,585.53119 12.735711,589.28885 11.383294,587.25022 z"
+       id="path3402-8-9-0-7-0-8-8"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(0.97010857,-0.64820734,0.64820582,0.97011085,-119.22942,431.14338)"
+       id="path4221-8-5-0-4-1"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182068"
+       height="1.4025956"
+       x="-314.51828"
+       y="493.94922"
+       transform="matrix(0.83146901,-0.55557113,0.55556933,0.83147022,0,0)"
+       id="rect4268-2-0-7-5"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705705"
+       height="1.8286009"
+       x="-314.13605"
+       y="493.72247"
+       transform="matrix(0.83146901,-0.55557113,0.55556933,0.83147022,0,0)"
+       id="rect4219-8-3-3-1-5"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.550463,562.19555 35.664888,552.70611 37.306615,554.39266 z"
+       id="path3402-7-0-2-4-4-3"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.583333,562.1846 39.007011,556.04823 37.270395,554.32509 z"
+       id="path3402-8-4-4-7-7-7-5"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 39.640529,552.056 35.637498,552.72254 37.307365,554.38097 z"
+       id="path3402-9-7-8-6-1-5-3"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 39.581239,552.11373 38.979621,556.06467 37.255475,554.32906 z"
+       id="path3402-8-9-0-7-0-8-6-0"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(0.82500952,-0.82501146,0.82500952,0.82501146,-121.30241,426.70312)"
+       id="path4221-8-5-0-4-2-3"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182096"
+       height="1.402595"
+       x="-363.35065"
+       y="417.65759"
+       transform="matrix(0.70710595,-0.70710761,0.70710595,0.70710761,0,0)"
+       id="rect4268-2-0-7-9-2"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705733"
+       height="1.8286"
+       x="-362.96844"
+       y="417.43085"
+       transform="matrix(0.70710595,-0.70710761,0.70710595,0.70710761,0,0)"
+       id="rect4219-8-3-3-1-4-5"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.583333,588.28782 33.728983,577.78784 35.668188,579.12171 z"
+       id="path3402-7-0-2-4-4-4-4"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.613432,588.27065 37.658894,580.41373 35.619478,579.06249 z"
+       id="path3402-8-4-4-7-7-7-1-2"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 37.501404,576.37462 33.705323,577.80932 35.666638,579.11009 z"
+       id="path3402-9-7-8-6-1-5-9-7"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 37.454504,576.44281 37.635244,580.4352 35.605618,579.0693 z"
+       id="path3402-8-9-0-7-0-8-6-7-97"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(0.64820582,-0.97011085,0.97010857,0.64820734,-144.80413,484.82884)"
+       id="path4221-8-5-0-4-2-8-3"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.818213"
+       height="1.4025944"
+       x="-459.42163"
+       y="350.66275"
+       transform="matrix(0.55556933,-0.83147022,0.83146901,0.55557113,0,0)"
+       id="rect4268-2-0-7-9-0-6"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705762"
+       height="1.8285992"
+       x="-459.0394"
+       y="350.436"
+       transform="matrix(0.55556933,-0.83147022,0.83146901,0.55557113,0,0)"
+       id="rect4219-8-3-3-1-4-3-1"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 51.041667,561.98433 53.059212,550.87732 55.221377,551.80724 z"
+       id="path3402-7-0-2-4-4-4-9-2"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 51.067837,561.96162 57.425902,552.68606 55.162067,551.75866 z"
+       id="path3402-8-4-4-7-7-7-1-5-2"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 56.483444,548.7553 53.040202,550.90299 55.217597,551.79614 z"
+       id="path3402-9-7-8-6-1-5-9-4-07"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 56.450754,548.83133 57.406892,552.71174 55.149797,551.76805 z"
+       id="path3402-8-9-0-7-0-8-6-7-9-9"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(0.44649193,-1.0779294,1.0779269,0.44649298,-140.17881,494.53466)"
+       id="path4221-8-5-0-4-2-8-7-4"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182154"
+       height="1.4025939"
+       x="-486.38693"
+       y="261.44843"
+       transform="matrix(0.38268266,-0.92387985,0.92387922,0.3826842,0,0)"
+       id="rect4268-2-0-7-9-0-7-5"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705786"
+       height="1.8285985"
+       x="-486.00473"
+       y="261.22168"
+       transform="matrix(0.38268266,-0.92387985,0.92387922,0.3826842,0,0)"
+       id="rect4219-8-3-3-1-4-3-2-8"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <path
+       d="M 51.243386,593.62418 51.055306,582.33697 53.357341,582.8272 z"
+       id="path3402-7-0-2-4-4-4-9-1-5"
+       style="fill:#929292;fill-opacity:1;stroke:none" />
+    <path
+       d="M 51.264626,593.59679 55.690956,583.25907 53.289691,582.79113 z"
+       id="path3402-8-4-4-7-7-7-1-5-8-1"
+       style="fill:#191919;fill-opacity:1;stroke:none" />
+    <path
+       d="M 53.99975,579.58769 51.041667,582.36586 53.351471,582.81705 z"
+       id="path3402-9-7-8-6-1-5-9-4-0-9"
+       style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+    <path
+       d="M 53.98252,579.66863 55.677316,583.28796 53.279491,582.80273 z"
+       id="path3402-8-9-0-7-0-8-6-7-9-3-1"
+       style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+    <path
+       d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+       transform="matrix(0.22761962,-1.1443238,1.1443211,0.22762015,-149.46159,564.77589)"
+       id="path4221-8-5-0-4-2-8-7-7-4"
+       style="fill:none;stroke:#555555;stroke-opacity:1" />
+    <rect
+       width="6.8182173"
+       height="1.4025935"
+       x="-558.93488"
+       y="165.29926"
+       transform="matrix(0.19508988,-0.98078537,0.98078519,0.19509076,0,0)"
+       id="rect4268-2-0-7-9-0-7-7-5"
+       style="fill:#555555;fill-opacity:1;stroke:none" />
+    <rect
+       width="6.5705805"
+       height="1.828598"
+       x="-558.55267"
+       y="165.07253"
+       transform="matrix(0.19508988,-0.98078537,0.98078519,0.19509076,0,0)"
+       id="rect4219-8-3-3-1-4-3-2-7-6"
+       style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    <g
+       transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,-341.09898,203.76145)"
+       id="g4103">
+      <path
+         d="M 66.125025,519.19379 77.158619,516.80729 77.126919,519.16074 z"
+         id="path3402-7-9-3"
+         style="fill:#929292;fill-opacity:1;stroke:none" />
+      <path
+         d="M 66.156025,519.20928 77.158619,521.53378 77.149089,519.08735 z"
+         id="path3402-8-4-8-8"
+         style="fill:#191919;fill-opacity:1;stroke:none" />
+      <path
+         d="M 80.429511,519.15881 77.127629,516.79956 77.135729,519.153 z"
+         id="path3402-9-7-0-0"
+         style="fill:#4a4a4a;fill-opacity:1;stroke:none" />
+      <path
+         d="M 80.346761,519.1577 77.127629,521.52603 77.135729,519.07962 z"
+         id="path3402-8-9-0-1-0"
+         style="fill:#2d2d2d;fill-opacity:1;stroke:none" />
+      <path
+         d="M 29.37953,173.47063 A 1.2385181,1.1444534 0 1 1 26.902494,173.47063 1.2385181,1.1444534 0 1 1 29.37953,173.47063 z"
+         transform="matrix(1.1667397,0,0,1.1667424,55.263341,316.71683)"
+         id="path4221-8-4-8"
+         style="fill:none;stroke:#555555;stroke-opacity:1" />
+      <rect
+         width="6.8182015"
+         height="1.4025967"
+         x="79.410835"
+         y="518.42419"
+         id="rect4268-6-2"
+         style="fill:#555555;fill-opacity:1;stroke:none" />
+      <rect
+         width="6.5705657"
+         height="1.8286022"
+         x="79.793037"
+         y="518.19745"
+         id="rect4219-8-6-8"
+         style="fill:#0e0e0e;fill-opacity:1;stroke:none" />
+    </g>
+  </g>
+</svg>
Binary file share/hedgewars/Data/Graphics/slider.png has changed
Binary file share/hedgewars/Data/Graphics/star.png has changed
--- a/share/hedgewars/Data/Locale/cs.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/cs.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,156 +2,592 @@
       [":("] = ":(",
       ["!!!"] = "!!!",
       ["..."] = "...",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
       ["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"] = "",
       ["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
       ["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
+--      ["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!"] = "",
+--      ["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ů!",
       ["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
       ["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
+--      ["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]",
+--      [" 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
+--      ["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"] = "Oheň",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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",
+--      ["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
       ["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...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
+--      ["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
       ["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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Á",
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
       ["Nameless Heroes"] = "Bezejmenní hrdinové",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
       ["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
       ["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
+--      ["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"] = "SKÓRE",
       ["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
+--      ["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 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",
@@ -165,56 +601,319 @@
 --      ["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!"] = "", -- Space_Invasion
       ["Sniper Training"] = "Odstřelovací trénink",
       ["Sniperz"] = "Snajpři",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
       ["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 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
       ["'Zooka Team"] = "Bazukáři",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/cs.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/cs.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/da.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,919 @@
+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
+--      ["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
+--      ["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
+--      ["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
+        ["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",
+        ["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
+        ["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
+--      ["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!",
+--      ["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!",
+        ["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
+        ["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
+--      ["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]",
+--      [" 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
+--      ["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"] = "Skyd",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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",
+--      ["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
+        ["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...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
+--      ["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
+        ["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!",
+        ["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 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",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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",
+--      ["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
+--      ["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
+--      ["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
+--      ["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 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
+        ["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
+        ["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
+--      ["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"] = "SCORE",
+        ["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
+--      ["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 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 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!"] = "", -- Space_Invasion
+        ["Sniper Training"] = "Træning med Sniperriffel",
+        ["Sniperz"] = "Sniperz",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!",
+--      ["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
+--      ["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 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 this ever end?"] = "Slutter det her nogensinde?",
+        ["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 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
+        ["'Zooka Team"] = "'Zooka-hold",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/da.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/share/hedgewars/Data/Locale/de.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/de.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,159 +2,596 @@
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
 	["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",
 	["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
 	["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
+--      ["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!"] = "",
+--      ["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!"] = "",
 	["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
 	["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
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "Feuer",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!",
+--      ["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
 	["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...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
+--      ["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
 	["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!",
 	["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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",
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 	["Nameless Heroes"] = "Namenlose Helden",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 	["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 	["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|"] = "",
+--      ["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"] = "", -- Space_Invasion
 --      ["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
+--      ["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 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!",
@@ -168,55 +605,319 @@
 	["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!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Scharfschützen-Training",
 	["Sniperz"] = "Heckenschützen",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+	["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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",
+--      ["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
+--      ["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 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 this ever end?"] = "Wird dies je enden?",
 	["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 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
 	["'Zooka Team"] = "Die Knalltüten",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/de.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/de.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/share/hedgewars/Data/Locale/en.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/en.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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!
 
--- a/share/hedgewars/Data/Locale/es.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/es.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -1,159 +1,593 @@
 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
+--      ["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
+--      ["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
+--      ["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
 	["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",
 	["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
 	["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
+--      ["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!",
+--      ["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",
 	["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
 	["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
+--      ["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]",
+--      [" 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
+--      ["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"] = "Fuego",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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",
+--      ["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
 	["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...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
+--      ["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
 	["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í!",
 	["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 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",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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 SUCCESSFUL"] = "MISIÓN COMPLETADA", -- 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
+--      ["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
+--      ["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
+--      ["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
+--      ["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 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
 	["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 	["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
+--      ["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"] = "PUNTUACIÓN",
 	["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
+--      ["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 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!",
@@ -167,54 +601,319 @@
 	["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!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Entrenamiento con rifle francotirador",
 	["Sniperz"] = "Francotiradores",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!",
+--      ["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
+--      ["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 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 this ever end?"] = "¿Es que nunca se va a terminar?",
 	["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 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
 	["'Zooka Team"] = "Bazuqueros",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/fr.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/fr.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -1,220 +1,1183 @@
 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",
+      ["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",
+      ["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 !",
+      ["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
+      ["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
+      ["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
       ["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
       ["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 !",
+--      ["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",
+      ["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",
+--      ["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!"] = "",
+      ["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"] = "",
+      ["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]"] = "",
+--      [" 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",
+	  = "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"] = "",
+      ["First aid kits?!"] = "Des kits de premiers secours ?!",
+      ["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"] = "",
+      ["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 ?!",
+      ["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.",
+      ["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."] = "",
+      ["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"] = "",
 --      ["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...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"] = "",
+      ["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 ...",
       ["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]"] = "",
+      ["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 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"] = "",
+      ["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",
+      ["May the spirits aid you in all your quests!"] = "Puisse les esprits t'aider dans tes quêtes !",
+      ["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",
+      ["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",
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+      ["Name"] = "",
+      ["Nameless Heroes"] = "Heros sans noms",
+      ["Nancy Screw"] = "",
+      ["Nancy Screw"] = "",
+      ["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 !",
+--      ["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 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 !",
       ["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",
+      ["Pfew! That was close!"] = "Ouf! C'est pas passé loin !",
+      ["Pfew! That was close!"] = "Ouf ! C'étais pas loin !",
+--      ["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 ",
 --      ["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|"] = "",
+      ["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"] = "",
 --      ["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
+--      ["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 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 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!"] = "", -- Space_Invasion
       ["Sniper Training"] = "Entrainement au fusil de sniper",
---      ["Sniperz"] = "",
---      ["Sponge"] = "",
+      ["Sniperz"] = "Snipers",
+	  ["So humiliating..."] = "Si humiliant...",
+      ["So? What will it be?"] = "Alors ? Qu'est ce que ce sera ?",
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+      ["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"] = "",
+      ["Stronglings"] = "Stronglings",
+--      ["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 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",
+      ["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.",
+      ["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 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 this ever end?"] = "",
---      ["WINNING TIME: "] = "",
+      ["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 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 !",
 --      ["'Zooka Team"] = "",
+      ["Zork"] = "",
+      ["Zork"] = "",
+      ["Zork"] = "",
     }
--- a/share/hedgewars/Data/Locale/hedgewars_ar.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_ar.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></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>Edit schemes</translation>
     </message>
@@ -70,24 +54,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 تم حذفة من قائمة الترك</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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +155,14 @@
         <translation type="unfinished">اسم اللاعب</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -343,20 +288,6 @@
         <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,13 +304,35 @@
         <translation>%1 *** %2 خرج</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">اسم اللاعب</translation>
-    </message>
-    <message>
         <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>
@@ -389,16 +342,28 @@
     </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>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>
@@ -433,10 +398,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;افضل ضربة كانت من قبل &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;افضل لاعب هو &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;
-        </translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;المجموع&lt;b&gt;%1&lt;/b&gt; من اللاعبين قضوا في اللعبة.&lt;/p&gt;
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -567,16 +518,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>لعبة شبكية (عن طريق شبكة اتصال)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -825,6 +775,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -873,6 +848,14 @@
         <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 @@
         <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&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -928,18 +899,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">عام</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">متقدم</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>خطأ</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>تغيير الشباك</translation>
     </message>
@@ -947,18 +954,6 @@
         <source>Enter new file name:</source>
         <translation type="unfinished">ادخل اسم الملف</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>لا استطيع التغيير الى</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>لا استطيع حذف الملف</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>اختر المقطع من القائمة</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -971,18 +966,6 @@
         <translation>انضم</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>تحديث</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>الادارة</translation>
     </message>
@@ -991,67 +974,6 @@
         <translation type="unfinished">رقم الغرقة</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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;ll have to wait for the game to end to start playing.</source>
-        <translation type="unfinished">اللعبة قيد اللعب
-يمكنك الانضمام و المشاهدة</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation type="unfinished">%1هو المضيف الذي يبدا و يغيير اعدادات اللعبة</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>خارطة عشوائية</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</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>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation type="unfinished">طراز الاسلحة يحدد المتوفرة منها و عددها</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</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>
-    <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 type="unfinished">متاهة عشوائية</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1067,15 +989,6 @@
         <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">
@@ -1099,10 +1012,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>لعية بسيطة ضد الحاسوب</translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>لعبة متعددة</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">نمط التدريب، تحت التطوير</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>عرض</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>تحميل</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <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</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>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>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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>اسم اللاعب</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>الوضوح</translation>
     </message>
@@ -1683,10 +1674,6 @@
         <translation>محلي</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>اعد تشغيل اللعبة لتفعيل التغيير</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>متفجرات</translation>
     </message>
@@ -1735,10 +1722,6 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>اسلحة</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 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>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation type="unfinished">فرق</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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished">Unable to start the server: %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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>خطأ</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>اسم اللاعب</translation>
     </message>
@@ -1937,36 +2123,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_bg.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_bg.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 беше премахнат от списъка с игнорирани</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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +157,14 @@
         <translation type="unfinished">Прякор</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -337,10 +282,6 @@
         <translation>Вие бяхте изхвърлен</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Парола</translation>
-    </message>
-    <message>
         <source>Quit reason: </source>
         <translation>Причина за напускане:</translation>
     </message>
@@ -365,23 +306,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Прякор</translation>
-    </message>
-    <message>
         <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>
@@ -391,6 +344,26 @@
     </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 @@
         <source>Connecting...</source>
         <translation>Свързване...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Отказ</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -455,10 +424,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Награда за най-добър изстрел е спечелена от &lt;b&gt;%1&lt;/b&gt; с &lt;b&gt;%2&lt;/b&gt; точки.&lt;/p&gt;</translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Подробности</translation>
     </message>
@@ -555,16 +520,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Мрежова игра (играйте в мрежа)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -813,6 +777,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -861,6 +850,14 @@
         <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,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation>Изтриване на комплекта оръжия</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Общи</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">За напреднали</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Преименуване</translation>
     </message>
@@ -923,18 +956,6 @@
         <source>Enter new file name:</source>
         <translation>Въведете ново име на файл:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Не може да се преименува в</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Файлът не може да се изтрие</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Изберете запис от списъка</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -947,88 +968,14 @@
         <translation>Присъединяване</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Опресняване</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Административни функционалности</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
-    </message>
-    <message>
         <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&apos;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 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>
-    </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>
@@ -1044,16 +991,6 @@
         <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">
@@ -1207,35 +1144,47 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Солова игра (бърза игра срещу компютър с готови настройки)</translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Мрежова игра (играйте срещу приятели или ИИ отбори)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Тренировка (упражнете уменията си в редица тренировъчни мисии). В ПРОЦЕС НА РАЗРАБОТКА</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Демо (гледайте записани демота)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Зареди (заредете предишно запаметена игра)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим кампания (...). В ПРОЦЕС НА РАЗРАБОТКА</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Зареждане</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1249,6 +1198,52 @@
         <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 @@
         <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 @@
         <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 @@
         <translation>Мрежова игра</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Оръжия</translation>
-    </message>
-    <message>
         <source>Team Settings</source>
         <translation>Настройки на отборите</translation>
     </message>
@@ -1521,6 +1528,30 @@
         <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 @@
         <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 @@
         <translation>Локал</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Рестартирайте играта за да влезе в сила</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Експлозиви</translation>
     </message>
@@ -1693,10 +1712,6 @@
         <translation>% Дължина на въжето</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Геймплей</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Стерео режим</translation>
     </message>
@@ -1709,10 +1724,6 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
         <translation>Грешка</translation>
     </message>
     <message>
-        <source>Failed to open data directory:
-%1
-Please check your installation</source>
-        <translation>Не може да се отвори папката с данните:
-%1
-Проверете инсталацията си</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>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Не могат да се изтрият оръжията по подразбиране</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Да се изтрият ли тези оръжия?</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Не може да се редактират оръжията по подразбиране</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Не моге да се презапише стандартния комплект с оръжия &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Всички файлови асоциации са зададени.</translation>
-    </message>
-    <message>
         <source>File association failed.</source>
         <translation>Файловата асоциация се провали.</translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Отбори</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Наистина ли да бъде изтрит този отбор?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Схеми</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Стандартната схема &apos;%1&apos; не може да бъде изтрита!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Наистина ли да бъде изтрите тази игрова схема?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Не моге да се изтрие стандартния комплект с оръжия &apos;%1&apos;!</translation>
+        <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Не може да се създаде папка %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Прякор</translation>
     </message>
@@ -1911,36 +2126,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_cs.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_cs.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</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,24 +54,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +158,14 @@
         <translation type="unfinished">Přezdívka</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -346,10 +291,6 @@
         <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,23 +307,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Přezdívka</translation>
-    </message>
-    <message>
         <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">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>
 <context>
     <name>KB</name>
@@ -392,6 +345,26 @@
     </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 @@
         <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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Cenu za nejlepší zásah vyhrál &lt;b&gt;%1&lt;/b&gt; s &lt;b&gt;%2&lt;/b&gt; body.&lt;/p&gt;</translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detaily</translation>
     </message>
@@ -562,16 +527,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Místní hra (Hra na tomto počítači)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Síťová hra (Hra přes síť)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Jednoduše zvol stejnou barvu jako spoluhráč, abys hrál ve stejném týmu. Každý z vás bude mít kontrolu nad svými vlastními ježky, ale vyhraje nebo prohraje společně.</translation>
@@ -807,11 +771,6 @@
         <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&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -873,6 +857,14 @@
         <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,18 +908,54 @@
         <source>Delete weapon set</source>
         <translation>Smazat sadu zbraní</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Obecné</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Rozšířené</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Přejmenovávací dialog</translation>
     </message>
@@ -935,18 +963,6 @@
         <source>Enter new file name:</source>
         <translation>Zadejte jméno nového souboru:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Nemohu přejmenovat na</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Nemohu smazat soubor</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Prosím vyberte záznam ze seznamu</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -959,18 +975,6 @@
         <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,70 +983,6 @@
         <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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </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>
-    </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>Hra může být hrána na předem vytvořené nebo na náhodné mapě.</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>
-    </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>
@@ -1058,16 +998,6 @@
         <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">
@@ -1100,10 +1030,6 @@
         <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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Ukázky (Sledování nahraných her)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Nahrát (Nahrát uloženou hru)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Mód tažení (...). VE VÝVOJI</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Nahrát</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1268,6 +1206,53 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Zbraně</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Nemohu editovat základní nastavení zbraní</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Nemohu smazat základní nastavení zbraní</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Opravdu smazat toto nastavení zbraní?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Nemohu přepsat výchozí sadu zbraní &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Všechny asociace souborů byly nastaveny.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Asociace souborů selhala.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Týmy</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Opravdu smazat tento tým?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Schémata</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Nemohu smazat výchozí schéma &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Opravdu smazat toto herní schéma?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Nemohu smazat výchozí sadu zbraní &apos;%1&apos;!</translation>
+
+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 type="unfinished">Nemohu spustit server: %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 type="unfinished">Prosím zadejte jméno místnosti</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">Prosím vyberte záznam ze seznamu</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Prosím vyberte místnost ze seznamu</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">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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nemohu vytvořit adresář %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Přezdívka</translation>
     </message>
@@ -1930,36 +2136,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/hedgewars_da.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
+        <translation>Kan ikke åbne filen &apos;%1&apos; til skrivning</translation>
+    </message>
+    <message>
+        <source>Cannot read file &apos;%1&apos;</source>
+        <translation>Kan ikke læse filen &apos;%1&apos;</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&apos;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&apos;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>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
+        <translation>&lt;p&gt;Prisen for det bedste skud gik til &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; point.&lt;/p&gt;</translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
+        <translation type="obsolete">
+            <numerusform>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kill in a turn.&lt;/p&gt;</numerusform>
+            <numerusform>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
+        <translation type="obsolete">
+            <numerusform>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog was killed during this round.&lt;/p&gt;</numerusform>
+            <numerusform>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehogs were killed during this round.&lt;/p&gt;</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 &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.</source>
+        <translation>Prisen for det bedste skud gik til &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; point.</translation>
+    </message>
+    <message numerus="yes">
+        <source>The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.</source>
+        <translation>
+            <numerusform>Den bedste dræber er &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; drab på én tur.</numerusform>
+            <numerusform>Den bedste dræber er &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; drab på én tur.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.</source>
+        <translation>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; pindsvin blev dræbt i denne runde.</numerusform>
+            <numerusform>Totalt blev &lt;b&gt;%1&lt;/b&gt; 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>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
+        <translation>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; troede det var en god idé at skyde sine egne pindsvin med &lt;b&gt;%2&lt;/b&gt; point.</numerusform>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; troede det var en god idé at skyde sine egne pindsvin med &lt;b&gt;%2&lt;/b&gt; point.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;b&gt;%1&lt;/b&gt; killed &lt;b&gt;%2&lt;/b&gt; of his own hedgehogs.</source>
+        <translation>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; dræbte &lt;b&gt;%2&lt;/b&gt; af sine egne pindsvin.</numerusform>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; dræbte &lt;b&gt;%2&lt;/b&gt; af sine egne pindsvin.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; times.</source>
+        <translation>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; blev bange og sprang over sin tur &lt;b&gt;%2&lt;/b&gt; gang.</numerusform>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; blev bange og sprang over sin tur &lt;b&gt;%2&lt;/b&gt; 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&apos;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&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;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&apos;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&apos;re bored of default gameplay? Try one of the missions - they&apos;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 &apos;Local Game&apos; and pick the &apos;Demos&apos; 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å &apos;Lokalt spil&apos; og vælg &apos;Demoer&apos;-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&apos;ve got problems, ask on our forums but please don&apos;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&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; 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 &apos;Simpelt spil&apos;-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&apos;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 &apos;Reduceret kvalitet&apos; til for at forbedre ydelsen.</translation>
+    </message>
+    <message>
+        <source>We&apos;re open to suggestions and constructive feedback. If you don&apos;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 &apos;Vampirism&apos; or &apos;Karma&apos; 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. &apos;Varmpyr&apos; eller &apos;Karma&apos; 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&apos;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&apos;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&apos;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&apos;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&apos;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&apos;ll lose the hedgehog performing it, so there&apos;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&apos;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&apos;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&apos;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&apos;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 &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation>Du kan finde konfigurationsfilerne til Hedgewars under mappen &quot;(Mine) Dokumenter\Hedgewars&quot;. 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&apos;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&apos;t touch the ground you&apos;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 &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation>Du kan finde konfigurationsfilerne til Hedgewars under mappen &quot;Bibliotek/Application Support/Hedgewars&quot; 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 &quot;.hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation>Du kan finde konfigurationsfilerne til Hedgewars under mappen &quot;.hedgewars&quot; 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&apos;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&apos;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 &apos;work in progress&apos; 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 &apos;%1&apos;!</source>
+        <translation>Kan ikke overskrive standardvåbensættet &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+        <translation>Kan ikke slette standardspilsystemet &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+        <translation>Kan ikke slette standardvåbensættet &apos;%1&apos;!</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&apos;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&apos;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>
--- a/share/hedgewars/Data/Locale/hedgewars_de.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_de.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>Datei &apos;%1&apos; konnte nicht für Schreibzugriff geöffnet werden.</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Datei &apos;%1&apos; 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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</source>
+        <translation>Willst du wirklich beenden?</translation>
+    </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>
-    <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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation>%1 wurde aus deiner Ignorierliste entfernt</translation>
     </message>
@@ -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 @@
         <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 &apos;%1&apos; ist bereits in Verwendung. Bitte wähle einen anderen Spitznamen:</translation>
+    </message>
 </context>
 <context>
     <name>HWGame</name>
@@ -276,10 +218,6 @@
         <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 @@
         <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 &apos;%1&apos; 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,34 +308,35 @@
         <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 &apos;%1&apos; wurde
-auf Hedgewars.org registriert.
-
-Bitte gib dein Passwort ein oder
-wähle einen anderen Spitznamen:</translation>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Spitzname</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>
-    </message>
-    <message>
         <source>User quit</source>
         <translation>Benutzer ist gegangen</translation>
     </message>
+    <message>
+        <source>Remote host has closed connection</source>
+        <translation>Die Verbindung wurde von der anderen Seite geschlossen.</translation>
+    </message>
+    <message>
+        <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>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>
     <name>KB</name>
@@ -422,16 +346,28 @@
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation>Dauer: %1m %2s</translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation>Video: %1x%2, </translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation>%1 fps, </translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation>Audio: </translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Servernachricht:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Servernachricht festlegen</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Zwischenspeicher leeren</translation>
     </message>
@@ -466,10 +402,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Der Preis für den besten Schuss geht an &lt;b&gt;%1&lt;/b&gt; mit &lt;b&gt;%2&lt;/b&gt; Punkten.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Der blutigste Kämpfer ist &lt;b&gt;%1&lt;/b&gt; mit &lt;b&gt;%2&lt;/b&gt; Opfer in einer Runde.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Der blutigste Kämpfer ist &lt;b&gt;%1&lt;/b&gt; mit &lt;b&gt;%2&lt;/b&gt; Opfern in einer Runde.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Insgesamt fand &lt;b&gt;%1&lt;/b&gt; Igel ein trauriges Ende in dieser Runde.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Insgesamt fanden &lt;b&gt;%1&lt;/b&gt; Igel ein trauriges Ende in dieser Runde.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Details</translation>
     </message>
@@ -574,10 +492,6 @@
             <numerusform>(%1 Opfer)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 Kills)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation>
@@ -608,16 +522,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <source>Open the snapshot folder</source>
+        <translation>Schnappschuss-Ordner öffnen</translation>
+    </message>
+</context>
+<context>
     <name>PageMain</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>
-    </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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Wähle einfach die gleiche Farbe wie dein Freund um als ein Team zu spielen. Jeder von euch wird trotzdem seine eigenen Igel kontrollieren, aber sie gewinnen oder verlieren zusammen.</translation>
@@ -633,11 +546,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 @@
         <translation>Spezielle Spielmodi wie &apos;Vampirismus&apos; oder &apos;Karma&apos; 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&apos;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 @@
         <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&apos;s turn radius depends on it&apos;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 @@
         <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&apos;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 @@
         <translation>Du findest deine Hedgewars Konfigurationsdateien unter &quot;Eigene Dateien\Hedgewars&quot;. Erstelle Backups oder kopiere deine Dateien, aber editiere sie besser nicht selbst.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;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&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>DLC</source>
+        <translation>DLC</translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation>Herunterladbare Inhalte</translation>
     </message>
 </context>
 <context>
@@ -939,6 +852,14 @@
         <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 @@
         <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&apos;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,18 +903,54 @@
         <source>Delete weapon set</source>
         <translation>Waffenprofil löschen</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation>Allgemein</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation>Erweitert</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation>Auf Standard-Farben zurücksetzen</translation>
+    </message>
+    <message>
+        <source>Proxy host</source>
+        <translation>Host</translation>
+    </message>
+    <message>
+        <source>Proxy port</source>
+        <translation>Port</translation>
+    </message>
+    <message>
+        <source>Proxy login</source>
+        <translation>Login</translation>
+    </message>
+    <message>
+        <source>Proxy password</source>
+        <translation>Passwort</translation>
+    </message>
+    <message>
+        <source>No proxy</source>
+        <translation>Kein Proxy</translation>
+    </message>
+    <message>
+        <source>Socks5 proxy</source>
+        <translation>Socks5-Proxy</translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation>HTTP-Proxy</translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation>Betriebsystem Proxy-Einstellungen</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>
@@ -1013,18 +958,6 @@
         <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>
@@ -1037,18 +970,6 @@
         <translation>Betreten</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Aktualisieren</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Verwalten</translation>
     </message>
@@ -1057,68 +978,6 @@
         <translation>Raumname:</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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </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>
-    </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>
-    </message>
-    <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>
-    </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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Bitte einen Raumnamen eingeben</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Bitte einen Raum aus der Liste auswählen</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Zufallslabyrinth</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Status:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Regeln:</translation>
     </message>
@@ -1134,16 +993,6 @@
         <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 @@
         <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,36 +1146,48 @@
 <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>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Mehrspieler (Spiele gegen deine Freunde oder Computergegner)</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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Wiedergabe einer gespeicherten Demo)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Laden (eines vorher gespeicherten Spiels)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampagnenmodus (...) IN ENTWICKLUNG</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></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>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 verschidenen Trainingsmissionen</translation>
+    </message>
+    <message>
+        <source>Demos</source>
+        <translation>Demos</translation>
+    </message>
+    <message>
+        <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>
@@ -1343,6 +1200,52 @@
         <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>Size</source>
+        <translation>Größe</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>(in Bearbeitung...)</translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation>Datum: </translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation>Größe: </translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation>encoden</translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation>hochladen</translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1430,10 +1333,6 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 &apos;work in progress&apos; 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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation>Willst du das Team &apos;%1&apos; wirklich löschen?</translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</source>
+        <translation>Standard-Profil &apos;%1&apos; 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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Waffen</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Das Standard-Waffen-Set kann nicht editiert 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>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Soll dieses Waffen-Set wirklich gelöscht werden?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Kann nicht das Standardwaffenset &apos;%1&apos; überschreiben!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Alle Dateizuordnungen wurden gesetzt.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Dateizuordnung fehlgeschlagen.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Teams</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Dieses Team wirklich löschen?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Spielprofil</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Standardspielprofil &apos;%1&apos; kann nicht gelöscht werden!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Dieses Spielprofil wirklich löschen?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Standardwaffenprofil &apos;%1&apos; kann nicht gelöscht werden!</translation>
+
+Bitte überprüfe deine Installation!</translation>
+    </message>
+    <message>
+        <source>TCP - Error</source>
+        <translation>TCP - 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 at </source>
+        <translation>Konnte Engine nicht starten: </translation>
+    </message>
+    <message>
+        <source>Error code: %1</source>
+        <translation>Fehler-Code: %1</translation>
+    </message>
+    <message>
+        <source>Video upload - Error</source>
+        <translation>Video hochladen - Fehler</translation>
+    </message>
+    <message>
+        <source>Netgame - Error</source>
+        <translation>Netwerkspiel - Fehler</translation>
+    </message>
+    <message>
+        <source>Please select a server from the list</source>
+        <translation>Bitte wähle einen Server von der Liste</translation>
+    </message>
+    <message>
+        <source>Please enter room name</source>
+        <translation>Bitte einen Raumnamen eingeben</translation>
+    </message>
+    <message>
+        <source>Record Play - Error</source>
+        <translation>Aufnahmewiedergabe - Fehler</translation>
+    </message>
+    <message>
+        <source>Please select record from the list</source>
+        <translation>Bitte eine Aufnahme aus der Liste auswählen</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation>Datei konnte nicht unbenannt werden nach </translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation>Datei konnte nicht gelöscht werden</translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation>Raumname - Fehler</translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation>Bitte einen Raum aus der Liste auswählen</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
+        <translation>Raumname - Bist du dir sicher?</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>
+        <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 &apos;%1&apos;?</source>
+        <translation>Willst du das Profil &apos;%1&apos; 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 &apos;%1&apos;?</source>
+        <translation>Willst du das Video &apos;%1&apos; 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 &apos;%1&apos; for writing</source>
+        <translation>&apos;%1&apos; konnte nicht geschrieben werden</translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation>&apos;%1&apos; konnte nicht gelesen werden</translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation>Munition &apos;%1&apos; kann nicht benutzt werden!</translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation>Waffenprofil - Warnung</translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation>Standard-Waffenprofil &apos;%1&apos; kann nicht überschrieben werden!</translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</source>
+        <translation>Standard-Waffenprofil &apos;%1&apos; 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 &apos;%1&apos;?</source>
+        <translation>Willst du das Waffenprofil &apos;%1&apos; wirklich löschen?</translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Verzeichnis %1 konnte nicht angelegt werden</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Spitzname</translation>
     </message>
@@ -2015,9 +2135,37 @@
         <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 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
     </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>
--- a/share/hedgewars/Data/Locale/hedgewars_en.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_en.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="en">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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>
@@ -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,16 +157,14 @@
         <translation type="unfinished">Nickname</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -345,20 +290,6 @@
         <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,23 +306,35 @@
         <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>
+    <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">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>
 <context>
     <name>KB</name>
@@ -401,16 +344,28 @@
     </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>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>
@@ -445,10 +400,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kill in a turn.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog was killed during this round.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehogs were killed during this round.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Details</translation>
     </message>
@@ -583,16 +520,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -841,6 +777,46 @@
         <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 @@
     </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>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -889,6 +850,14 @@
         <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 @@
         <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&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>You can&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</translation>
     </message>
@@ -944,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">General</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Advanced</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Rename dialog</translation>
     </message>
@@ -963,18 +956,6 @@
         <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>
@@ -987,18 +968,6 @@
         <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>
@@ -1007,64 +976,6 @@
         <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&apos;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&apos;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>
@@ -1080,16 +991,6 @@
         <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">
@@ -1113,10 +1014,6 @@
         <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 @@
         <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 @@
 <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>
+        <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</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>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>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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </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 &apos;%1&apos;!</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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished">Unable to start the server: %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 type="unfinished">Please enter room name</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">Please select record from the list</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>
+    <message>
+        <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>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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</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>
@@ -1947,36 +2126,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_es.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_es.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>No se puede abrir el fichero &apos;%1&apos; en modo lectura</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>No se puede leer &apos;%1&apos;</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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    <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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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 @@
         <translation type="unfinished">Nick</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
-    </message>
-    <message>
-        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -278,10 +216,6 @@
         <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 @@
         <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,33 +306,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nick</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>
-    </message>
-    <message>
         <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">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>
 <context>
     <name>KB</name>
@@ -422,16 +344,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Mensaje del servidor:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Establecer mensaje</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Vaciar caché de cuentas</translation>
     </message>
@@ -466,10 +400,6 @@
         <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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;El premio al mejor disparo es para &lt;b&gt;%1&lt;/b&gt;, con &lt;b&gt;%2&lt;/b&gt; puntos.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;El asesino más eficiente es &lt;b&gt;%1&lt;/b&gt;, con &lt;b&gt;%2&lt;/b&gt; muerte en un solo turno.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;El asesino más eficiente es &lt;b&gt;%1&lt;/b&gt;, con &lt;b&gt;%2&lt;/b&gt; muertes en un solo turno.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Un total de &lt;b&gt;%1&lt;/b&gt; erizo murió esta ronda.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Un total de &lt;b&gt;%1&lt;/b&gt; erizos murieron esta ronda.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detalles</translation>
     </message>
@@ -578,10 +490,6 @@
             <numerusform>(%1 bajas)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 bajas)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation>
@@ -612,16 +520,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Juego local (Jugar en la misma computadora)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Juego en red (Jugar a través de la red)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Elige el mismo color que tus amigos para hacer una alianza con ellos. Cada uno de vosotros controlará sus propios erizos, pero la victoria o derrota será compartida por vuestra facción.</translation>
@@ -637,11 +544,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 @@
         <translation>Los modos de juego especiales como &quot;vampirismo&quot; o &quot;karma&quot; 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&apos;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 @@
         <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&apos;s turn radius depends on it&apos;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 @@
         <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&apos;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 @@
         <translation>Puedes encontrar los archivos de configuración del juego en la carpeta &quot;Mis Documentos\Hedgewars&quot;. 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 &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;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&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Contenido adicional</translation>
     </message>
 </context>
 <context>
@@ -943,6 +850,14 @@
         <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 @@
         <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&apos;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,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation>Eliminar set de armas</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">General</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Avanzado</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Renombrar</translation>
     </message>
@@ -1017,18 +956,6 @@
         <source>Enter new file name:</source>
         <translation>Introduce el nuevo nombre del fichero:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>No se pudo cambiar el nombre a</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>No se pudo eliminar el fichero</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Por favor, selecciona una entrada de la lista</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -1041,18 +968,6 @@
         <translation>Entrar</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Actualizar</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>
@@ -1061,68 +976,6 @@
         <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&apos;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>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Reglas:</translation>
     </message>
@@ -1138,16 +991,6 @@
         <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 @@
         <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 @@
         <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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Visualiza demos previamente grabadas)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Cargar (Cargar un juego previamente guardado)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Campaña (...) EN DESARROLLO</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Cargar</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1351,6 +1198,52 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <translation>Idioma</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Requiere reiniciar el juego</translation>
-    </message>
-    <message>
-        <source>This SVN build is &apos;work in progress&apos; 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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Sets de armas</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">No se puede editar el set de armas predefinido</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">No se puede borrar el set de armas predefinido</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>¿Realmente quieres borrar este set de armas?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>¡No se puede sobreescribir el set de armas por defecto &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Se reestablecieron todas las asociaciones de tipo de archivo.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>No se pudieron asociar los tipos de fichero.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Equipos</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>¿De verdad quieres eliminar este equipo?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Modos de juego</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>¡No se puede eliminar el modo de juego predefinido &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>¿De verdad quieres eliminar este modo de juego?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>¡No se puede eliminar el set de armas predefinido &apos;%1&apos;!</translation>
+
+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 type="unfinished">No se pudo iniciar el servidor: %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 type="unfinished">Por favor, introduce un nombre para la sala</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">Por favor, selecciona una entrada de la lista</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Por favor, selecciona una sala de la lista</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">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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</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>No se pudo crear el directorio %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Nick</translation>
     </message>
@@ -2063,43 +2125,79 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_fi.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_fi.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fi">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 on poistanut sinut huomiotta jättö-listaltaan</translation>
-    </message>
-    <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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +157,14 @@
         <translation type="unfinished">Nimimerkki</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -345,20 +290,6 @@
         <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,23 +306,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nimimerkki</translation>
-    </message>
-    <message>
         <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">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>
 <context>
     <name>KB</name>
@@ -401,16 +344,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Palvelimen viesti:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Aseta viesti</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Tyhjennä käyttäjätili-välimuisti</translation>
     </message>
@@ -445,10 +400,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Paras laukaus -mitalin voitti &lt;b&gt;%1&lt;/b&gt; &lt;b&gt;%2&lt;/b&gt; pisteellä&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Paras tappaja oli &lt;b&gt;%1&lt;/b&gt; &lt;b&gt;yhdellä&lt;/b&gt; tapolla vuoron aikana&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Paras tappaja oli &lt;b&gt;%1&lt;/b&gt; &lt;b&gt;%2&lt;/b&gt;:llä tapolla &lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Yhteensä &lt;b&gt;yksi&lt;/b&gt; siili tapettiin tällä kierroksella.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Yhteensä &lt;b&gt;%1&lt;/b&gt; siiltä tapettiin tällä kierroksella.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Yksityiskohdat</translation>
     </message>
@@ -553,10 +490,6 @@
             <numerusform></numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 tappoa)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation type="unfinished">
@@ -587,16 +520,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Paikallinen peli (Pelaa yhdellä tietokoneella)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Verkkopeli (Pelaa verkon yli)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Valitse sama väri kaverisi kanssa pelataksesi samassa joukkueessa. Kumpikin ohjaa omia siilejään, mutta voitatte ja häviätte yhdessä.</translation>
@@ -612,11 +544,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 @@
         <translation>Erityispelimoodit kuten &apos;Vampyrismi&apos; ja &apos;Karma&apos; 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&apos;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 @@
         <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&apos;s turn radius depends on it&apos;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 @@
         <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&apos;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 @@
         <translation>Löydät Hedgewars-asetustiedostot hakemistosta &quot;Omat tiedostot\Hedgewars&quot;. Ota varmuuskopio tai ota ne mukaasi, mutta älä muokkaa niitä käsin.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Löydät Hedgewars-asetustiedostot &quot;Hedgewars&quot;-hakemistosta kotihakemistossasi. Ota varmuuskopio tai ota ne mukaasi, mutta älä muokkaa niitä käsin.</translation>
-    </message>
-    <message>
         <source>You&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -918,6 +850,14 @@
         <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 @@
         <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&apos;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,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Yleiset</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Lisäasetukset</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Uudelleennimeämis-dialogi</translation>
     </message>
@@ -992,18 +956,6 @@
         <source>Enter new file name:</source>
         <translation>Syötä uusi tiedostonimi:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Ei voida uudelleennimetä</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Ei voida poistaa tiedostoa</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Ole hyvä ja valitse nauhoite listasta</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -1016,18 +968,6 @@
         <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,68 +976,6 @@
         <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&apos;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>
     </message>
@@ -1113,16 +991,6 @@
         <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 @@
         <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 @@
         <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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demot (Katso nauhoitettuja demoja)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Lataa (Lataa aikaisemmin tallennettu peli)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampanja-tila (...). KEHITYS KESKEN</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Lataa</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1326,6 +1198,52 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Aseet</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Oletus-asesettiä ei voi muokata</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Oletus-asesettiä ei voi poistaa</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Haluatko todella poistaa tämän asesetin?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Oletusasetussettiä &apos;%1&apos; ei voida ylikirjoittaa!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
+
+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 type="unfinished">Palvelinta ei pystytty käynnistämään: %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 type="unfinished">Ole hyvä ja syötä huoneen nimi</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">Ole hyvä ja valitse nauhoite listasta</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>
     <message>
-        <source>File association failed.</source>
+        <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>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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Joukkueet</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video &apos;%1&apos;?</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>Schemes</source>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for writing</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Hakemiston %1 luonti epäonnistui</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Nimimerkki</translation>
     </message>
@@ -2016,36 +2126,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <source>Toggle labels above hedgehogs:</source>
         <translation>Vaihda siilien yläpuolella näkyviä &quot;leimoja&quot;:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
--- a/share/hedgewars/Data/Locale/hedgewars_fr.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_fr.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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&apos;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&apos;amis</translation>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +157,14 @@
         <translation type="unfinished">Pseudo</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -345,20 +290,6 @@
         <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,23 +306,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Pseudo</translation>
-    </message>
-    <message>
         <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">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>
 <context>
     <name>KB</name>
@@ -401,16 +344,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Message du serveur:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Définir le message</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Vider le cache des comptes</translation>
     </message>
@@ -445,10 +400,6 @@
         <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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Le prix du meilleur tir revient à &lt;b&gt;%1&lt;/b&gt; avec &lt;b&gt;%2&lt;/b&gt; points.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Le meilleur tueur est &lt;b&gt;%1&lt;/b&gt; avec &lt;b&gt;%2&lt;/b&gt; mort en un tour.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Le meilleur tueur est &lt;b&gt;%1&lt;/b&gt; avec &lt;b&gt;%2&lt;/b&gt; morts en un tour.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Un total de &lt;b&gt;%1&lt;/b&gt; hérisson a été tué pendant cette partie.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Un total de &lt;b&gt;%1&lt;/b&gt; hérissons ont été tués pendant cette partie.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Détails</translation>
     </message>
@@ -587,16 +520,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Jeu en local (Jouer une partie sur son propre ordinateur)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Jeu en réseau (Jouer une partie sur le réseau)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Choisissez la même couleur qu&apos;un ami pour jouer dans la même équipe. Chacun de vous continuera à contrôler son ou ses hérissons mais ils gagneront ou perdront ensembles.</translation>
@@ -687,11 +619,6 @@
         <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&apos;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&apos;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 @@
         <translation type="unfinished">L&apos;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&apos;s turn radius depends on it&apos;s velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">L&apos;Abeille Missile peut être délicate à utiliser. Son rayon de courbure dépend de sa vitesse, alors essayer de ne pas l&apos;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&apos;outil parfait pour créer de petites réactions en chaines envoyant les ennemis dans des situations délicates ... ou dans l&apos;eau.</translation>
@@ -787,11 +709,6 @@
         <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&apos;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 @@
         <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&apos;s velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">L&apos;Abeille Missile peut être délicate à utiliser. Sa courbe de lancer dépend de sa vitesse, pour plus de précision ne l&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -913,6 +850,14 @@
         <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,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation>Supprimer un ensemble d&apos;armes</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Général</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Avancé</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Boîte de dialogue de renommage</translation>
     </message>
@@ -975,18 +956,6 @@
         <source>Enter new file name:</source>
         <translation>Entrez un nouveau nom de fichier:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Impossible de renommer en</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Impossible de supprimer le fichier</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Veuillez sélectionner une partie dans cette liste</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -999,18 +968,6 @@
         <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&apos;administration</translation>
     </message>
@@ -1019,68 +976,6 @@
         <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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 est l&apos;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&apos;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&apos;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>
@@ -1096,15 +991,6 @@
         <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 @@
         <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 @@
         <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 @@
 <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&apos;ordinateur, options choisies automatiquement)</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&apos;ordinateur)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Missions d&apos;entraînement (Pratiquez vos talents dans une série de missions d&apos;entraînement). EN DÉVELOPPEMENT</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Démonstrations (Visionner les démonstrations enregistrées)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Charger (Charger une partie préalablement sauvegardée)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Mode Campagne (...). EN DÉVELOPPEMENT</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Charger</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1308,6 +1198,52 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <source>Schemes and Weapons</source>
         <translation>Paramètres et Armes</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>Net nick</source>
-        <translation>Pseudo réseau</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>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Résolution</translation>
     </message>
@@ -1716,10 +1676,6 @@
         <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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
         <translation>Erreur</translation>
     </message>
     <message>
-        <source>Failed to open data directory:
-%1
-Please check your installation</source>
-        <translation>Echec lors de l&apos;accès au dossier do données:
-%1
-Veuillez vérifier votre installation</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>Réseau</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>La connexion au serveur a été perdue</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Armes</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Impossible de supprimer le set d&apos;armes par défaut</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Supprimer ce set d&apos;armes ?</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Impossible d&apos;éditer le set d&apos;armes par défaut</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Impossible d&apos;enregistrer sur le set d&apos;armes par défaut.</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Toutes les associations d&apos;extensions de fichiers ont été effectuées.</translation>
-    </message>
-    <message>
         <source>File association failed.</source>
         <translation>Les associations d&apos;extensions de fichiers ont échoué.</translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Équipes</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Voulez-vous vraiment effacer cette équipe ?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Paramètres de jeu</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Impossible d&apos;effacer les paramètres de jeu par défaut.</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Voulez-vous vraiment effacer ces paramètres de jeu ?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Impossible d&apos;effacer le set d&apos;armes par défaut.</translation>
+        <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Impossible de démarrer le serveur: %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 type="unfinished">Veuillez saisir le nom du salon</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">Veuillez sélectionner une partie dans cette liste</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Veuillez sélectionner un salon dans la liste</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">Vous voulez rejoindre une partie qui a déjà commencée. Voulez-vous tout de même rejoindre la salle ?</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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Impossible de créer le dossier %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Pseudo</translation>
     </message>
@@ -1974,36 +2125,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_hu.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_hu.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="hu">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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,24 +52,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 eltávolítva a figyelmen kívül hagyottak listájáról</translation>
-    </message>
-    <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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +153,14 @@
         <translation type="unfinished">Becenév</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -341,20 +286,6 @@
         <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,13 +302,35 @@
         <translation>%1 *** %2 távozott</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Becenév</translation>
-    </message>
-    <message>
         <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">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>
 <context>
     <name>KB</name>
@@ -387,16 +340,28 @@
     </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>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>Accounts Cache kiürítése</translation>
     </message>
@@ -431,10 +396,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;A legjobb lövés díját &lt;b&gt;%1&lt;/b&gt; nyerte &lt;b&gt;%2&lt;/b&gt; ponttal.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;A legjobb gyilkos &lt;b&gt;%1&lt;/b&gt; volt, &lt;b&gt;%2&lt;/b&gt; áldozattal egy körben.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Összesen &lt;b&gt;%1&lt;/b&gt; süni pusztult el ebben a játékban.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -561,16 +510,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Helyi játék (Játssz egyetlen számítógépen)</translation>
-    </message>
-    <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>
-    </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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -819,6 +767,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -867,6 +840,14 @@
         <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 @@
         <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&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -922,18 +891,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Általános</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Haladó</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Párbeszéd átnevezése</translation>
     </message>
@@ -941,18 +946,6 @@
         <source>Enter new file name:</source>
         <translation>Add meg az új fájl nevét:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Nem nevezhető át erre -</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Fájl nem törölhető</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Kérlek, válassz a listából</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -965,18 +958,6 @@
         <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,62 +966,6 @@
         <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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Véletlen pálya</translation>
-    </message>
-    <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>
-    </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>
-    </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>
@@ -1056,15 +981,6 @@
         <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">
@@ -1087,10 +1003,6 @@
         <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>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Gyengébb gravitáció</translation>
     </message>
@@ -1103,10 +1015,6 @@
         <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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demók (felvett demók megtekintése)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Betöltés (korábbi mentett állás visszatöltése)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Betöltés</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1263,6 +1187,51 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 &apos;work in progress&apos; 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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Fegyverek</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Az alap fegverkészlet nem szerkeszthető</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Az alap fegyverkeszléet nem törölhető</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Valóban törlöd ezt a fegyverkészletet?</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
+
+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 type="unfinished">Nem sikerült a szerverhez csatlakozni: %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>File association failed.</source>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Add meg a szoba nevét</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">Kérlek, válassz a listából</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>
     <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
+        <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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Csapatok</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video &apos;%1&apos;?</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>Schemes</source>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for writing</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nem sikerült létrehozni %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Becenév</translation>
     </message>
@@ -1931,36 +2112,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_it.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_it.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>Impossibile aprire il file &apos;%1&apos; in scrittura</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Impossibile leggere il file &apos;%1&apos;</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>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</source>
+        <translation>Vuoi veramente uscire?</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>
-    <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>
-    </message>
-    <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&apos;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>
-    </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>
+        <translation>Nickname</translation>
     </message>
     <message>
         <source>No nickname supplied.</source>
+        <translation>Nessun nickname valido inserito.</translation>
+    </message>
+    <message>
+        <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 @@
     </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 @@
         <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 @@
         <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,55 +303,69 @@
     </message>
     <message>
         <source>%1 *** %2 has left</source>
-        <translation>%1 *** %2 se ne è 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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nickname</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>
+        <translation>%1 *** %2 se n&apos;è andato</translation>
     </message>
     <message>
         <source>User quit</source>
-        <translation type="unfinished"></translation>
+        <translation>Esci</translation>
+    </message>
+    <message>
+        <source>Remote host has closed connection</source>
+        <translation>L&apos;host remoto ha terminato la connessione.</translation>
+    </message>
+    <message>
+        <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>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&apos;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>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>%1 fps, </source>
+        <translation>%1 fps, </translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation>Audio:</translation>
     </message>
 </context>
 <context>
     <name>PageAdmin</name>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Messaggio del server:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Inserisci messaggio</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Pulisci la cache degli account</translation>
     </message>
@@ -462,10 +400,6 @@
         <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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Il premio per il miglior colpo è stato vinto da &lt;b&gt;%1&lt;/b&gt; , con &lt;b&gt;%2&lt;/b&gt; punti.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Il miglior killer è &lt;b&gt;%1&lt;/b&gt; con &lt;b&gt;%2&lt;/b&gt; uccisione in un turno.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Il miglior killer è &lt;b&gt;%1&lt;/b&gt; con &lt;b&gt;%2&lt;/b&gt; uccisioni in un turno.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Durante questo round è stato ucciso &lt;b&gt;%1&lt;/b&gt; riccio in totale.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Un totale di &lt;b&gt;%1&lt;/b&gt; ricci sono stati uccisi durante questo round.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Dettagli</translation>
     </message>
@@ -564,7 +480,7 @@
         <source>A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.</source>
         <translation>
             <numerusform>&lt;p&gt;Durante questo round sono stati uccisi &lt;b&gt;%1&lt;/b&gt; ricci in totale.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Un totale di &lt;b&gt;%1&lt;/b&gt; ricci sono stati uccisi durante questo round.&lt;/p&gt;</numerusform>
+            <numerusform>&lt;p&gt;Un totale di &lt;b&gt;%1&lt;/b&gt; è stato ucciso durante questo round.&lt;/p&gt;</numerusform>
         </translation>
     </message>
     <message numerus="yes">
@@ -600,20 +516,19 @@
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
-        <translation type="unfinished"></translation>
+        <translation>In Game....</translation>
+    </message>
+</context>
+<context>
+    <name>PageInfo</name>
+    <message>
+        <source>Open the snapshot folder</source>
+        <translation>Apri cartella schermate</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>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Gioco in rete (Gioca una partita attraverso la rete)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Scegli lo stesso colore di un amico per giocare in squadra. Ciascuno controllerà i propri ricci ma la vittoria o la sconfitta saranno comuni.</translation>
@@ -621,67 +536,67 @@
     <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&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;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&apos;è 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&apos;è il Sudden Death!</translation>
     </message>
     <message>
         <source>If you&apos;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&apos;re bored of default gameplay? Try one of the missions - they&apos;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 &apos;Local Game&apos; and pick the &apos;Demos&apos; button on the lower right corner to play or manage them.</source>
         <comment>Tips</comment>
-        <translation>Il gioco salverà sempre l&apos;ultima partita giocata come demo. Selezione &apos;Local Game&apos; e clicca il bottone &apos;Demos&apos; nell&apos;angolo in basso a destra per gestire le demo.</translation>
+        <translation>Il gioco salverà sempre l&apos;ultima partita giocata come demo. Seleziona &apos;Gioco locale&apos; e clicca il bottone &apos;Demos&apos; nell&apos;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&apos;ve got problems, ask on our forums but please don&apos;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&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; 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&apos;opzione &apos;Simple Game&apos;.</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&apos;attività per almeno 30 minuti al termine del gioco!</translation>
     </message>
     <message>
         <source>If your graphics card isn&apos;t able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
@@ -691,12 +606,12 @@
     <message>
         <source>We&apos;re open to suggestions and constructive feedback. If you don&apos;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 &apos;Vampirism&apos; or &apos;Karma&apos; allow you to develop completely new tactics. Try them in a custom game!</source>
@@ -711,7 +626,7 @@
     <message>
         <source>Hedgewars can be perfect for short games during breaks. Just ensure you don&apos;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 @@
     <message>
         <source>Some weapons require special strategies or just lots of training, so don&apos;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&apos;utilizzo di un&apos;arma specifica se manchi il nemico una volta.</translation>
     </message>
     <message>
         <source>Most weapons won&apos;t work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
@@ -761,17 +676,17 @@
     <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&apos;ll lose the hedgehog performing it, so there&apos;s a huge downside as well.</source>
         <comment>Tips</comment>
-        <translation>Ultima Sonata è l&apos;attacco aereo più dannoso. Perderai il tuo riccio, eseguendolo, quindi ci sono anche delle grosse controindicazioni.</translation>
+        <translation>L&apos;Ultima Sonata è l&apos;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 @@
     <message>
         <source>If you&apos;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&apos;esplosione.</translation>
+        <translation>Se sei bloccato dietro un riccio nemico, usa il Martello per liberarti senza essere danneggiato da un&apos;esplosione.</translation>
     </message>
     <message>
         <source>The Cake&apos;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&apos;arma ma può essere usato anche per scavare gallerie.</translation>
+        <translation>Il Lanciafiamme è un&apos;arma che può essere usata anche per scavare gallerie.</translation>
     </message>
     <message>
         <source>Want to know who&apos;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&apos;è dietro il gioco? Clicca sul logo Hedgewars nel menu principale per vedere gli autori.</translation>
+        <translation>Vuoi sapere chi c&apos;è 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 @@
     <message>
         <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you&apos;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 @@
     <message>
         <source>You can find your Hedgewars configuration files under &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
         <comment>Tips</comment>
-        <translation>Puoi trovare i tuoi file di configurazione Hedgewars in &quot;Documenti\Hedgewars&quot;. 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 &quot;Documenti\Hedgewars&quot;. Crea delle copie di sicurezza o prendi i file con te, ma non modificarli manualmente!</translation>
     </message>
     <message>
         <source>You&apos;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&apos;t touch the ground you&apos;ll reuse your rope without wasting ammo!</source>
         <comment>Tips</comment>
-        <translation>Vuoi risparmiare le corde? Rilascia la corda a mezz&apos;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&apos;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 &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
         <comment>Tips</comment>
-        <translation>Puoi trovare i tuoi file di configurazioen di Hedgewars in &quot;Library/Application Support/Hedgewars&quot; 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 &quot;Library/Application Support/Hedgewars&quot; 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 &quot;.hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
         <comment>Tips</comment>
-        <translation>Puoi trovare i tuoi file di configurazioen di Hedgewars in &quot;.hedgewars&quot; 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 &quot;.hedgewars&quot; 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 @@
         <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&apos;s velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">l&apos;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 @@
     </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&apos;è 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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>DLC</source>
+        <translation>DLC</translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation>Contenuti Scaricabili</translation>
     </message>
 </context>
 <context>
@@ -915,6 +850,14 @@
         <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 @@
         <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&apos;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,36 +901,60 @@
         <source>Delete weapon set</source>
         <translation>Elimina set delle armi</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation>Generale</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation>Avanzate</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation>Ripristina colori originali</translation>
+    </message>
+    <message>
+        <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>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>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>
+        <translation>Inserisci il nome del file:</translation>
     </message>
 </context>
 <context>
@@ -1013,88 +968,14 @@
         <translation>Entra</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Aggiorna</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
-        <translation>Opzioni amministratore</translation>
+        <translation>Opzioni amministrative</translation>
     </message>
     <message>
         <source>Room Name:</source>
         <translation>Nome stanza:</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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 è l&apos;host. Può modificare le impostazioni e far partire il gioco.</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Mappa casuale</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>
-    </message>
-    <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>
-    </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&apos; 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&apos; presente %1 squadra partecipante in questa stanza.</numerusform>
-            <numerusform>Sono presenti %1 squadre partecipanti in questa stanza.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Inserisci il nome della stanza</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Seleziona la stanza dalla lista</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Labirinto Casuale</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Stato:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Regole:</translation>
     </message>
@@ -1110,16 +991,6 @@
         <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 @@
 <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&apos;80% del danno che fai</translation>
     </message>
@@ -1175,16 +1042,12 @@
         <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 @@
     </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 @@
     </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 @@
     </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 @@
     </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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demo (Guarda le partite registrate)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Carica (Carica una partita precedentemente salvata)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modalità Campagna. IN SVILUPPO</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation type="unfinished"></translation>
+        <source>Simple Game</source>
+        <translation>Partita Semplice</translation>
+    </message>
+    <message>
+        <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>Multiplayer</source>
+        <translation>Multiplayer</translation>
+    </message>
+    <message>
+        <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>Campaign Mode</source>
+        <translation>Modalità Campagna</translation>
+    </message>
+    <message>
+        <source>Training Mode</source>
+        <translation>Modalità allenamento</translation>
+    </message>
+    <message>
+        <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>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 @@
     </message>
     <message>
         <source>Unignore</source>
-        <translation>Togli ignora</translation>
+        <translation>Non ignorare</translation>
     </message>
     <message>
         <source>Remove friend</source>
@@ -1410,10 +1331,6 @@
         <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 @@
     </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>
@@ -1473,10 +1410,6 @@
         <translation>In corso</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Predefinito</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>Mappa disegnata...</translation>
     </message>
@@ -1510,7 +1443,7 @@
     </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 @@
     </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 @@
     </message>
     <message>
         <source>Key binds</source>
-        <translation>Associazione dei tasti</translation>
+        <translation>Associazione tasti</translation>
     </message>
     <message>
         <source>Fort</source>
@@ -1568,10 +1501,6 @@
         <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 @@
         <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 @@
     </message>
     <message>
         <source>Translations:</source>
-        <translation>Traduzioni:</translation>
+        <translation>Traduttori:</translation>
     </message>
     <message>
         <source>Special thanks:</source>
@@ -1640,7 +1589,7 @@
     </message>
     <message>
         <source>Port:</source>
-        <translation>Port:</translation>
+        <translation>Porta:</translation>
     </message>
     <message>
         <source>Resolution</source>
@@ -1651,10 +1600,6 @@
         <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 @@
     </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 @@
         <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 &apos;work in progress&apos; 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&apos;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 &apos;work in progress&apos; 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&apos;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&apos;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 @@
         <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 yot 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&apos;indirizzo e-mail associato all&apos;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 @@
 <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 @@
         <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&apos; necessario compilare tutti i campi</translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation>Errore durante l&apos;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&apos;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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Armi</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Non è possibile modificare il set di armi predefinito</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Non è possibile eliminare il set di armi predefinito</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Vuoi davvero eliminare questo set di armi?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Impossibile sovrascrivere il set delle armi predefinito &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Associazione delle estensioni a Hedgewars completata con successo.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Associazione delle estensioni a Hedgewars fallita.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Squadre</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Eliminare veramente questa squadra?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Schemi di gioco</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Impossibile eliminare lo schema di gioco predefinito &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Eliminare veramente questo schema di gioco?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Impossibile elimininare il set delle armi predefinito &apos;%1&apos;!</translation>
+
+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 type="unfinished">Impossibile avviare il server: %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 type="unfinished">Inserisci il nome della stanza</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">Seleziona un record dalla lista</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Seleziona la stanza dalla lista</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">La partita a cui stai cercando di unirti è già iniziata.
+Voui comunque entrare nella stanza?</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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Impossibile creare la directory %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Nickname</translation>
     </message>
@@ -1997,14 +2126,42 @@
     </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 @@
     </message>
     <message>
         <source>Owner</source>
-        <translation>Creata da</translation>
+        <translation>Proprietario</translation>
     </message>
     <message>
         <source>Map</source>
@@ -2030,6 +2187,18 @@
         <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 @@
     </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 @@
     </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 @@
     </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 @@
     </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 @@
     </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 @@
     </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 @@
     </message>
     <message>
         <source>put</source>
-        <translation>usa</translation>
+        <translation>usa/piazza sul terreno</translation>
     </message>
     <message>
         <source>switch</source>
@@ -2344,6 +2494,14 @@
         <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 @@
     </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 @@
     </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>
--- a/share/hedgewars/Data/Locale/hedgewars_ja.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_ja.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</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,24 +52,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 さんは無視リストから削除されています</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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +157,14 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -345,10 +290,6 @@
         <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,20 +306,35 @@
         <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>
-    </message>
-    <message>
         <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>
@@ -388,6 +344,26 @@
     </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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt; &lt;b&gt;%2&lt;/b&gt; で &lt;b&gt;%1&lt;/b&gt; が一番良いショットの賞をもらった &lt;/p&gt;</translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -542,16 +514,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>ネットワーク ゲーム</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -800,6 +771,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -848,6 +844,14 @@
         <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,18 +895,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">一般</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">高級</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Rename dialog</translation>
     </message>
@@ -910,18 +950,6 @@
         <source>Enter new file name:</source>
         <translation>新しいファイル名:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Cannot rename to</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>ファイル削除は不可能</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>録画を選択下さい</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -934,18 +962,6 @@
         <translation>接続</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>更新</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation type="unfinished">アドミン機能</translation>
     </message>
@@ -954,60 +970,6 @@
         <translation type="unfinished">ルーム名:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished">このゲームはロビー中。</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;ll have to wait for the game to end to start playing.</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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</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>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>ルーム名を入力してください</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1023,15 +985,6 @@
         <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">
@@ -1184,31 +1137,47 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>簡単ゲーム (パソコンとのゲーム、自動設定)</translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>マルチプレイヤー (パソコンまたは友達との戦い)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">訓練モード (訓練任務で上達) 開発中</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>デモ (録画されたデモを見る)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>ロード (その前保存したゲームをやる)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <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</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>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>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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>ネット別名</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Resolution</translation>
     </message>
@@ -1626,10 +1668,6 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>ネットワーク</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>サーバーの接続は切断された</translation>
     </message>
@@ -1723,81 +1819,221 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>武器</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">デフォールトセットの編集は不可能</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">デフォールトセットの削除は不可能</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>本当にこのデフォールトセットを削除する?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</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">チーム</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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished">サーバー%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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>フォルダー%1作成拒否</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>オケ</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1880,9 +2116,37 @@
         <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 @@
         <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 @@
     </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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_ko.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_ko.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ko">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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 yot 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,16 +153,14 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -340,6 +305,32 @@
         <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 @@
     </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 @@
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -495,16 +510,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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 type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation type="unfinished"></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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -753,6 +767,46 @@
         <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>
@@ -762,32 +816,17 @@
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -801,6 +840,14 @@
         <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>
@@ -844,18 +891,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation type="unfinished"></translation>
     </message>
@@ -863,18 +946,6 @@
         <source>Enter new file name:</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -887,18 +958,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation type="unfinished"></translation>
     </message>
@@ -907,60 +966,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;ll have to wait for the game to end to start playing.</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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</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>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -976,15 +981,6 @@
         <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,27 +1133,47 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <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</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>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>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>
@@ -1171,6 +1187,51 @@
         <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>
@@ -1273,6 +1334,26 @@
         <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 @@
         <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 @@
         <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 @@
         <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,10 +1712,6 @@
         <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>
@@ -1626,6 +1719,68 @@
         <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 yot 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>
@@ -1637,6 +1792,10 @@
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1648,10 +1807,6 @@
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1660,71 +1815,221 @@
         <translation type="unfinished"></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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</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"></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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished"></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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1807,9 +2112,37 @@
         <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,6 +2171,18 @@
         <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>
@@ -1867,21 +2212,6 @@
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2147,6 +2477,14 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_lt.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_lt.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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>
-    <message>
-        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="678"/>
-        <source>copy of</source>
+    <name>AbstractPage</name>
+    <message>
+        <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>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="89"/>
-        <source>Cannot open file &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="102"/>
-        <source>Cannot read file &apos;%1&apos;</source>
+    <name>AmmoSchemeModel</name>
+    <message>
+        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="673"/>
+        <source>new</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>
-    <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>
+</context>
+<context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="33"/>
+        <source>Do yot 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&apos;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 @@
         <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.
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1015"/>
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="751"/>
-        <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>
-        <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 @@
 <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 @@
 <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 @@
 <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 @@
 <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 @@
     </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 @@
 <context>
     <name>PageDrawMap</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="31"/>
-        <source>Undo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="32"/>
-        <source>Clear</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="33"/>
-        <source>Load</source>
+        <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="35"/>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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 @@
         <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 &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; 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 &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -568,7 +584,7 @@
         </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 &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -577,7 +593,7 @@
         </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 @@
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="254"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="263"/>
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -595,7 +611,7 @@
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="261"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="271"/>
         <source>&lt;b&gt;%1&lt;/b&gt; killed &lt;b&gt;%2&lt;/b&gt; of his own hedgehogs.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -604,7 +620,7 @@
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="268"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="279"/>
         <source>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; times.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -622,312 +638,360 @@
     </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>
-        <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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="57"/>
+        <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="104"/>
-        <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&apos;ll win or lose together.</source>
-        <comment>Tips</comment>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="105"/>
-        <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"/>
-        <source>If you&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;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"/>
-        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don&apos;t touch the ground you&apos;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"/>
-        <source>If you&apos;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"/>
-        <source>You&apos;re bored of default gameplay? Try one of the missions - they&apos;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"/>
-        <source>By default the game will always record the last game played as a demo. Select &apos;Local Game&apos; and pick the &apos;Demos&apos; 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"/>
-        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you&apos;ve got problems, ask on our forums but please don&apos;t expect 24/7 support!</source>
-        <comment>Tips</comment>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="112"/>
-        <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"/>
-        <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"/>
-        <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"/>
-        <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"/>
-        <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"/>
-        <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"/>
-        <source>Always remember you&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; option.</source>
-        <comment>Tips</comment>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="119"/>
-        <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"/>
-        <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"/>
-        <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"/>
-        <source>If your graphics card isn&apos;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"/>
-        <source>If your graphics card isn&apos;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"/>
-        <source>We&apos;re open to suggestions and constructive feedback. If you don&apos;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"/>
-        <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"/>
-        <source>Special game modes such as &apos;Vampirism&apos; or &apos;Karma&apos; 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"/>
-        <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>
+        <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>You should never install Hedgewars on computers you don&apos;t own (school, university, work, etc.). Please ask the responsible person instead!</source>
+        <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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="129"/>
-        <source>Hedgewars can be perfect for short games during breaks. Just ensure you don&apos;t add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
+        <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="130"/>
-        <source>No hedgehogs were harmed in making this game.</source>
+        <source>If you&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;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="131"/>
-        <source>There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.</source>
+        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don&apos;t touch the ground you&apos;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="132"/>
-        <source>Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.</source>
+        <source>If you&apos;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="133"/>
-        <source>Some weapons require special strategies or just lots of training, so don&apos;t give up on a particular tool if you miss an enemy once.</source>
+        <source>You&apos;re bored of default gameplay? Try one of the missions - they&apos;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="134"/>
-        <source>Most weapons won&apos;t work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
+        <source>By default the game will always record the last game played as a demo. Select &apos;Local Game&apos; and pick the &apos;Demos&apos; 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="135"/>
-        <source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you&apos;ve got problems, ask on our forums but please don&apos;t expect 24/7 support!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="136"/>
-        <source>The Piano Strike is the most damaging air strike. You&apos;ll lose the hedgehog performing it, so there&apos;s a huge downside as well.</source>
+        <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="137"/>
-        <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
+        <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="138"/>
-        <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
+        <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>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
+        <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="140"/>
-        <source>If you&apos;re stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
+        <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="141"/>
-        <source>The Cake&apos;s maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
+        <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="142"/>
-        <source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
+        <source>Always remember you&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; option.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="143"/>
-        <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
+        <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="144"/>
-        <source>Want to know who&apos;s behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
+        <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="145"/>
-        <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
+        <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="146"/>
-        <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you&apos;ll have to share them somewhere to use them online.</source>
+        <source>If your graphics card isn&apos;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="147"/>
-        <source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
+        <source>If your graphics card isn&apos;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&apos;re open to suggestions and constructive feedback. If you don&apos;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="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="150"/>
+        <source>Special game modes such as &apos;Vampirism&apos; or &apos;Karma&apos; 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="151"/>
-        <source>Keep your video card drivers up to date to avoid issues playing the game.</source>
+        <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="152"/>
-        <source>You&apos;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>
+        <source>You should never install Hedgewars on computers you don&apos;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="153"/>
+        <source>Hedgewars can be perfect for short games during breaks. Just ensure you don&apos;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="154"/>
-        <source>You can find your Hedgewars configuration files under &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <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="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="156"/>
-        <source>You can find your Hedgewars configuration files under &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <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="157"/>
+        <source>Some weapons require special strategies or just lots of training, so don&apos;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="158"/>
+        <source>Most weapons won&apos;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="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="160"/>
+        <source>The Piano Strike is the most damaging air strike. You&apos;ll lose the hedgehog performing it, so there&apos;s a huge downside as well.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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="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="164"/>
+        <source>If you&apos;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="165"/>
+        <source>The Cake&apos;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="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="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="168"/>
+        <source>Want to know who&apos;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="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="170"/>
+        <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you&apos;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="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="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="176"/>
+        <source>You&apos;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="178"/>
+        <source>You can find your Hedgewars configuration files under &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="180"/>
+        <source>You can find your Hedgewars configuration files under &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="182"/>
         <source>You can find your Hedgewars configuration files under &quot;.hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -942,40 +1006,22 @@
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="111"/>
-        <source>Error</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>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="84"/>
+        <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/pagenetgame.cpp" line="87"/>
         <source>Control</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="156"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="157"/>
-        <source>Please enter room name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="158"/>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>PageNetType</name>
@@ -986,248 +1032,185 @@
     </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 type="unfinished"></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="76"/>
+        <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 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&apos;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>
+    <message>
+        <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/pageoptions.cpp" line="454"/>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="455"/>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="456"/>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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>
-        <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>
-        <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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="122"/>
+        <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="122"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="137"/>
         <source>Enter new file name:</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="134"/>
-        <source>Cannot rename to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="157"/>
-        <source>Cannot delete file</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&apos;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>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="310"/>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="315"/>
-        <source>Random Map</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="321"/>
-        <source>Random Maze</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>
-        <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>
-        <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>
-        <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"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="492"/>
         <source>%1 players online</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -1239,152 +1222,152 @@
 <context>
     <name>PageScheme</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="71"/>
+        <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/pagescheme.cpp" line="75"/>
+        <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/pagescheme.cpp" line="79"/>
+        <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/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>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 type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="91"/>
+        <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/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"/>
-        <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"/>
-        <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"/>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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"/>
-        <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"/>
-        <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"/>
-        <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"/>
+        <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="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="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="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"/>
-        <source>Disable girders when generating random maps.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="135"/>
-        <source>Disable land objects when generating random maps.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="139"/>
-        <source>AI respawns on death.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="143"/>
-        <source>Attacking does not end your turn.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="147"/>
-        <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"/>
-        <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"/>
-        <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"/>
-        <source>Wind will affect almost everything.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="163"/>
-        <source>Teams in each clan take successive turns sharing their turn time.</source>
+        <source>Disable girders when generating random maps.</source>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="162"/>
+        <source>Attacking does not end your turn.</source>
         <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 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 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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="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 @@
     <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>
-        <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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="47"/>
-        <source>Campaign Mode (...)</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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="62"/>
-        <source>Demos (Watch recorded demos)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="65"/>
-        <source>Load (Load a previously saved game)</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="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="66"/>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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>
 </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 @@
 <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="312"/>
+        <source>Disabled</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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>Disabled</source>
+        <source>Blue/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="326"/>
-        <source>Red/Cyan</source>
+        <source>Red/Green grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="327"/>
-        <source>Cyan/Red</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="328"/>
-        <source>Red/Blue</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="329"/>
-        <source>Blue/Red</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="330"/>
-        <source>Red/Green</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="331"/>
-        <source>Green/Red</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="332"/>
-        <source>Side-by-side</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="333"/>
-        <source>Top-Bottom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="334"/>
-        <source>Wiggle</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="335"/>
-        <source>Red/Cyan grayscale</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="336"/>
-        <source>Cyan/Red grayscale</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="337"/>
-        <source>Red/Blue grayscale</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="338"/>
-        <source>Blue/Red grayscale</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="339"/>
-        <source>Red/Green grayscale</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="340"/>
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 &apos;work in progress&apos; 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,155 +2020,222 @@
         <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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="209"/>
+        <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="296"/>
+        <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 type="unfinished"></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>Quality</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="321"/>
         <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 yot 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"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="882"/>
         <source>unnamed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/team.cpp" line="40"/>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="336"/>
+        <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="57"/>
+        <location filename="../../../../QTfrontend/ui_hwform.cpp" line="59"/>
         <source>Hedgewars %1</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2055,112 +2243,309 @@
 <context>
     <name>QMessageBox</name>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="658"/>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="387"/>
-        <source>Teams</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>
-        <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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="667"/>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1014"/>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1015"/>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;!</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="1365"/>
-        <source>All file associations have been set.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1366"/>
+        <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.come 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/main.cpp" line="161"/>
+        <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/main.cpp" line="162"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="277"/>
+        <source>Cannot use the ammo &apos;%1&apos;!</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/ui/page/pagescheme.cpp" line="494"/>
-        <source>Really delete this game scheme?</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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="193"/>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="240"/>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="244"/>
-        <source>Really delete this weapon set?</source>
+
+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 &apos;%1&apos;?</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 &apos;%1&apos;?</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/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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="122"/>
+        <source>Cannot open &apos;%1&apos; 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 &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="255"/>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="49"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="50"/>
-        <source>Cannot create directory %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="51"/>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <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 @@
     </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 @@
         <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 @@
         <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>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="212"/>
+    <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 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 @@
         <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 @@
         <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"/>
-        <source>Low Gravity</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <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="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"/>
-        <source>Vampirism</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="107"/>
-        <source>Karma</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <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="116"/>
+        <source>Karma</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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"/>
-        <source>King</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="123"/>
-        <source>Place Hedgehogs</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="127"/>
-        <source>Clan Shares Ammo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <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="136"/>
+        <source>Place Hedgehogs</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="146"/>
         <source>Disable Girders</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="135"/>
-        <source>Disable Land Objects</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="139"/>
-        <source>AI Survival Mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="143"/>
-        <source>Unlimited Attacks</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="147"/>
-        <source>Reset Weapons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <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="156"/>
+        <source>AI Survival Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="166"/>
+        <source>Reset Weapons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 @@
     </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 @@
         <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"/>
-        <source>Take a screenshot:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
+        <source>Take a screenshot:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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"/>
-        <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"/>
+        <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="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"/>
-        <source>(Left)</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="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"/>
-        <source>Mouse: Left button</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="21"/>
-        <source>Mouse: Middle button</source>
+        <source>Mouse: Left button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="22"/>
-        <source>Mouse: Right button</source>
+        <source>Mouse: Middle button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="23"/>
-        <source>Mouse: Wheel up</source>
+        <source>Mouse: Right button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="24"/>
-        <source>Mouse: Wheel down</source>
+        <source>Mouse: Wheel up</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="25"/>
-        <source>Backspace</source>
+        <source>Mouse: Wheel down</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="26"/>
-        <source>Tab</source>
+        <source>Backspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="27"/>
-        <source>Clear</source>
+        <source>Tab</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="28"/>
-        <source>Return</source>
+        <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="29"/>
-        <source>Pause</source>
+        <source>Return</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="30"/>
-        <source>Escape</source>
+        <source>Pause</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="31"/>
+        <source>Escape</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="32"/>
         <source>Space</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="95"/>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="96"/>
-        <source>Numpad 0</source>
+        <source>Delete</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="97"/>
-        <source>Numpad 1</source>
+        <source>Numpad 0</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="98"/>
-        <source>Numpad 2</source>
+        <source>Numpad 1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="99"/>
-        <source>Numpad 3</source>
+        <source>Numpad 2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="100"/>
-        <source>Numpad 4</source>
+        <source>Numpad 3</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="101"/>
-        <source>Numpad 5</source>
+        <source>Numpad 4</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="102"/>
-        <source>Numpad 6</source>
+        <source>Numpad 5</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="103"/>
-        <source>Numpad 7</source>
+        <source>Numpad 6</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="104"/>
-        <source>Numpad 8</source>
+        <source>Numpad 7</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="105"/>
-        <source>Numpad 9</source>
+        <source>Numpad 8</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="106"/>
-        <source>Numpad .</source>
+        <source>Numpad 9</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="107"/>
-        <source>Numpad /</source>
+        <source>Numpad .</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="108"/>
-        <source>Numpad *</source>
+        <source>Numpad /</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="109"/>
-        <source>Numpad -</source>
+        <source>Numpad *</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="110"/>
-        <source>Numpad +</source>
+        <source>Numpad -</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="111"/>
-        <source>Enter</source>
+        <source>Numpad +</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="112"/>
-        <source>Equals</source>
+        <source>Enter</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="113"/>
-        <source>Up</source>
+        <source>Equals</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="114"/>
-        <source>Down</source>
+        <source>Up</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="115"/>
-        <source>Right</source>
+        <source>Down</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="116"/>
-        <source>Left</source>
+        <source>Right</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="117"/>
-        <source>Insert</source>
+        <source>Left</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="118"/>
-        <source>Home</source>
+        <source>Insert</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="119"/>
-        <source>End</source>
+        <source>Home</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="120"/>
-        <source>Page up</source>
+        <source>End</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="121"/>
+        <source>Page up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="122"/>
         <source>Page down</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="137"/>
-        <source>Num lock</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="138"/>
-        <source>Caps lock</source>
+        <source>Num lock</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="139"/>
-        <source>Scroll lock</source>
+        <source>Caps lock</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="140"/>
-        <source>Right shift</source>
+        <source>Scroll lock</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="141"/>
-        <source>Left shift</source>
+        <source>Right shift</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="142"/>
-        <source>Right ctrl</source>
+        <source>Left shift</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="143"/>
-        <source>Left ctrl</source>
+        <source>Right ctrl</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="144"/>
-        <source>Right alt</source>
+        <source>Left ctrl</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="145"/>
-        <source>Left alt</source>
+        <source>Right alt</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="146"/>
-        <source>Right meta</source>
+        <source>Left alt</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="147"/>
+        <source>Right meta</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="148"/>
         <source>Left meta</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="153"/>
-        <source>A button</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="154"/>
-        <source>B button</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="155"/>
-        <source>X button</source>
+        <source>A button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="156"/>
-        <source>Y button</source>
+        <source>B button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="157"/>
-        <source>LB button</source>
+        <source>X button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="158"/>
-        <source>RB button</source>
+        <source>Y button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="159"/>
-        <source>Back button</source>
+        <source>LB button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="160"/>
-        <source>Start button</source>
+        <source>RB button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="161"/>
-        <source>Left stick</source>
+        <source>Back button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="162"/>
+        <source>Start button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="163"/>
+        <source>Left stick</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="164"/>
         <source>Right stick</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="168"/>
-        <source>Left stick (Right)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="169"/>
-        <source>Left stick (Left)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="170"/>
-        <source>Left stick (Down)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="171"/>
-        <source>Left stick (Up)</source>
+        <source>Left stick (Right)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="172"/>
-        <source>Left trigger</source>
+        <source>Left stick (Left)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="173"/>
-        <source>Right trigger</source>
+        <source>Left stick (Down)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="174"/>
-        <source>Right stick (Down)</source>
+        <source>Left stick (Up)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="175"/>
-        <source>Right stick (Up)</source>
+        <source>Left trigger</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="176"/>
-        <source>Right stick (Right)</source>
+        <source>Right trigger</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="177"/>
-        <source>Right stick (Left)</source>
+        <source>Right stick (Down)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="178"/>
+        <source>Right stick (Up)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/sdlkeys.h" line="179"/>
+        <source>Right stick (Right)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="180"/>
+        <source>Right stick (Left)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="182"/>
         <source>DPad</source>
         <translation type="unfinished"></translation>
     </message>
--- a/share/hedgewars/Data/Locale/hedgewars_nl.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_nl.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="nl">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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 yot 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,16 +154,14 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -322,16 +287,6 @@
         <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 @@
         <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 @@
     </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 @@
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -512,16 +517,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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 type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation type="unfinished"></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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -770,6 +774,46 @@
         <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>
@@ -779,32 +823,17 @@
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -818,6 +847,14 @@
         <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>
@@ -861,18 +898,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation type="unfinished"></translation>
     </message>
@@ -880,18 +953,6 @@
         <source>Enter new file name:</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -904,18 +965,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation type="unfinished"></translation>
     </message>
@@ -924,62 +973,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;ll have to wait for the game to end to start playing.</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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</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>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -995,15 +988,6 @@
         <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,27 +1141,47 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <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</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>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>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>
@@ -1191,6 +1195,52 @@
         <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>
@@ -1293,6 +1343,26 @@
         <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 @@
         <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 @@
         <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 @@
         <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,10 +1721,6 @@
         <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>
@@ -1646,6 +1728,68 @@
         <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 yot 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>
@@ -1657,6 +1801,10 @@
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1668,10 +1816,6 @@
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1680,71 +1824,222 @@
         <translation type="unfinished"></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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</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"></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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished"></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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1827,9 +2122,37 @@
         <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,6 +2181,18 @@
         <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>
@@ -1887,21 +2222,6 @@
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2167,6 +2487,14 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_pl.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_pl.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pl">
 <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>Błąd pliku</translation>
-    </message>
-    <message>
-        <source>Cannot open file &apos;%1&apos; for writing</source>
-        <translation>Nie można otworzyć &apos;%1&apos; do zapisu</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Nie można odczytać pliku &apos;%1&apos;</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,112 +45,75 @@
         <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>
     <message>
         <source>Game Options</source>
-        <translation type="unfinished">Opcje</translation>
+        <translation>Opcje</translation>
+    </message>
+</context>
+<context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    <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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 został usunięty z listy ignorowanych</translation>
     </message>
     <message>
         <source>%1 has been added to your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 został dodany do listy ignorowanych</translation>
     </message>
     <message>
         <source>%1 has been removed from your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 został usunięty z listy przyjaciół</translation>
     </message>
     <message>
         <source>%1 has been added to your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 został dodany do listy przyjaciół</translation>
     </message>
     <message>
         <source>Stylesheet imported from %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Arkusz stylów został zaimportowany 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>Wpisz %1 jeśli chcesz użyć tego arkusza stylów w przyszłości. Wpisz %2 by go zresetować!</translation>
     </message>
     <message>
         <source>Couldn&apos;t read %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Nie można odczytać %1</translation>
     </message>
     <message>
         <source>StyleSheet discarded</source>
-        <translation type="unfinished"></translation>
+        <translation>Arkusz stylów został odrzucony</translation>
     </message>
     <message>
         <source>StyleSheet saved to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Arkusz stylów został zapisany jako %1</translation>
     </message>
     <message>
         <source>Failed to save StyleSheet to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Nie można było zapisać arkusza stylów jako %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 jest poprawnym poleceniem!</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>
@@ -190,42 +137,33 @@
     </message>
     <message>
         <source>Game aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Hasło</translation>
+        <translation>Gra przerwana</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">Twój nick %1 jest zarejestrowany
+        <translation>Twój nick %1 jest zarejestrowany
 na Hedgewars.org
 Proszę podać hasło bądź zmienić nick
 w ustawieniach gry:</translation>
     </message>
     <message>
         <source>No password supplied.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nie podano hasła.</translation>
     </message>
     <message>
         <source>Nickname</source>
-        <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">Ktoś właśnie używa
-tego nicku %1
-na serwerze.
-Przoszę wybrać nowy nick:</translation>
+        <translation>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 type="unfinished"></translation>
     </message>
 </context>
@@ -279,10 +217,6 @@
         <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 +291,6 @@
         <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,31 +307,33 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nick</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>
-    </message>
-    <message>
         <source>User quit</source>
+        <translation>Użytkownik wyszedł</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">Hasło</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,16 +345,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Wiadomość od serwera:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Ustaw wiadomość</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Wyczyść pamięć podręczną</translation>
     </message>
@@ -467,10 +401,6 @@
         <source>Connecting...</source>
         <translation>Łączenie...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Anuluj</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -495,10 +425,6 @@
         <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 +436,10 @@
         <source>All files</source>
         <translation>Wszystkie pliki</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -525,26 +455,6 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Odznaczenie za najlepszy strzał przyznano &lt;b&gt;%1&lt;/b&gt;, zadał(a) on(a) &lt;b&gt;%2&lt;/b&gt; punktów obrażeń.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Najlepszym zabójcą jest &lt;b&gt;%1&lt;/b&gt; z &lt;b&gt;%2&lt;/b&gt; zabiciami w przeciągu tury.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Najlepszym zabójcą jest &lt;b&gt;%1&lt;/b&gt; z &lt;b&gt;%2&lt;/b&gt; zabiciami w przeciągu tury.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Najlepszym zabójcą jest &lt;b&gt;%1&lt;/b&gt; z &lt;b&gt;%2&lt;/b&gt; zabiciami w przeciągu tury.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;W sumie &lt;b&gt;%1&lt;/b&gt; jeży zostało zabitych w tej walce.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;W sumie &lt;b&gt;%1&lt;/b&gt; jeży zostało zabitych w tej walce.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;W sumie &lt;b&gt;%1&lt;/b&gt; jeży zostało zabitych w tej walce.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Szczegóły</translation>
     </message>
@@ -584,10 +494,6 @@
             <numerusform>(%1 zabitych jeży)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 zabitych)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation>
@@ -617,20 +523,19 @@
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
+        <translation>W trakcie gry...</translation>
+    </message>
+</context>
+<context>
+    <name>PageInfo</name>
+    <message>
+        <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>Gra lokalna (graj na jednym komputerze)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Gra sieciowa (graj przez internet lub LAN)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>By grać ze swoim przyjacielem w tej samej drużynie po prostu wybierzcie taki sam kolor obydwu zespołów. Każdy z was będzie sterować swoimi własnymi jeżami ale wygracie bądź przegracie jako jedna drużyna.</translation>
@@ -646,11 +551,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 +601,6 @@
         <translation>Zawsze możesz zmieniać ustawienia gry w opcjach gry lokalnej lub sieciowej. Nie musisz ciągle używać tzw. &quot;Szybkiej gry&quot;.</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 +626,6 @@
         <translation>Specjalne tryby gry takie jak &quot;Karma&quot; bądź &quot;Wampiryzm&quot; 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&apos;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,14 +641,9 @@
         <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ę pownieneś upomnieć się o swoje pieniądze!</translation>
+        <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>
     </message>
     <message>
         <source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
@@ -803,7 +683,7 @@
     <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>Cuchnący ser nie powoduje wielkiego wybuchu. Jednakże pod wpływem wiatu chmura śmierdzącego gazu może bardzo daleko zawędrować i otruć wiele jeży naraz.</translation>
+        <translation>Cuchnący ser nie powoduje wielkiego wybuchu. Jednakże pod wpływem wiatru chmura śmierdzącego gazu może bardzo daleko zawędrować i otruć wiele jeży naraz.</translation>
     </message>
     <message>
         <source>The Piano Strike is the most damaging air strike. You&apos;ll lose the hedgehog performing it, so there&apos;s a huge downside as well.</source>
@@ -811,11 +691,6 @@
         <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&apos;s turn radius depends on it&apos;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 +716,6 @@
         <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&apos;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 +746,6 @@
         <translation>Swoje zespoły i konfigurację gry znajdziesz w folderze &quot;Moje Dokumenty\Hedgewars&quot;. 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 &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Swoje zespoły i konfigurację gry znajdzie4sz w folderze &quot;.hedgewars&quot; w twoim katalogu domowym. Twórz regularnie kopie zapasowe ale nie edytuj tych plików własnoręcznie.</translation>
-    </message>
-    <message>
         <source>You&apos;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>
@@ -917,7 +782,47 @@
     </message>
     <message>
         <source>Downloadable Content</source>
-        <translation>Dodatki do pobrania</translation>
+        <translation>Dodatki</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>
@@ -928,33 +833,18 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Dodatki</translation>
     </message>
 </context>
 <context>
@@ -967,6 +857,14 @@
         <source>Official server</source>
         <translation>Oficjalny serwer</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>
@@ -983,18 +881,6 @@
         <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&apos;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,18 +908,54 @@
         <source>Delete weapon set</source>
         <translation>Usuń zestaw uzbrojenia</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Ogólne</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Zaawansowane</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>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>
@@ -1041,18 +963,6 @@
         <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>
@@ -1065,18 +975,6 @@
         <translation>Dołącz</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Odśwież</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Błąd</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Ustawienia admina</translation>
     </message>
@@ -1085,70 +983,6 @@
         <translation>Nazwa pokoju:</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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Losowa mapa</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>
-    </message>
-    <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Schemat określa ustawnienia i preferencje takie jak Czas trwania tury, Nagłą śmierć, Wampiryzm itp.</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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Wprowadź nazwę pokoju</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Wybierz pokój z listy</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Losowy labirynt</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Stan:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Zasady:</translation>
     </message>
@@ -1164,16 +998,6 @@
         <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 +1030,6 @@
         <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 +1042,6 @@
         <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,35 +1152,47 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Dema (zobacz nagrane dema)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Wczytaj grę (wczytaj poprzednio zapisaną grę)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampania (...). W PRODUKCJI</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Wczytaj</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1372,10 +1200,57 @@
     <name>PageTraining</name>
     <message>
         <source>No description available</source>
-        <translation type="unfinished"></translation>
+        <translation>Brak opisu</translation>
     </message>
     <message>
         <source>Select a mission!</source>
+        <translation>Wybierz misję!</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">Nazwa</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>
@@ -1395,7 +1270,7 @@
     </message>
     <message>
         <source>Restrict Team Additions</source>
-        <translation>Zabroń dodawania drużyn</translation>
+        <translation>Zablokuj drużyny</translation>
     </message>
     <message>
         <source>Info</source>
@@ -1465,10 +1340,6 @@
         <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>
@@ -1484,6 +1355,26 @@
         <source>Frontend effects</source>
         <translation>Efekty w 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>
@@ -1528,42 +1419,6 @@
         <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 +1510,6 @@
         <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 +1537,34 @@
         <source>Schemes and Weapons</source>
         <translation>Schematy i uzbrojenie</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">Ten program jest rozprowadzany na zasadach powszechnej licencji publicznej GNU</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Twórcy:</translation>
     </message>
@@ -1730,10 +1601,6 @@
         <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 +1685,6 @@
         <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 &apos;work in progress&apos; 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 +1693,6 @@
         <translation>Rada:</translation>
     </message>
     <message>
-        <source>This HG build is &apos;work in progress&apos; 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 &apos;work in progress&apos; 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 +1718,14 @@
         <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,15 +1734,73 @@
         <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>
     <message>
         <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 yot 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>
@@ -1916,6 +1814,10 @@
         <source>hedgehog %1</source>
         <translation>jeż %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1927,10 +1829,6 @@
 <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 +1837,224 @@
         <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 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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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">Nie można utworzyć katalogu %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Nie można otworzyć katalogu z danymi:
-%1
-Sprawdź poprawność instalacji</translation>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Uzbrojenie</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Nie można zmienić domyślnego zestawu uzbrojenia</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Nie można usunąć domyślnego zestawu uzbrojenia</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Czy na pewno usunąć ten zestaw uzbrojenia?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Nie można nadpisać zestawu uzbrojenia &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Wszystkie powiązania plików zostały utworzone</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Powiązanie plików nie powiodło się.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Drużyny</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Na pewno usunąć tę drużynę?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Schematy</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Nie można usunąć domyśłnego schematu &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Na pewno usunąć ten schemat?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Nie można usunąć domyśłnego zestawu usbrojenia &apos;%1&apos;!</translation>
+
+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 type="unfinished">Nie można uruchomić serwera: %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 type="unfinished">Wprowadź nazwę pokoju</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">Wybierz nagranie z listy</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Wybierz pokój z listy</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">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 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 &apos;%1&apos;?</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 &apos;%1&apos;?</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">Błąd pliku</translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>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>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Nick</translation>
     </message>
@@ -2093,43 +2134,79 @@
         <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 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">W toku</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Nazwa pokoju</translation>
+        <translation type="unfinished">Nazwa pokoju</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>Kli</translation>
+        <translation type="unfinished">Kli</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>Druż</translation>
+        <translation type="unfinished">Druż</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Właśc</translation>
+        <translation type="unfinished">Właśc</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Mapa</translation>
+        <translation type="unfinished">Mapa</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Schemat</translation>
+        <translation type="unfinished">Schemat</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Uzbrojenie</translation>
+        <translation type="unfinished">Uzbrojenie</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Losowa mapa</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Losowy labirynt</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2160,21 +2237,6 @@
     </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 +2279,6 @@
         <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 +2502,14 @@
         <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>
@@ -2530,6 +2596,10 @@
         <source>Toggle labels above hedgehogs:</source>
         <translation>Zmień szczegółowość opisów nad jeżami:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
--- a/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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,16 +157,14 @@
         <translation type="unfinished">Apelido</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -346,20 +291,6 @@
         <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,23 +307,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Apelido</translation>
-    </message>
-    <message>
         <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">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>
 <context>
     <name>KB</name>
@@ -402,6 +345,26 @@
     </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 @@
         <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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;O prêmio de melhor disparo foi ganho por &lt;b&gt;%1&lt;/b&gt; , com &lt;b&gt;%2&lt;/b&gt; pontos.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;O prêmio de melhor matador é de &lt;b&gt;%1&lt;/b&gt;, com &lt;b&gt;%2&lt;/b&gt; morto em um turno.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Os prêmios de melhor matador vão para &lt;b&gt;%1&lt;/b&gt;, com &lt;b&gt;%2&lt;/b&gt; mortos em um turno.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Um total de &lt;b&gt;%1&lt;/b&gt; ouriço foi morto nesta batalha.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Um total de &lt;b&gt;%1&lt;/b&gt; ouriços foram mortos nesta batalha.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>&lt;h1&gt;&lt;img src=&quot;:/res/StatsD.png&quot;&gt; Details&lt;/h1&gt;</source>
-        <translation type="obsolete">&lt;h1&gt;&lt;img src=&quot;:/res/StatsD.png&quot;&gt; Detalhes&lt;/h1&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;br&gt;&lt;h1&gt;&lt;img src=&quot;:/res/StatsH.png&quot;&gt; Health graph&lt;/h1&gt;</source>
-        <translation type="obsolete">&lt;br&gt;&lt;h1&gt;&lt;img src=&quot;:/res/StatsH.png&quot;&gt; Desenvolvimento&lt;/h1&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;h1&gt;&lt;img src=&quot;:/res/StatsR.png&quot;&gt; Ranking&lt;/h1&gt;</source>
-        <translation type="obsolete">&lt;h1&gt;&lt;img src=&quot;:/res/StatsR.png&quot;&gt; Ranking&lt;/h1&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;&lt;img src=&quot;:/res/StatsBestShot.png&quot;&gt; The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;&lt;img src=&quot;:/res/StatsBestShot.png&quot;&gt; O prêmio de melhor tiro vai para &lt;b&gt;%1&lt;/b&gt; com &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;&lt;img src=&quot;:/res/StatsBestKiller.png&quot;&gt; The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;&lt;img src=&quot;:/res/StatsBestKiller.png&quot;&gt; O melhor matador é &lt;b&gt;%1&lt;/b&gt; com &lt;b&gt;%2&lt;/b&gt; mortes em um turno.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;&lt;img src=&quot;:/res/StatsBestKiller.png&quot;&gt; Os melhores matadores são &lt;b&gt;%1&lt;/b&gt; com &lt;b&gt;%2&lt;/b&gt; mortes em um turno.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;&lt;img src=&quot;:/res/StatsHedgehogsKilled.png&quot;&gt; A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;&lt;img src=&quot;:/res/StatsHedgehogsKilled.png&quot;&gt; Um total de &lt;b&gt;%1&lt;/b&gt; ouriço foi morto neste round.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;&lt;img src=&quot;:/res/StatsHedgehogsKilled.png&quot;&gt; Um total de &lt;b&gt;%1&lt;/b&gt; ouriços foram mortos neste round.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;&lt;h2&gt;%1 %2. &lt;font color=&quot;%5&quot;&gt;%3&lt;/font&gt;  (%4 kill).&lt;/h2&gt;&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;&lt;h2&gt;%1 %2. &lt;font color=&quot;%5&quot;&gt;%3&lt;/font&gt;  (%4 morte).&lt;/h2&gt;&lt;/p&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;&lt;h2&gt;%1 %2. &lt;font color=&quot;%5&quot;&gt;%3&lt;/font&gt;  (%4 kills).&lt;/h2&gt;&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;&lt;h2&gt;%1 %2. &lt;font color=&quot;%5&quot;&gt;%3&lt;/font&gt;  (%4 mortes).&lt;/h2&gt;&lt;/p&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;&lt;img src=&quot;:/res/StatsMostSelfDamage.png&quot;&gt; &lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;&lt;img src=&quot;:/res/StatsMostSelfDamage.png&quot;&gt; &lt;b&gt;%1&lt;/b&gt; pensou que era bom atirar na sua própria equipe totalizando &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;&lt;img src=&quot;:/res/StatsSelfKilled.png&quot;&gt; &lt;b&gt;%1&lt;/b&gt; killed &lt;b&gt;%2&lt;/b&gt; of his own hedgehogs.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;&lt;img src=&quot;:/res/StatsSelfKilled.png&quot;&gt; &lt;b&gt;%1&lt;/b&gt; matou &lt;b&gt;%2&lt;/b&gt; dos próprios ouriços.&lt;/p&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;&lt;img src=&quot;:/res/StatsSkipped.png&quot;&gt; &lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; times.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;&lt;img src=&quot;:/res/StatsSkipped.png&quot;&gt; &lt;b&gt;%1&lt;/b&gt; estava assustado e passou o turno &lt;b&gt;%2&lt;/b&gt; vezes.&lt;/p&gt;</translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detalhes</translation>
     </message>
@@ -600,10 +491,6 @@
             <numerusform>(%1 mortes)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 mortes)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation>
@@ -634,16 +521,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Jogo Local (Jogue uma partida em apenas um computador)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Jogo em Rede (Jogue uma partida em rede)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Use a mesma cor que um amigo para jogar como uma equipe única. Cada um controlará seus próprios ouriços, mas vencerão em equipe (ou perderão).</translation>
@@ -659,11 +545,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 @@
         <translation>Lembre-se que você pode selecionar suas próprias regras em jogos locais ou em rede. Você não está limitado ao &quot;Jogo Simples&quot;.</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 @@
         <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&apos;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 @@
         <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 @@
         <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&apos;s turn radius depends on it&apos;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 @@
         <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&apos;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 @@
         <translation>Você pode encontrar os arquivos de configuração em &quot;Meus Documentos\Hedgewars&quot;. 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 &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Você pode encontrar os arquivos de configuração em &quot;.hedgewars&quot;. Crie cópias ou leve os arquivos com você, mas não edite eles manualmente.</translation>
-    </message>
-    <message>
         <source>You&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -981,6 +852,14 @@
         <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 @@
         <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&apos;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,18 +903,54 @@
         <source>Delete weapon set</source>
         <translation>Apagar esquema de armas</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Geral</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Avançado</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Renomear</translation>
     </message>
@@ -1055,18 +958,6 @@
         <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>
@@ -1079,18 +970,6 @@
         <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>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Opções do Administrador</translation>
     </message>
@@ -1099,68 +978,6 @@
         <translation>Nome da Sala:</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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Mapa Aleatório</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>
-    </message>
-    <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>
-    </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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Entre com um nome de sala</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Selecione uma sala da lista</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Labirinto Aleatório</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Estado:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Regras:</translation>
     </message>
@@ -1176,16 +993,6 @@
         <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 @@
         <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 @@
         <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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Assista a demos gravadas)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Carregar (Carregue um jogo salvo)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modo Campanha (...) EM DESENVOLVIMENTO</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Carregar</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1389,6 +1200,52 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 &apos;work in progress&apos; 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 é &quot;trabalho em progresso&quot; 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 &apos;work in progress&apos; 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 é &quot;trabalho em progresso&quot; 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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Armas</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>
-    </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>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Realmente deseja remover este esquema de armas?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Não pode sobre-escrever o esquema %1!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Todos os arquivos foram associados.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Associação de arquivos falhou.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation type="unfinished">Equipes</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation type="unfinished">Realmente deseja apagar esta Equipe?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation type="unfinished">Esquemas</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation type="unfinished">Esquema padrão não pode ser apagado &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation type="unfinished">Realmente deseja apagar este esquema de jogo?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation type="unfinished">Esquema de armas não pode ser apagado &apos;%1&apos;!</translation>
+
+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 type="unfinished">Não foi possível iniciar o servidor: %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 type="unfinished">Entre com um nome de sala</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">Por favor selecione uma entrada da lista</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Selecione uma sala da lista</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">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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Não foi possível criar o diretório %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Apelido</translation>
     </message>
@@ -2096,45 +2125,79 @@
         <translation>Associar extensão de arquivos.</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translatorcomment>Esquema esta muito genérico</translatorcomment>
-        <translation type="obsolete">Esquema</translation>
-    </message>
-    <message>
         <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">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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pt_PT">
 <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>Erro no ficheiro</translation>
-    </message>
-    <message>
-        <source>Cannot open file &apos;%1&apos; for writing</source>
-        <translation>Impossivel abrir o ficheiro &apos;%1&apos; para escrita</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Impossivel let o ficheiro &apos;%1&apos;</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>
@@ -65,103 +49,70 @@
     </message>
     <message>
         <source>Game Options</source>
-        <translation type="unfinished">Opções de Jogo</translation>
+        <translation>Opções de Jogo</translation>
+    </message>
+</context>
+<context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    <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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 foi removido da tua lista de utilizadores ignorados</translation>
     </message>
     <message>
         <source>%1 has been added to your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 foi adicionado à tua lista de utilizadores ignorados</translation>
     </message>
     <message>
         <source>%1 has been removed from your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 foi removido da tua lista de amigos</translation>
     </message>
     <message>
         <source>%1 has been added to your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 foi adicionado à tua lista de amigos</translation>
     </message>
     <message>
         <source>Stylesheet imported from %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Stylesheet importado de %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>Introduz %1 se quiseres utilizar o StyleSheet corrente no futuro, introduz %2 para limpar!</translation>
     </message>
     <message>
         <source>Couldn&apos;t read %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Não foi possivel carregar %1</translation>
     </message>
     <message>
         <source>StyleSheet discarded</source>
-        <translation type="unfinished"></translation>
+        <translation>StyleSheet eliminado</translation>
     </message>
     <message>
         <source>StyleSheet saved to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>StyleSheet gravado em %1</translation>
     </message>
     <message>
         <source>Failed to save StyleSheet to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Não foi possível gravar o StyleSheet em %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 não é um comando valido!</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>
@@ -185,41 +136,33 @@
     </message>
     <message>
         <source>Game aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Password</translation>
+        <translation>Jogo abortado</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">O nome de utilizador %1 está
+        <translation>O nome de utilizador %1 está
 registado em Hedgewars.org
-Por favor digite a sua palavra passe ou escolha
+Por favor digita a tua palavra passe ou escolhe
 outro nome de utilizador no menu de configuração:</translation>
     </message>
     <message>
         <source>No password supplied.</source>
-        <translation type="unfinished"></translation>
+        <translation>Não foi fornecida uma palavra passe.</translation>
     </message>
     <message>
         <source>Nickname</source>
-        <translation type="unfinished">Nome de utilizador</translation>
-    </message>
-    <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">O nome de utilizador %1
-já está a ser utilizado no servidor.
-Por favor escolha outro nome de utilizador.</translation>
+        <translation>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 type="unfinished"></translation>
     </message>
 </context>
@@ -347,20 +290,6 @@
         <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,30 +306,33 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nome de utilizador</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>
-    </message>
-    <message>
         <source>User quit</source>
+        <translation>Utilizador saiu</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">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>
@@ -412,16 +344,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Mensagem do servidor:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Definir mensagem</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Limpar a cache das contas</translation>
     </message>
@@ -456,10 +400,6 @@
         <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 @@
         <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 @@
         <source>All files</source>
         <translation>Todos os ficheiros</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -514,24 +454,6 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;O título de melhor tiro foi para &lt;b&gt;%1&lt;/b&gt; com &lt;b&gt;%2&lt;/b&gt; pontos de dano.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;O extreminador da ronda foi &lt;b&gt;%1&lt;/b&gt; com &lt;b&gt;%2&lt;/b&gt; morto num unico turno.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;O extreminador da ronda foi &lt;b&gt;%1&lt;/b&gt; com &lt;b&gt;%2&lt;/b&gt; mortes num unico turno.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Apenas &lt;b&gt;%1&lt;/b&gt; ouriço perdeu a vida durante esta ronda.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Um total de &lt;b&gt;%1&lt;/b&gt; ouriços perderam a vida durante esta ronda.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detalhes</translation>
     </message>
@@ -594,20 +516,19 @@
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
+        <translation>Em jogo...</translation>
+    </message>
+</context>
+<context>
+    <name>PageInfo</name>
+    <message>
+        <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>Jogo local (Joga Hedgewars apenas com este computador)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Jogo em rede (Joga em rede ou na internet)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Simplesmente selecciona a mesma cor de outro jogador para jogarem em equipa. Continuas a ter total controlo dos teus ouriços, mas ganham ou perdem juntos.</translation>
@@ -854,8 +775,47 @@
     </message>
     <message>
         <source>Downloadable Content</source>
-        <translation>Conteúdo Transferível
-Downloadable Content</translation>
+        <translation>Conteúdo Transferível (DLC)</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>
@@ -866,33 +826,18 @@
     </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>
-    </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>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Conteúdo Transferível (DLC)</translation>
     </message>
 </context>
 <context>
@@ -905,6 +850,14 @@
         <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>
@@ -921,18 +874,6 @@
         <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&apos;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>
@@ -960,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation>Apagar esquema de armas</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Geral</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Avançado</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Renomear</translation>
     </message>
@@ -979,18 +956,6 @@
         <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>
@@ -1003,18 +968,6 @@
         <translation>Entrar</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Actualizar</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Recursos de administrador</translation>
     </message>
@@ -1023,68 +976,6 @@
         <translation>Nome da Sala:</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>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;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>
-    </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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Mapa Aleatório</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>
-    </message>
-    <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>
-    </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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Insira o nome da sala</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Seleccione uma sala da lista</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Labirinto Aleatório</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Estado:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Regras</translation>
     </message>
@@ -1100,16 +991,6 @@
         <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>
@@ -1122,11 +1003,11 @@
     <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>
@@ -1134,31 +1015,27 @@
     </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>
@@ -1182,7 +1059,7 @@
     </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>
@@ -1198,7 +1075,7 @@
     </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>
@@ -1206,7 +1083,7 @@
     </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>
@@ -1218,7 +1095,7 @@
     </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>
@@ -1226,7 +1103,7 @@
     </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>
@@ -1267,35 +1144,47 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (ver demos gravados)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Carregar (carrega um jogo salvo previamente)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modo Campanha (...) EM DESENVOLVIMENTO</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Carregar</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1303,10 +1192,56 @@
     <name>PageTraining</name>
     <message>
         <source>No description available</source>
-        <translation type="unfinished"></translation>
+        <translation>Sem descrição disponível</translation>
     </message>
     <message>
         <source>Select a mission!</source>
+        <translation>Selecciona uma missão!</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>
@@ -1396,10 +1331,6 @@
         <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>
@@ -1415,6 +1346,26 @@
         <source>Frontend effects</source>
         <translation>Efeitos no frontend</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>
@@ -1459,10 +1410,6 @@
         <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>
@@ -1550,10 +1497,6 @@
         <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>
@@ -1585,6 +1528,30 @@
         <source>Schemes and Weapons</source>
         <translation>Esquemas e Armamento</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>
@@ -1601,10 +1568,6 @@
         <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>
@@ -1637,10 +1600,6 @@
         <translation>Porta:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Nick de rede</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Resolução</translation>
     </message>
@@ -1662,15 +1621,15 @@
     </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>
@@ -1678,11 +1637,11 @@
     </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>
@@ -1717,10 +1676,6 @@
         <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>
@@ -1746,11 +1701,11 @@
     </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>
@@ -1761,10 +1716,6 @@
         <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>
@@ -1773,15 +1724,73 @@
         <translation>Esquema</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Password</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% Tempo Para Retirar</translation>
     </message>
     <message>
         <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 yot 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">Nome de utilizador</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>
@@ -1795,6 +1804,10 @@
         <source>hedgehog %1</source>
         <translation>ouriço %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1806,10 +1819,6 @@
 <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>
@@ -1818,81 +1827,223 @@
         <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 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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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 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:
-%1
-Por favor verifique a sua instalação</translation>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Armas</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>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Não é possível eliminar o esquema de armas predefinido</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Deseja mesmo eliminar este esquema de armas?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Não é possivel sobrescrever o esquema de armas por omissão &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Os ficheiros foram associados com sucesso.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Não foi possivel associar os ficheiros.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Equipas</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Deseja mesmo apagar esta equipa?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Esquemas</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Não é possível eliminar o esquema por omisão &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Deseja mesmo apagar este esquema de jogo?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Não é possível eliminar o esquema de armas por omisão &apos;%1&apos;!</translation>
+
+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 type="unfinished">Não foi possível iniciar o servidor: %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 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">Por favor seleccione uma gravação da lista</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Seleccione uma sala da lista</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">O jogo a que te estas a tentar juntar já começou.
+Desejas juntar-te ao jogo de qualquer maneira?</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 &apos;%1&apos;?</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 &apos;%1&apos;?</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">Erro no ficheiro</translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>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>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Nome de utilizador</translation>
     </message>
@@ -1975,36 +2126,76 @@
         <source>more</source>
         <translation>mais</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">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>
-        <translation>E</translation>
+        <translation type="unfinished">E</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Anfitrião</translation>
+        <translation type="unfinished">Anfitrião</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>
@@ -2035,21 +2226,6 @@
     </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>
@@ -2077,7 +2253,7 @@
     </message>
     <message>
         <source>Add Border</source>
-        <translation>Adicionar Borda</translation>
+        <translation>Adicionar Limites</translation>
     </message>
     <message>
         <source>Low Gravity</source>
@@ -2085,17 +2261,13 @@
     </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>
@@ -2125,7 +2297,7 @@
     </message>
     <message>
         <source>Reset Health</source>
-        <translation>Restaurar a Vida</translation>
+        <translation>Restaurar Vida</translation>
     </message>
     <message>
         <source>Unlimited Attacks</source>
@@ -2153,7 +2325,7 @@
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation>Adicionar borda inferior</translation>
+        <translation>Adicionar limite inferior</translation>
     </message>
 </context>
 <context>
@@ -2320,6 +2492,14 @@
         <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>
@@ -2406,6 +2586,10 @@
         <source>Toggle labels above hedgehogs:</source>
         <translation>Alterar as etiquetas acima dos ouriços:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/hedgewars_ro.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot read file &apos;%1&apos;</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&apos;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&apos;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&apos;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>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
+        <translation type="obsolete">&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
+        <translation type="obsolete">
+            <numerusform>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kill in a turn.&lt;/p&gt;</numerusform>
+            <numerusform>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
+        <translation type="obsolete">
+            <numerusform>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog was killed during this round.&lt;/p&gt;</numerusform>
+            <numerusform>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehogs were killed during this round.&lt;/p&gt;</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 &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.</source>
+        <translation>The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.</translation>
+    </message>
+    <message numerus="yes">
+        <source>The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.</source>
+        <translation>
+            <numerusform>The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kill in a turn.</numerusform>
+            <numerusform>The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.</source>
+        <translation>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; hedgehog was killed during this round.</numerusform>
+            <numerusform>A total of &lt;b&gt;%1&lt;/b&gt; 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>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;b&gt;%1&lt;/b&gt; killed &lt;b&gt;%2&lt;/b&gt; of his own hedgehogs.</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; times.</source>
+        <translation>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; time.</numerusform>
+            <numerusform>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; 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&apos;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&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;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&apos;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&apos;re bored of default gameplay? Try one of the missions - they&apos;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 &apos;Local Game&apos; and pick the &apos;Demos&apos; 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&apos;ve got problems, ask on our forums but please don&apos;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&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; 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&apos;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&apos;re open to suggestions and constructive feedback. If you don&apos;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 &apos;Vampirism&apos; or &apos;Karma&apos; 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&apos;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&apos;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&apos;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&apos;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&apos;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&apos;ll lose the hedgehog performing it, so there&apos;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&apos;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&apos;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&apos;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&apos;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 &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You&apos;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&apos;t touch the ground you&apos;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 &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under &quot;.hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;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&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
+        <translation>You can&apos;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&apos;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&apos;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 &apos;work in progress&apos; 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 &apos;%1&apos;!</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 &apos;%1&apos;!</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 &apos;%1&apos;!</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&apos;s zoom level:</source>
+        <translation>Modify the camera&apos;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&apos;s volume while playing:</source>
+        <translation>Modify the game&apos;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>
--- a/share/hedgewars/Data/Locale/hedgewars_ru.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_ru.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>Не могу открыть файл &apos;%1&apos; на запись</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Не могу прочитать файл &apos;%1&apos;</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>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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>
-    <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>
-    </message>
-    <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&apos;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,50 +129,41 @@
     </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>
-    </message>
-    <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Кто-то на этом сервере
-уже использует
-ваш псевдоним %1.
-Выберите другой псевдоним:</translation>
+        <translation>Псевдоним</translation>
     </message>
     <message>
         <source>No nickname supplied.</source>
+        <translation>Псевдоним не указан.</translation>
+    </message>
+    <message>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -353,20 +291,6 @@
         <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 +307,34 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Псевдоним</translation>
-    </message>
-    <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Кто-то на этом сервере
-уже использует
-ваш псевдоним %1.
-Выберите другой псевдоним:</translation>
-    </message>
-    <message>
         <source>User quit</source>
-        <translation type="unfinished"></translation>
+        <translation>Пользователь вышел</translation>
+    </message>
+    <message>
+        <source>Remote host has closed connection</source>
+        <translation>Удалённый хост закрыл соединение</translation>
+    </message>
+    <message>
+        <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>Upload video</source>
+        <translation>Залить видео</translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation>Залить</translation>
     </message>
 </context>
 <context>
@@ -419,16 +345,28 @@
     </message>
 </context>
 <context>
+    <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>%1 fps, </source>
+        <translation>%1 кадров/сек,</translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation>Аудио: </translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Сообщение сервера:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Установить сообщение</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Очистить кэш учётных записей</translation>
     </message>
@@ -463,10 +401,6 @@
         <source>Connecting...</source>
         <translation>Соединение...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Отмена</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -491,20 +425,20 @@
         <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 +455,6 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Приз за лучший выстрел получает &lt;b&gt;%1&lt;/b&gt; с &lt;b&gt;%2&lt;/b&gt; пунктами урона.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Лучший киллер ‒ это &lt;b&gt;%1&lt;/b&gt; с &lt;b&gt;%2&lt;/b&gt; убитым за ход.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Лучший киллер ‒ это &lt;b&gt;%1&lt;/b&gt; с &lt;b&gt;%2&lt;/b&gt; убитыми за ход.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Лучший киллер ‒ это &lt;b&gt;%1&lt;/b&gt; с &lt;b&gt;%2&lt;/b&gt; убитыми за ход.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Всего &lt;b&gt;%1&lt;/b&gt; ёж был убит за этот поединок.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Всего &lt;b&gt;%1&lt;/b&gt; ежа были убиты за этот поединок.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Всего &lt;b&gt;%1&lt;/b&gt; ежей были убиты за этот поединок.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Подробности</translation>
     </message>
@@ -609,20 +523,19 @@
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
-        <translation type="unfinished"></translation>
+        <translation>В игре...</translation>
+    </message>
+</context>
+<context>
+    <name>PageInfo</name>
+    <message>
+        <source>Open the snapshot folder</source>
+        <translation>Открыть папку скриншотов</translation>
     </message>
 </context>
 <context>
     <name>PageMain</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>
-    </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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Выберите тот же цвет команда, что у друга, чтобы играть в союзе. Вы будете управлять своими ежами, но выиграете или проиграете вместе.</translation>
@@ -871,6 +784,46 @@
         <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 +833,18 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -919,6 +857,14 @@
         <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 +881,6 @@
         <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&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Невозможно редактировать команды со страницы выбора команд. Вернитесь в главное меню для добавления, редактирования или удаления команд.</translation>
     </message>
@@ -974,18 +908,54 @@
         <source>Delete weapon set</source>
         <translation>Удалить набор оружия</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation>Основные настройки</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation>Дополнительно</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation>Сбросить на цвета по умолчанию</translation>
+    </message>
+    <message>
+        <source>Proxy host</source>
+        <translation>Адрес прокси-сервера</translation>
+    </message>
+    <message>
+        <source>Proxy port</source>
+        <translation>Порт</translation>
+    </message>
+    <message>
+        <source>Proxy login</source>
+        <translation>Имя пользователя</translation>
+    </message>
+    <message>
+        <source>Proxy password</source>
+        <translation>Пароль</translation>
+    </message>
+    <message>
+        <source>No proxy</source>
+        <translation>Без прокси</translation>
+    </message>
+    <message>
+        <source>Socks5 proxy</source>
+        <translation>Socks5 прокси</translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation>HTTP прокси</translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation>Системные настройки</translation>
+    </message>
 </context>
 <context>
     <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Переименование</translation>
     </message>
@@ -993,18 +963,6 @@
         <source>Enter new file name:</source>
         <translation>Введите новое имя файла:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Не могу переименовать в</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Не могу удалить файл</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Выберите запись из списка</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -1017,18 +975,6 @@
         <translation>Присоединиться</translation>
     </message>
     <message>
-        <source>Refresh</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>
     </message>
@@ -1037,70 +983,6 @@
         <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&apos;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>
-            <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>
@@ -1116,16 +998,6 @@
         <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>
@@ -1138,10 +1010,6 @@
 <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 +1050,6 @@
         <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 +1127,7 @@
     </message>
     <message>
         <source>Add an indestructible border along the bottom</source>
-        <translation type="unfinished"></translation>
+        <translation>Добавить неразрушимую границу внизу карты</translation>
     </message>
 </context>
 <context>
@@ -1288,47 +1152,106 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Быстрый старт (быстрый запуск игры против компьютера на случайной карте)</translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Схватка (игра с друзьями за одним компьютером или против ботов)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Тренировка (тренируйте своё мастерство в тренировочных миссиях) В РАЗРАБОТКЕ</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Демки (просмотр записанных демок)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Загрузить (загрузить сохранённую игру)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим прохождения кампании. В РАЗРАБОТКЕ</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation type="unfinished"></translation>
+        <source>Simple Game</source>
+        <translation>Простая игра</translation>
+    </message>
+    <message>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation>Играть против компьютера</translation>
+    </message>
+    <message>
+        <source>Multiplayer</source>
+        <translation>Схватка</translation>
+    </message>
+    <message>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation>Играть с друзьями за одним компьютером или против ботов</translation>
+    </message>
+    <message>
+        <source>Campaign Mode</source>
+        <translation>Кампания</translation>
+    </message>
+    <message>
+        <source>Training Mode</source>
+        <translation>Тренировка</translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation>Тренировка мастерства в тренировочных миссиях</translation>
+    </message>
+    <message>
+        <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 +1340,6 @@
         <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 +1355,26 @@
         <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 +1419,6 @@
         <translation>В игре</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">По умолчанию</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>рисованная карта...</translation>
     </message>
@@ -1583,10 +1518,6 @@
         <translation>Сетевая игра</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Оружие</translation>
-    </message>
-    <message>
         <source>Game Modifiers</source>
         <translation>Модификаторы игры</translation>
     </message>
@@ -1606,6 +1537,30 @@
         <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 +1573,6 @@
         <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 +1685,6 @@
         <translation>Язык</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Перезапустите игру для применения</translation>
-    </message>
-    <message>
-        <source>This SVN build is &apos;work in progress&apos; 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 &apos;work in progress&apos; 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 +1717,6 @@
         <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 +1725,6 @@
         <translation>Стереоизображение</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Настройки игры</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Стиль</translation>
     </message>
@@ -1804,10 +1733,6 @@
         <translation>Схема</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% времени ухода</translation>
     </message>
@@ -1815,6 +1740,70 @@
         <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 yot 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 type="unfinished"></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>
 <context>
     <name>QLineEdit</name>
@@ -1824,7 +1813,11 @@
     </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 +1834,228 @@
         <translation>Ошибка</translation>
     </message>
     <message>
-        <source>Failed to open data directory:
-%1
-Please check your installation</source>
-        <translation>Не могу найти папку с данными:
-%1
-Проверьте правильность установки</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>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Невозможно удалить набор оружия по умолчанию</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Удалить выбранный набор оружия?</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Невозможно редактировать набор оружия по умолчанию</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Не могу переписать встроенный набор оружия &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Проведено сопоставление расширений файлов.</translation>
-    </message>
-    <message>
         <source>File association failed.</source>
         <translation>Сопоставление не удалось.</translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Команды</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Удалить выбранную команду?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Схемы</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Не могу удалить встроенную схему &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Удалить выбранную схему игры?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Не могу удлить встроенный набор оружия &apos;%1&apos;!</translation>
+        <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Не могу создать папку %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Псевдоним</translation>
     </message>
@@ -2006,9 +2138,37 @@
         <source>more</source>
         <translation>ещё</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></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 +2197,18 @@
         <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 +2238,6 @@
     </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 +2280,6 @@
         <translation>Неуязвимость</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Добавить мины</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Случайный порядок</translation>
     </message>
@@ -2184,7 +2337,7 @@
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation type="unfinished"></translation>
+        <translation>Добавить нижнюю границу</translation>
     </message>
 </context>
 <context>
@@ -2351,6 +2504,14 @@
         <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 +2598,10 @@
         <source>Toggle labels above hedgehogs:</source>
         <translation>Переключение меток над ежами:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation>Запись видео:</translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
--- a/share/hedgewars/Data/Locale/hedgewars_sk.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_sk.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>Nepodarilo sa otvoriť súbor &apos;%1&apos; pre zápis</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Nepodarilo sa prečítať súbor &apos;%1&apos;</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>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    <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>
-    </message>
-    <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&apos;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 @@
     </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>
-    </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>
+        <translation>Prezývka</translation>
     </message>
     <message>
         <source>No nickname supplied.</source>
+        <translation>Nebola zadaná žiadna prezývka.</translation>
+    </message>
+    <message>
+        <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 @@
         <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 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Prezývka</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>
-    </message>
-    <message>
         <source>User quit</source>
+        <translation>Užívateľ odišiel</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">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,16 +347,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Správa serveru:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Nastaviť správu</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Vymazať vyrovnávaciu pamäť účtov</translation>
     </message>
@@ -467,10 +403,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Ocenenie za najlepší zásah vyhral(a) &lt;b&gt;%1&lt;/b&gt; so ziskom &lt;b&gt;%2&lt;/b&gt; bodov.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Najlepším zabijákom je &lt;b&gt;%1&lt;/b&gt; s &lt;b&gt;jedným&lt;/b&gt; zabitím počas ťahu.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Najlepším zabijákom je &lt;b&gt;%1&lt;/b&gt; s &lt;b&gt;%2&lt;/b&gt; zabitiami počas ťahu.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Najlepším zabijákom je &lt;b&gt;%1&lt;/b&gt; s &lt;b&gt;%2&lt;/b&gt; zabitiami počas ťahu.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Celkovo bol v tomto kole zabitý &lt;b&gt;jeden&lt;/b&gt; ježko.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Celkovo boli v tomto kole zabití &lt;b&gt;%1&lt;/b&gt; ježkovia.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Celkovo boli v tomto kole zabití &lt;b&gt;%1&lt;/b&gt; ježkovia.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Podrobnosti</translation>
     </message>
@@ -584,10 +496,6 @@
             <numerusform>(%1 zabití)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 zabití)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation>
@@ -617,20 +525,19 @@
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
+        <translation>Prebieha hra...</translation>
+    </message>
+</context>
+<context>
+    <name>PageInfo</name>
+    <message>
+        <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>Miestna hra (Hrať hru proti počítaču)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Sieťová hra (Hrať hru proti súperom na sieti)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Ak chcete hrať s priateľom ako tím, jednoducho si zvoľte tú istú farbu. I naďalej budete ovládať svojich vlastných ježkov, ale víťazstvá či prehry budú spoločné.</translation>
@@ -646,11 +553,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 @@
         <translation>Špeciálne herné režimy ako &apos;Vampírizmus&apos; alebo &apos;Karma&apos; 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&apos;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 @@
     <message>
         <source>The Piano Strike is the most damaging air strike. You&apos;ll lose the hedgehog performing it, so there&apos;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&apos;s turn radius depends on it&apos;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 @@
         <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&apos;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&apos;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 @@
         <translation>Konfiguračné súbory Hedgewars nájdete v &quot;Moje Dokumenty\Hedgewars&quot;. 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 &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Konfiguračné súbory Hedgewars nájdete v &quot;Hedgewars&quot; 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&apos;t touch the ground you&apos;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 @@
         <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&apos;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 @@
     </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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Stiahnuteľný obsah</translation>
     </message>
 </context>
 <context>
@@ -962,6 +859,14 @@
         <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 @@
         <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&apos;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,18 +910,54 @@
         <source>Delete weapon set</source>
         <translation>Vymazať sadu zbraní</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Všeobecné</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Pokročilé</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Dialóg na zmenu mena</translation>
     </message>
@@ -1036,18 +965,6 @@
         <source>Enter new file name:</source>
         <translation>Zadajte nový názov súboru:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Nemôžem premenovať na</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Nemôžem vymazať súbor</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Prosím vyberte záznam zo zoznamu</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -1060,18 +977,6 @@
         <translation>Pripojiť sa</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Obnoviť</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>
@@ -1080,70 +985,6 @@
         <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&apos;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>
-    </message>
-    <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>
-    </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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Prosím zadajte názov miestnosti</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Prosím vyberte miestnosť zo zoznamu</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Náhodné bludisko</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Stav:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Pravidlá:</translation>
     </message>
@@ -1159,16 +1000,6 @@
         <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 @@
 <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 @@
         <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 @@
     </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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demá (prehrávanie natočených demonahrávok)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Načítať (načíta v minulosti uloženú hru)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Režim kampane (...) VO VÝVOJI</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Načítať</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1367,10 +1202,57 @@
     <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 &apos;work in progress&apos; 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 &apos;stále-vo-vývoji&apos; 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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
     </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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Zbrane</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Nie je možné upraviť východziu sadu zbraní</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Nie je možné vymazať východziu sadu zbraní</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Určite chcete vymazať túto sadu zbraní?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Nie je možné prepísať východziu sadu zbraní &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Všetky súborové asociácie boli nastavené.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Nastavenie súborových asociácii zlyhalo.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Tímy</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Naozaj vymazať tento tím?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Schémy</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Nie je možné vymazať východziu schému &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Naozaj chcete vymazať túto hernú schému?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Nie je možné vymazať východziu sadu zbraní &apos;%1&apos;!</translation>
+
+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 type="unfinished">Nie je možné spustiť server: %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 type="unfinished">Prosím zadajte názov miestnosti</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">Prosím vyberte záznam zo zoznamu</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Prosím vyberte miestnosť zo zoznamu</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">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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nepodarilo sa vytvoriť adresár %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Prezývka</translation>
     </message>
@@ -2083,43 +2136,79 @@
         <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 @@
     </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 @@
         <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 @@
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation type="unfinished"></translation>
+        <translation>Pridať spodný okraj</translation>
     </message>
 </context>
 <context>
@@ -2435,6 +2505,14 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_sv.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_sv.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>Kan inte skriva till &apos;%1&apos;</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Kan inte läsa &apos;%1&apos;</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,24 +53,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 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>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 har lagts till i din kompislista</translation>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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 @@
         <translation type="unfinished">Smeknamn</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
-    </message>
-    <message>
-        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -348,20 +290,6 @@
         <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,33 +306,35 @@
         <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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Smeknamn</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>
-    </message>
-    <message>
         <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">Lösenord</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>
@@ -414,16 +344,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Servermeddelande</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Ställ in meddelande</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Töm användarcache</translation>
     </message>
@@ -458,10 +400,6 @@
         <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 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Priset för bästa skott går till &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; poäng.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Den bästa mördaren är &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; dödad på samma tur.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Den bästa mördaren är &lt;b&gt;%1&lt;/b&gt; med &lt;b&gt;%2&lt;/b&gt; dödade på samma tur.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Totalt &lt;b&gt;%1&lt;/b&gt; igelkott dödades denna omgång.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Totalt &lt;b&gt;%1&lt;/b&gt; igelkottar dödades denna omgång.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detaljer</translation>
     </message>
@@ -570,10 +490,6 @@
             <numerusform>(%1 döda)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 döda)</translation>
-    </message>
     <message numerus="yes">
         <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
         <translation>
@@ -604,16 +520,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Lokalt spel (Spela en omgång på en enskild dator)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Nätverkspel (Spela en omgång över ett nätverk)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Välj bara samma färg som en vän för att spela i som ett lag. Varje spelare kontrollerar fortfarande själva sina igelkottar men de vinner eller förlorar tillsammans.</translation>
@@ -629,11 +544,6 @@
         <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&apos;t touch the ground you&apos;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&apos;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 @@
         <translation>Speciella spellägen som &apos;Vampyrism&apos; eller &apos;Karma&apos; 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&apos;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 @@
         <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&apos;s turn radius depends on it&apos;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 @@
         <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&apos;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 @@
         <translation>Du kan hitta dina konfigurationsfiler under &quot;Mina Dokument\Hedgewars&quot;. 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 &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Du kan hitta dina konfigurationsfiler under &quot;Hedgewars&quot; 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&apos;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 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Nedladdningsbart innehåll</translation>
     </message>
 </context>
 <context>
@@ -935,6 +850,14 @@
         <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 @@
         <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&apos;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,18 +901,54 @@
         <source>Delete weapon set</source>
         <translation>Ta bort vapenset</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Allmänt</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Avancerat</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Namnbytesdialig</translation>
     </message>
@@ -1009,18 +956,6 @@
         <source>Enter new file name:</source>
         <translation>Skriv in nytt filnamn:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Kan inte byta namn till</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Kan inte ta bort fil</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Välj inspelning från listan</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -1033,18 +968,6 @@
         <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 @@
         <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&apos;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 @@
         <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 @@
         <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 @@
         <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 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (se inspelade demos)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Ladda (ladda ett tidigare sparat spel)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampanjläge (...). UNDER UTVECKLING</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Läs in</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1343,6 +1198,52 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 &apos;work in progress&apos; 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 &apos;under utveckling&apos; 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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Vapen</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Kan inte redigera ursprungliga vapenscheman</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Kan inte ta bort ursprungliga vapenscheman</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Vill du verkligen ta bort detta vapenschema?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Kan inte skriva över standardvapenschema &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Alla filassociationer har satts.</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Filassociationer har misslyckats.</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Lag</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Vill du verkligen ta bort detta lag?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Scheman</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Kan inte ta bort standardschema &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Vill du verkligen ta bort detta spelschema?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Kan inte ta bort standardvapenset &apos;%1&apos;!</translation>
+
+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 type="unfinished">Kunde inte starta servern: %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 type="unfinished">Skriv in rummets namn</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">Välj inspelning från listan</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Välj ett rum från listan</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">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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Kan inte skapa katalog %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Smeknamn</translation>
     </message>
@@ -2048,43 +2123,79 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="tr_TR">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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 yot 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,16 +153,14 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -325,10 +286,6 @@
         <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 @@
         <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,16 +340,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Sunucu iletisi:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">İletiyi ayarla</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation type="unfinished"></translation>
     </message>
@@ -401,10 +396,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;En iyi atış ödülünü &lt;b&gt;%2&lt;/b&gt; puanla &lt;b&gt;%1&lt;/b&gt; kazandı.&lt;/p&gt;</translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -519,16 +510,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>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>
-    </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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -777,6 +767,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">Tamam</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -825,6 +840,14 @@
         <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,18 +891,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Genel</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Gelişmiş</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>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>
@@ -887,18 +946,6 @@
         <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>
@@ -911,18 +958,6 @@
         <translation>Katıl</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Tazele</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Tamam</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Yönetici görevleri</translation>
     </message>
@@ -931,60 +966,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;ll have to wait for the game to end to start playing.</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>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</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>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Lütfen oda ismini girin</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Lütfen listeden bir oda seçin</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1000,15 +981,6 @@
         <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 @@
         <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 @@
         <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&apos;ini sağlık olarak kazan</translation>
     </message>
@@ -1169,31 +1133,47 @@
 <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>
-    </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>
-    </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>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Kayıtlı Oyunlar (Kaydedilmiş oyunları izleyin)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Yükle (Kaydedilmiş bir oyunu yükleyin)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <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</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>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>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>
@@ -1207,6 +1187,51 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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ı&apos;yla dağıtılmaktadır</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Geliştiriciler:</translation>
     </message>
@@ -1531,10 +1588,6 @@
         <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 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
 <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 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Silahlar</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Öntanımlı silah seti düzenlenemez</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Öntanımlı silah seti silinemez</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Bu silah seti silinsin mi?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</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">Takımlar</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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished">Sunucu başlatılamadı: %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 type="unfinished">Lütfen oda ismini girin</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">Lütfen listeden kaydı seçin</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>
+    <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>%1 dizini oluşturulamadı</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Tamam</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1865,9 +2112,37 @@
         <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 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_uk.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_uk.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -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 &apos;%1&apos; for writing</source>
-        <translation>Не можу відкрити файл &apos;%1&apos; для запису</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation>Не можу прочитати файл &apos;%1&apos;</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,24 +54,15 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do yot really want to quit?</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 був видалений з вашого списку ігнорування</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>
-    </message>
-    <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
@@ -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 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone already uses your nickname %1 on the server.
 Please pick another nickname:</source>
-        <translation type="unfinished">Хтось вже використовує
- нікнейм %1
-на сервері.
-Виберіть інший нікнейм:</translation>
-    </message>
-    <message>
-        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -349,20 +291,6 @@
         <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">Ваше ім&apos;я %1 вже
-зареєстроване на Hedgewars.org
-Будь-ласка введіть ваш пароль
-або змініть ім&apos;я:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 увійшов до кімнати</translation>
     </message>
@@ -379,33 +307,35 @@
         <translation>%1 *** %2 від&apos;єднаний</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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Нікнейм</translation>
-    </message>
-    <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Хтось вже використовує
- нікнейм %1
-на сервері.
-Виберіть інший нікнейм:</translation>
-    </message>
-    <message>
         <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>
@@ -415,16 +345,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">Повідомлення сервера:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">Встановити повідомлення</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>Очистити Кеш Профілів</translation>
     </message>
@@ -459,10 +401,6 @@
         <source>Connecting...</source>
         <translation>Під&apos;єднання...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Скасувати</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -487,10 +425,6 @@
         <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 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;Нагороду за кращий постріл отримує &lt;b&gt;%1&lt;/b&gt; з &lt;b&gt;%2&lt;/b&gt; пунктами нанесених втрат.&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;Кращим вбивцею є &lt;b&gt;%1&lt;/b&gt; з &lt;b&gt;%2&lt;/b&gt; вбивством за хід.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Кращим вбивцею є &lt;b&gt;%1&lt;/b&gt; з &lt;b&gt;%2&lt;/b&gt; вбивствами за хід.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;Кращим вбивцею є &lt;b&gt;%1&lt;/b&gt; з &lt;b&gt;%2&lt;/b&gt; вбивствами за хід.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;&lt;b&gt;%1&lt;/b&gt; їжак був вбитий протягом раунду.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;&lt;b&gt;%1&lt;/b&gt; їжаки були вбиті протягом раунду.&lt;/p&gt;</numerusform>
-            <numerusform>&lt;p&gt;&lt;b&gt;%1&lt;/b&gt; їжаків було вбито протягом раунду.&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Деталі</translation>
     </message>
@@ -609,16 +527,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>Локальна Гра (Грати на одному комп&apos;ютері)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Мережна Гра (Грати по мережі)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation>Виберіть той же колір що і в друга щоб грати в одній команді. Кожен з вас буде керувати власними їжаками але вони виграють чи програють разом.</translation>
@@ -867,6 +784,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Так</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -915,6 +857,14 @@
         <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 @@
         <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&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Не можна редагувати команду з меню вибору. Перейдіть в головне меню щоб додати, редагувати чи видалити команду.</translation>
     </message>
@@ -970,18 +908,54 @@
         <source>Delete weapon set</source>
         <translation>Видалити набір зброї</translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">Основні</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">Розширені</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Так</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>Перейменування</translation>
     </message>
@@ -989,18 +963,6 @@
         <source>Enter new file name:</source>
         <translation>Введіть нове ім&apos;я файлу:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Не можу перейменувати на</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Не можу видалити файл</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Выберіть запис зі списку</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -1013,18 +975,6 @@
         <translation>Приєднатися</translation>
     </message>
     <message>
-        <source>Refresh</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>
     </message>
@@ -1033,70 +983,6 @@
         <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&apos;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>
-            <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>
@@ -1112,16 +998,6 @@
         <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>Гра, до якої ви хочети при&apos;єднатись вже почалась.
-Ви все ще хочете ввійти в кімнату?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1146,10 +1022,6 @@
         <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 @@
         <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% здоров&apos;я, яке втратив противник</translation>
     </message>
@@ -1284,35 +1152,47 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Проста Гра (швидка гра проти комп&apos;ютера, налаштування вибираються за вас)</translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Мультиплеєр (гра проти ваших друзів, або проти AI команд)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим Навчання (практика в цілому ряді навчальних місій). В РОЗРОБЦІ</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Демки (дивитись записані демо-відео)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Завантаження (Завантажити попередньо збережені ігри)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим Кампанії (...). В РОЗРОБЦІ</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
+        <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</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>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>
+    <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">Завантажити</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1326,6 +1206,53 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <translation>Порт:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Ім&apos;я гравця</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Роздільна здатність</translation>
     </message>
@@ -1734,10 +1685,6 @@
         <translation>Мова</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Перезапустіть гру щоб застосувати</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Вибухівка</translation>
     </message>
@@ -1778,10 +1725,6 @@
         <translation>Стерео рендеринг</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Параметри гри</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Стиль</translation>
     </message>
@@ -1790,10 +1733,6 @@
         <translation>Схема</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% Час Тікати</translation>
     </message>
@@ -1801,6 +1740,68 @@
         <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 yot 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 @@
         <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 @@
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Мережа</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>З&apos;єднання з сервером втрачено</translation>
     </message>
@@ -1835,81 +1836,224 @@
         <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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation>Зброя</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Неможливо редагувати набір зброї за замовчуванням</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Неможливо видалити набір зброї за замовчуванням</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Видалити вибраний набір зброї?</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>Не можу перезаписати стандартний набір зброї &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>Всі асоціації файлів були встановлені</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>Файлове асоціювання не вдалось</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>Команди</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>Справді видалити цю команду?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>Схеми</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>Не можу видалити стандартну схему &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Справді видалити цю схему гри?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>Не можу видалити стандартний набір зброї &apos;%1&apos;!</translation>
+
+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 type="unfinished">Помилка запуску сервера: %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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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">Гра, до якої ви хочети при&apos;єднатись вже почалась.
+Ви все ще хочете ввійти в кімнату?</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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>Не можу створити директорію %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Так</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation>Ім&apos;я</translation>
     </message>
@@ -1992,36 +2136,76 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,231 +2,211 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="zh_CN">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>新建</translation>
-    </message>
-    <message>
-        <source>copy of</source>
-        <translation>备份</translation>
+    <name>AbstractPage</name>
+    <message>
+        <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>
-    <message>
-        <source>Cannot open file &apos;%1&apos; for writing</source>
-        <translation type="unfinished">无法打开文件 &apos;%1&apos; 写入</translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished">无法读取文件 &apos;%1&apos;</translation>
+    <name>AmmoSchemeModel</name>
+    <message>
+        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="673"/>
+        <source>new</source>
+        <translation type="unfinished">新</translation>
+    </message>
+    <message>
+        <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>
+        <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 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="79"/>
         <source>Edit schemes</source>
         <translation>修改游戏设置</translation>
     </message>
-    <message>
-        <source>Edit weapons</source>
-        <translation>修改武器</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>
+</context>
+<context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="33"/>
+        <source>Do yot really want to quit?</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 已经从您的忽略列表中移除</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>
-    </message>
-    <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&apos;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>
-    </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>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="463"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="465"/>
         <source>DefaultTeam</source>
-        <translation>默认队伍</translation>
-    </message>
-    <message>
-        <source>Hedgewars Demo File</source>
-        <comment>File Types</comment>
-        <translation>刺猬大作战回放文件</translation>
-    </message>
-    <message>
-        <source>Hedgewars Save File</source>
-        <comment>File Types</comment>
-        <translation>刺猬大作战存档文件</translation>
-    </message>
-    <message>
-        <source>Demo name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo name:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="569"/>
         <source>Game aborted</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">密码</translation>
-    </message>
-    <message>
+        <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">您的昵称%1
-在Hedgewars.org已注册
-请输入您的密码
-或从游戏配置中选择另一个昵称:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="985"/>
         <source>No password supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1011"/>
         <source>Nickname</source>
-        <translation type="unfinished">昵称</translation>
-    </message>
-    <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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>
+        <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 @@
 <context>
     <name>HWMapContainer</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="82"/>
         <source>Map</source>
         <translation>地图</translation>
     </message>
     <message>
+        <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="103"/>
+        <source>Small tunnels</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="105"/>
+        <source>Large tunnels</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="107"/>
+        <source>Medium floating islands</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="118"/>
         <source>Themes</source>
         <translation>主题</translation>
     </message>
     <message>
+        <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="555"/>
+        <source>Set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="85"/>
         <source>Filter</source>
         <translation>过滤</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="89"/>
         <source>All</source>
         <translation>全部</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="90"/>
         <source>Small</source>
         <translation>小型</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="91"/>
         <source>Medium</source>
         <translation>中型</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="92"/>
         <source>Large</source>
         <translation>大型</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="93"/>
         <source>Cavern</source>
         <translation>洞穴</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="94"/>
         <source>Wacky</source>
-        <translation>险峻</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>类型</translation>
-    </message>
-    <message>
-        <source>Small tunnels</source>
-        <translation>小型隧道</translation>
-    </message>
-    <message>
-        <source>Medium tunnels</source>
-        <translation>中型隧道</translation>
-    </message>
-    <message>
-        <source>Large tunnels</source>
-        <translation>大型隧道</translation>
-    </message>
-    <message>
-        <source>Small floating islands</source>
-        <translation>小型漂浮岛屿</translation>
-    </message>
-    <message>
-        <source>Medium floating islands</source>
-        <translation>中型漂浮岛屿</translation>
-    </message>
-    <message>
-        <source>Large floating islands</source>
-        <translation>大型漂浮岛屿</translation>
-    </message>
-    <message>
-        <source>Seed</source>
-        <translation>作种</translation>
-    </message>
-    <message>
-        <source>Set</source>
-        <translation>设定</translation>
+        <translation>曲折</translation>
     </message>
 </context>
 <context>
     <name>HWNetServersModel</name>
     <message>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="46"/>
         <source>Title</source>
-        <translation>名称</translation>
-    </message>
-    <message>
+        <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 @@
 <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>
-    </message>
-    <message>
+        <translation>错误没找到这个主机。请检查主机名和端口设置。</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="218"/>
         <source>Connection refused</source>
         <translation>连接被拒绝</translation>
     </message>
     <message>
+        <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="471"/>
+        <source>%1 *** %2 has joined</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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 type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1285"/>
         <source>Quit reason: </source>
         <translation>退出原因:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="648"/>
         <source>Room destroyed</source>
         <translation>房间损坏</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="447"/>
         <source>You got kicked</source>
         <translation>被踢出</translation>
     </message>
-    <message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_password.cpp" line="30"/>
         <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>
-    <message>
-        <source>%1 *** %2 has joined</source>
-        <translation>%1 *** %2 加入了</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has left (%3)</source>
-        <translation>%1 *** %2 离开了(%3)</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has left</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>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="obsolete">昵称</translation>
-    </message>
-    <message>
-        <source>User quit</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"/>
         <source>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It&apos;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>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>
-        <source>Server message:</source>
-        <translation type="obsolete">服务器信息:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">设定信息</translation>
-    </message>
-    <message>
-        <source>Clear Accounts Cache</source>
-        <translation>清空账户缓存</translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="34"/>
         <source>Fetch data</source>
-        <translation>获取数据</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="38"/>
         <source>Server message for latest version:</source>
-        <translation>最新版本的服务器信息</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="46"/>
         <source>Server message for previous versions:</source>
-        <translation>之前版本的服务器信息</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="54"/>
         <source>Latest version protocol number:</source>
-        <translation>最新版本的通讯协议号码:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="62"/>
         <source>MOTD preview:</source>
-        <translation>MOTD预览:</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="35"/>
         <source>Clear</source>
-        <translation>清除</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="36"/>
         <source>Load</source>
-        <translation>读取</translation>
-    </message>
-    <message>
+        <translation type="unfinished">读取</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="37"/>
         <source>Save</source>
-        <translation>保存</translation>
-    </message>
-    <message>
+        <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>
+        <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>保存绘制的地图</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>
+        <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;最佳射手奖给与 &lt;b&gt;%1&lt;/b&gt;:伤害 &lt;b&gt;%2&lt;/b&gt;点。&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;最佳杀手是 &lt;b&gt;%1&lt;/b&gt;单回合击杀刺猬数:&lt;b&gt;%2&lt;/b&gt;&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;本轮总共有&lt;b&gt;%1&lt;/b&gt;只刺猬被击杀&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="56"/>
         <source>Details</source>
-        <translation>细节</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="70"/>
         <source>Health graph</source>
-        <translation>健康值图形</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="87"/>
         <source>Ranking</source>
-        <translation>排名</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="173"/>
         <source>The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.</source>
-        <translation>最佳射手&lt;b&gt;%1&lt;/b&gt;为同族制造了&lt;b&gt;%2&lt;/b&gt;点创伤</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="181"/>
         <source>The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.</source>
-        <translation>
-            <numerusform>最佳杀手&lt;b&gt;%1&lt;/b&gt; 完成了单回合&lt;b&gt;%2&lt;/b&gt;次击杀</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.</source>
-        <translation>
-            <numerusform>总共&lt;b&gt;%1&lt;/b&gt;只刺猬在本轮失去生命。</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>(%1 kill)</source>
-        <translation>
-            <numerusform>(%1 击杀)</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 击杀)</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
-        <translation>
-            <numerusform>&lt;b&gt;%1&lt;/b&gt;以为给自己的刺猬造成 &lt;b&gt;%2&lt;/b&gt; 点创伤是小意思。</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;b&gt;%1&lt;/b&gt; killed &lt;b&gt;%2&lt;/b&gt; of his own hedgehogs.</source>
-        <translation>
-            <numerusform>&lt;b&gt;%1&lt;/b&gt; 整垮了 &lt;b&gt;%2&lt;/b&gt; 只自己的刺猬。</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
     <message numerus="yes">
-        <source>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; times.</source>
-        <translation>
-            <numerusform>&lt;b&gt;%1&lt;/b&gt; 受惊了,共计 &lt;b&gt;%2&lt;/b&gt; 次放弃。</numerusform>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="188"/>
+        <source>A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.</source>
+        <translation type="unfinished">
+            <numerusform></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>单机游戏(在一台电脑上)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>网络游戏(通过网络)</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&apos;ll win or lose together.</source>
-        <comment>Tips</comment>
-        <translation>点击同色作为同一组的友军。控制权不分享,但是共同胜利/失败。</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>有些武器可能威力低下但是有毁灭性的效果。比如沙漠之鹰能把多个刺猬打入水中。</translation>
-    </message>
-    <message>
-        <source>If you&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;t let too much time pass as there will be Sudden Death!</source>
-        <comment>Tips</comment>
-        <translation>加入不确定怎么做,不要浪费弹药,跳过此回合。但是注意突然时间!</translation>
-    </message>
-    <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don&apos;t touch the ground you&apos;ll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">保存绳子?在半空释放然后再次射出。只要不接触地面停止就可以继续使用同一根不会浪费!</translation>
-    </message>
-    <message>
-        <source>If you&apos;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>
-    </message>
-    <message>
-        <source>You&apos;re bored of default gameplay? Try one of the missions - they&apos;ll offer different gameplay depending on the one you picked.</source>
-        <comment>Tips</comment>
-        <translation>厌倦了默认的玩法?试试任务——</translation>
-    </message>
-    <message>
-        <source>By default the game will always record the last game played as a demo. Select &apos;Local Game&apos; and pick the &apos;Demos&apos; button on the lower right corner to play or manage them.</source>
-        <comment>Tips</comment>
-        <translation>默认情况下游戏记录最后的游戏作为Demo,选择单机游戏——然后Demo——然后点击右下角开始回放或者整理。</translation>
-    </message>
-    <message>
-        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you&apos;ve got problems, ask on our forums but please don&apos;t expect 24/7 support!</source>
-        <comment>Tips</comment>
-        <translation>刺猬大作战是一个开放源代码的免费软件,它充分利用了我们的业余时间。如果您有问题,到论坛来吧,不过7×24小时支持不可能!</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>刺猬大作战是一个开放源代码的免费软件,它充分利用了我们的业余时间。如果您喜欢它,我们接受您的捐赠/感谢!</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>刺猬大作战是一个开放源代码的免费软件,它充分利用了我们的业余时间。与他人分享它吧!</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>官方的竞赛一直存在。临近时去  http://www.hedgewars.org/  即可看到。</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 被翻译成多种语言,中文是刺猬大作战——同样为翻译名。如果您的语言翻译有什么缺失/过时/遗漏或任何问题,来联系我们吧!</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>刺猬大作战可以运行的操作系统包括:GNU/Linux、Mac OS X、MicroSoft Windows。</translation>
-    </message>
-    <message>
-        <source>Always remember you&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; option.</source>
-        <comment>Tips</comment>
-        <translation>您可以建立自己的网络游戏/局域网游戏。不仅限于 &quot;简单游戏&quot; 选项。</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">在官方服务器 http://www.hedgewars.org/ 建立自己的帐号——就能一直使用最喜欢的昵称</translation>
-    </message>
-    <message>
-        <source>While playing you should give yourself a short break at least once an hour.</source>
-        <comment>Tips</comment>
-        <translation>最好玩一个小时就休息一下,如果你要继续用电脑。</translation>
-    </message>
-    <message>
-        <source>If your graphics card isn&apos;t able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
-        <comment>Tips</comment>
-        <translation>假如你的显卡不能提供OpenGL硬件加速,试着用降低效果的方式运行</translation>
-    </message>
-    <message>
-        <source>We&apos;re open to suggestions and constructive feedback. If you don&apos;t like something or got a great idea, let us know!</source>
-        <comment>Tips</comment>
-        <translation>我们接受意见和建设性反馈。假如您有好电子或者不喜欢的东西,告诉我们!</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>特别是网络游戏,请有礼貌记住对方也和您一样是人!</translation>
-    </message>
-    <message>
-        <source>Special game modes such as &apos;Vampirism&apos; or &apos;Karma&apos; allow you to develop completely new tactics. Try them in a custom game!</source>
-        <comment>Tips</comment>
-        <translation>特别游戏模式“吸血“、”因果报应“需要全新的战术。现在自定义游戏里试试!</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版本的刺猬大作战支持Xfire。添加它到游戏列表里让您的朋友看到。</translation>
-    </message>
-    <message>
-        <source>You should never install Hedgewars on computers you don&apos;t own (school, university, work, etc.). Please ask the responsible person instead!</source>
-        <comment>Tips</comment>
-        <translation>您不应该在不属于您的计算机上安装刺猬大作战——比如学校/工作场所。</translation>
-    </message>
-    <message>
-        <source>Hedgewars can be perfect for short games during breaks. Just ensure you don&apos;t add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
-        <comment>Tips</comment>
-        <translation>刺猬大作战适合短时间休息,不需要太多刺猬挤在大地图上。</translation>
-    </message>
-    <message>
-        <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>
-    </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>三种跳跃方式。点击[高跳]两次做出跳跃高度极限的后空翻。</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>害怕掉下悬崖?按住[精确]后再点击[左][右]就会只转身,不移动位置。</translation>
-    </message>
-    <message>
-        <source>Some weapons require special strategies or just lots of training, so don&apos;t give up on a particular tool if you miss an enemy once.</source>
-        <comment>Tips</comment>
-        <translation>有些武器需要特殊策略或者仅仅是大量的练习,假如你一次失去准星,也不要放弃。</translation>
-    </message>
-    <message>
-        <source>Most weapons won&apos;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>
-    </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>老干酪发射器造成小规模爆炸,然后产生随风移动的有毒云雾——能一次毒害多个刺猬。</translation>
-    </message>
-    <message>
-        <source>The Piano Strike is the most damaging air strike. You&apos;ll lose the hedgehog performing it, so there&apos;s a huge downside as well.</source>
-        <comment>Tips</comment>
-        <translation>钢琴攻击是最大威力的空袭。弹奏钢琴的刺猬会跟着钢琴返回天堂。</translation>
-    </message>
-    <message>
-        <source>The Homing Bee can be tricky to use. It&apos;s turn radius depends on it&apos;s velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">归巢的蜜蜂有些技巧。它的回转半径和初速有关,最好不用全力发射。</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>黏着地雷是创造小范围连锁反应的绝佳武器。</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>锤是桥梁上/分界处最佳武器之一,只是刚刚好把刺猬打陷——如果没底就没办法了。</translation>
-    </message>
-    <message>
-        <source>If you&apos;re stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
-        <comment>Tips</comment>
-        <translation>假如对方刺猬把你堵住了,一锤打下去让自己轻松些。</translation>
-    </message>
-    <message>
-        <source>The Cake&apos;s maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
-        <comment>Tips</comment>
-        <translation>蛋糕的最大行走距离取决于地表。也可按下[攻击键]激活起爆。</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>火焰喷射器是一种武器,也是一种开路机器。</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">燃烧瓶可以短时阻止刺猬通过特定区域(比如通道或平台)</translation>
-    </message>
-    <message>
-        <source>Want to know who&apos;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 &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation>你可以在( 我的文档\Hedgewars)里找到设置文件。可以创建备份,但不要手动修改。</translation>
-    </message>
-    <message>
-        <source>You can find your Hedgewars configuration files under &quot;Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;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&apos;t able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
-        <comment>Tips</comment>
-        <translation>加入你的显卡不能使用OpenGL硬件加速,请升级相应驱动。</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)吗?加入 %2 ,成为 %1 粉丝,也可以在  %3 跟随我们!</translation>
-    </message>
-    <message>
-        <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you&apos;ll have to share them somewhere to use them online.</source>
-        <comment>Tips</comment>
-        <translation>欢迎你自己绘制墓碑,帽子(头饰),旗帜或者地图,主题!但是记住,如果要在网上使用,你的必须把它们分享出来。</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>非常想要一个帽子?捐赠的话就给你!</translation>
-    </message>
-    <message>
-        <source>Keep your video card drivers up to date to avoid issues playing the game.</source>
-        <comment>Tips</comment>
-        <translation>保持显卡驱动最新避免可能的麻烦。</translation>
-    </message>
-    <message>
-        <source>You&apos;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&apos;t touch the ground you&apos;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 &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation>在家目录的&quot;Library/Application Support/Hedgewars&quot;找到刺猬的配置文件。备份随你,但是不要手动编辑。</translation>
-    </message>
-    <message>
-        <source>You can find your Hedgewars configuration files under &quot;.hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation>在家目录的&quot;.hedgewars&quot;找到刺猬的配置文件。备份随你,但是不要手动编辑。</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>开始</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>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">请键入房间名</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>PageNetType</name>
-    <message>
-        <source>LAN game</source>
-        <translation>局域网游戏</translation>
-    </message>
-    <message>
-        <source>Official server</source>
-        <translation>官方服务器</translation>
-    </message>
-</context>
-<context>
-    <name>PageOptions</name>
-    <message>
-        <source>New team</source>
-        <translation>新队伍</translation>
-    </message>
-    <message>
-        <source>Edit team</source>
-        <translation>修改队伍设定</translation>
-    </message>
-    <message>
-        <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>
-    </message>
-    <message>
-        <source>You can&apos;t edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
-        <translation>您不能在队伍选择界面修改队伍。请返回主页面进行添加、修改、删除队伍等操作。</translation>
-    </message>
-    <message>
-        <source>New scheme</source>
-        <translation>新框架</translation>
-    </message>
-    <message>
-        <source>Edit scheme</source>
-        <translation>修改框架</translation>
-    </message>
-    <message>
-        <source>Delete scheme</source>
-        <translation>删除框架</translation>
-    </message>
-    <message>
-        <source>New weapon set</source>
-        <translation>新武器配置</translation>
-    </message>
-    <message>
-        <source>Edit weapon set</source>
-        <translation>修改武器配置</translation>
-    </message>
-    <message>
-        <source>Delete weapon set</source>
-        <translation>删除武器配置</translation>
-    </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
-    <message>
-        <source>Error</source>
-        <translation>错误</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>确认</translation>
-    </message>
-    <message>
-        <source>Rename dialog</source>
-        <translation>重命名对话框</translation>
-    </message>
-    <message>
-        <source>Enter new file name:</source>
-        <translation>输入新的文件名:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>不能改变名字</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>不能删除文件</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>请从列表选择记录</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
-    <message>
-        <source>Create</source>
-        <translation>建立</translation>
-    </message>
-    <message>
-        <source>Join</source>
-        <translation>加入</translation>
-    </message>
-    <message>
-        <source>Refresh</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>
-    </message>
-    <message>
-        <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&apos;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>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="252"/>
+        <source>(%1 kill)</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>有 %1 个队伍加入这个房间。</numerusform>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="263"/>
+        <source>&lt;b&gt;%1&lt;/b&gt; thought it&apos;s good to shoot his own hedgehogs with &lt;b&gt;%2&lt;/b&gt; pts.</source>
+        <translation type="unfinished">
+            <numerusform></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>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="271"/>
+        <source>&lt;b&gt;%1&lt;/b&gt; killed &lt;b&gt;%2&lt;/b&gt; of his own hedgehogs.</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="279"/>
+        <source>&lt;b&gt;%1&lt;/b&gt; was scared and skipped turn &lt;b&gt;%2&lt;/b&gt; times.</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>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation>保卫你的城堡,破坏对手的,努力吧!</translation>
-    </message>
-    <message>
-        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation>队伍开始在对手的地盘,努力!</translation>
-    </message>
-    <message>
-        <source>Land can not be destroyed!</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>
-    <message>
-        <source>Assisted aiming with laser sight</source>
-        <translation>激光瞄准辅助</translation>
-    </message>
-    <message>
-        <source>All hogs have a personal forcefield</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>
-    </message>
-    <message>
-        <source>Random</source>
-        <translation>随机</translation>
-    </message>
-    <message>
-        <source>Seconds</source>
-        <translation>秒钟</translation>
-    </message>
-    <message>
-        <source>Order of play is random instead of in room order.</source>
-        <translation>随机出场顺序</translation>
-    </message>
-    <message>
-        <source>Play with a King. If he dies, your side dies.</source>
-        <translation>国王不能死!!</translation>
-    </message>
-    <message>
-        <source>Take turns placing your hedgehogs before the start of play.</source>
-        <translation>在开局前手动放置刺猬</translation>
-    </message>
-    <message>
-        <source>Ammo is shared between all teams that share a colour.</source>
-        <translation>同色队伍共享所有弹药。</translation>
-    </message>
-    <message>
-        <source>Disable girders when generating random maps.</source>
-        <translation>禁止随机生成地图使用梁</translation>
-    </message>
-    <message>
-        <source>Disable land objects when generating random maps.</source>
-        <translation>禁止随机生成地图使用地面物体</translation>
-    </message>
-    <message>
-        <source>AI respawns on death.</source>
-        <translation>AI 死亡再生</translation>
-    </message>
-    <message>
-        <source>Attacking does not end your turn.</source>
-        <translation>攻击不会结束当前回合</translation>
-    </message>
-    <message>
-        <source>Weapons are reset to starting values each turn.</source>
-        <translation>每回合开始武器自动重置到默认设定</translation>
-    </message>
-    <message>
-        <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>
-    </message>
-    <message>
-        <source>You will not have to worry about wind anymore.</source>
-        <translation>不用担心风的影响了。</translation>
-    </message>
-    <message>
-        <source>Wind will affect almost everything.</source>
-        <translation>风无所不在。</translation>
-    </message>
-    <message>
-        <source>Copy</source>
-        <translation>备份</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>添加不可毁坏地边界</translation>
-    </message>
-    <message>
-        <source>Add an indestructible border along the bottom</source>
+    <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>
+        <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>
+        <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&apos;ll win or lose together.</source>
+        <comment>Tips</comment>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="130"/>
+        <source>If you&apos;re unsure what to do and don&apos;t want to waste ammo, skip one round. But don&apos;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="131"/>
+        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don&apos;t touch the ground you&apos;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="132"/>
+        <source>If you&apos;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="133"/>
+        <source>You&apos;re bored of default gameplay? Try one of the missions - they&apos;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="134"/>
+        <source>By default the game will always record the last game played as a demo. Select &apos;Local Game&apos; and pick the &apos;Demos&apos; 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="135"/>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you&apos;ve got problems, ask on our forums but please don&apos;t expect 24/7 support!</source>
+        <comment>Tips</comment>
+        <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 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 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 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 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="142"/>
+        <source>Always remember you&apos;re able to set up your own games in local and network/online play. You&apos;re not restricted to the &apos;Simple Game&apos; option.</source>
+        <comment>Tips</comment>
+        <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>
+        <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="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="146"/>
+        <source>If your graphics card isn&apos;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="147"/>
+        <source>If your graphics card isn&apos;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&apos;re open to suggestions and constructive feedback. If you don&apos;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="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="150"/>
+        <source>Special game modes such as &apos;Vampirism&apos; or &apos;Karma&apos; 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="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="152"/>
+        <source>You should never install Hedgewars on computers you don&apos;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="153"/>
+        <source>Hedgewars can be perfect for short games during breaks. Just ensure you don&apos;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="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="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="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="157"/>
+        <source>Some weapons require special strategies or just lots of training, so don&apos;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="158"/>
+        <source>Most weapons won&apos;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="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="160"/>
+        <source>The Piano Strike is the most damaging air strike. You&apos;ll lose the hedgehog performing it, so there&apos;s a huge downside as well.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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="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="164"/>
+        <source>If you&apos;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="165"/>
+        <source>The Cake&apos;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="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="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="168"/>
+        <source>Want to know who&apos;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="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="170"/>
+        <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you&apos;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="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="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="176"/>
+        <source>You&apos;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="178"/>
+        <source>You can find your Hedgewars configuration files under &quot;My Documents\Hedgewars&quot;. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="180"/>
+        <source>You can find your Hedgewars configuration files under &quot;Library/Application Support/Hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;t edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="182"/>
+        <source>You can find your Hedgewars configuration files under &quot;.hedgewars&quot; in your home directory. Create backups or take the files with you, but don&apos;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>PageNetGame</name>
+    <message>
+        <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/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>PageSelectWeapon</name>
-    <message>
-        <source>Default</source>
-        <translation>默认</translation>
-    </message>
-    <message>
+    <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="101"/>
+        <source>You can&apos;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="127"/>
+        <source>New scheme</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="141"/>
+        <source>Delete scheme</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="162"/>
+        <source>Edit weapon set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="169"/>
+        <source>Delete weapon set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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/pageoptions.cpp" line="454"/>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="455"/>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="456"/>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="137"/>
+        <source>Rename dialog</source>
+        <translation>重命名对话框</translation>
+    </message>
+    <message>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="79"/>
+        <source>Weapons:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="102"/>
+        <source>Create</source>
+        <translation>建立</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="103"/>
+        <source>Join</source>
+        <translation>加入</translation>
+    </message>
+    <message>
+        <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>
+        <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/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/pagescheme.cpp" line="82"/>
+        <source>Land can not be destroyed!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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/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="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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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="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="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="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="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="147"/>
+        <source>Disable girders when generating random maps.</source>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="162"/>
+        <source>Attacking does not end your turn.</source>
+        <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 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 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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="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="192"/>
+        <source>Add an indestructible border along the bottom</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="351"/>
+        <source>Seconds</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>
-    <message>
+</context>
+<context>
+    <name>PageSelectWeapon</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageselectweapon.cpp" line="46"/>
         <source>New</source>
-        <translation>新模式</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>多人游戏 (热坐对抗朋友或AI)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">训练模式 (一系列训练任务)。开发中</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demo (观看记录的Demo)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>读取 (读取之前保存的游戏)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">战役模式 ——开发中</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</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="39"/>
+        <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="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="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="67"/>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>PageTraining</name>
-    <message>
-        <source>No description available</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select a mission!</source>
+    <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="860"/>
         <source>Unignore</source>
-        <translation>取消忽略</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">降低显示效果</translation>
-    </message>
-    <message>
-        <source>Show ammo menu tooltips</source>
-        <translation>显示武器菜单提示</translation>
-    </message>
-    <message>
-        <source>Enable frontend sounds</source>
-        <translation>开启前端界面音效</translation>
-    </message>
-    <message>
-        <source>Enable frontend music</source>
-        <translation>开启前端界面音乐</translation>
-    </message>
-    <message>
-        <source>Frontend effects</source>
-        <translation>前端界面效果</translation>
+        <translation>记录名称中包含具体时间日期</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/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>
-    </message>
-    <message>
-        <source>generated maze...</source>
-        <translation>生成迷宫</translation>
-    </message>
-    <message>
-        <source>Mission</source>
-        <translation>任务</translation>
-    </message>
-    <message>
-        <source>Community</source>
-        <translation>社区</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="313"/>
+        <source>Red/Cyan</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>任意</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="113"/>
         <source>In lobby</source>
-        <translation>大厅中</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="114"/>
         <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>
-    </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>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
-        <source>Misc</source>
-        <translation>杂项</translation>
-    </message>
-    <message>
-        <source>Schemes and Weapons</source>
-        <translation>游戏框架和武器配置</translation>
+        <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>
     <message>
-        <source>Net nick</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>
+        <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="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>
-    </message>
-    <message>
+        <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>
+        <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="270"/>
+        <source>Sudden Death Health Decrease</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 type="unfinished"></translation>
+    </message>
+    <message>
+        <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="369"/>
+        <source>% Dud Mines</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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="397"/>
+        <source>% Get Away Time</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="411"/>
         <source>Scheme Name:</source>
         <translation>设置名称:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="298"/>
         <source>Crate Drops</source>
         <translation>箱子降落</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="120"/>
         <source>Game scheme</source>
         <translation>游戏设置</translation>
     </message>
     <message>
-        <source>Mines Time</source>
-        <translation>布雷时间</translation>
-    </message>
-    <message>
-        <source>Mines</source>
-        <translation>地雷</translation>
-    </message>
-    <message>
-        <source>% Dud Mines</source>
-        <translation>% 地雷故障</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 yot 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/pageeditteam.cpp" line="93"/>
         <source>Name</source>
-        <translation>名称</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="96"/>
         <source>Type</source>
-        <translation>类型</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="99"/>
         <source>Grave</source>
-        <translation>墓碑</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="102"/>
         <source>Flag</source>
-        <translation>旗帜</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="105"/>
         <source>Voice</source>
-        <translation>声音</translation>
-    </message>
-    <message>
-        <source>Locale</source>
-        <translation>Locale</translation>
-    </message>
-    <message>
-        <source>Restart game to apply</source>
-        <translation>需要重新启动游戏方可应用</translation>
-    </message>
-    <message>
-        <source>Explosives</source>
-        <translation>爆炸物</translation>
-    </message>
-    <message>
+        <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/pagemain.cpp" line="116"/>
         <source>Tip: </source>
-        <translation>提示:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="120"/>
         <source>This development build is &apos;work in progress&apos; 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>
-    </message>
-    <message>
-        <source>Quality</source>
-        <translation>图像质量</translation>
-    </message>
-    <message>
-        <source>Sudden Death Water Rise</source>
-        <translation>死亡模式水位上涨</translation>
-    </message>
-    <message>
-        <source>Sudden Death Health Decrease</source>
-        <translation>死亡模式健康降低</translation>
-    </message>
-    <message>
-        <source>% Rope Length</source>
-        <translation>% 绳长</translation>
-    </message>
-    <message>
-        <source>% Health Crates</source>
-        <translation>% 生命箱</translation>
-    </message>
-    <message>
-        <source>Health in Crates</source>
-        <translation>生命箱的值数</translation>
-    </message>
-    <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">游戏</translation>
-    </message>
-    <message>
-        <source>Stereo rendering</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
+        <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>
+    <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>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">密码</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>
+        <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 @@
 <context>
     <name>QMessageBox</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="276"/>
         <source>Error</source>
         <translation>错误</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="277"/>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <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 &apos;%1&apos;?</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 &apos;%1&apos;!</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>服务器连接丢失</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.come 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/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>打不开数据文件目录:
-%1
-请检查</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>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">不能删除默认武器设定</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>真的删除这个武器设定吗?</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">不能更改默认的武器设定</translation>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</source>
-        <translation>不能覆盖默认的武器配置 &apos;%1&apos;</translation>
-    </message>
-    <message>
-        <source>All file associations have been set.</source>
-        <translation>所有相关文件已经设定。</translation>
-    </message>
-    <message>
-        <source>Teams</source>
-        <translation>队伍</translation>
-    </message>
-    <message>
-        <source>Really delete this team?</source>
-        <translation>真的要删除队伍?</translation>
-    </message>
-    <message>
-        <source>Schemes</source>
-        <translation>游戏框架</translation>
-    </message>
-    <message>
-        <source>Can not delete default scheme &apos;%1&apos;!</source>
-        <translation>无法删除默认游戏框架 &apos;%1&apos;!</translation>
-    </message>
-    <message>
-        <source>File association failed.</source>
-        <translation>文件关联失败</translation>
-    </message>
-    <message>
-        <source>Really delete this game scheme?</source>
-        <translation>真的删除此游戏框架?</translation>
-    </message>
-    <message>
-        <source>Can not delete default weapon set &apos;%1&apos;!</source>
-        <translation>无法删除武器配置%1&apos;!</translation>
+
+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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="122"/>
+        <source>Cannot open &apos;%1&apos; 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 &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="255"/>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>错误</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>无法创建路径 %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>确认</translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1203"/>
         <source>Nickname</source>
-        <translation>昵称</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="440"/>
         <source>Associate file extensions</source>
-        <translation>相关文件扩展</translation>
-    </message>
-    <message>
+        <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>
-    <message>
+    <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="39"/>
         <source>C</source>
-        <translation>人数限制</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="40"/>
         <source>T</source>
-        <translation>时间限制</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="41"/>
         <source>Owner</source>
-        <translation>创建者</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="42"/>
         <source>Map</source>
-        <translation>地图</translation>
-    </message>
-    <message>
+        <translation type="unfinished">地图</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="43"/>
         <source>Rules</source>
-        <translation>规则</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="120"/>
         <source>Probabilities</source>
-        <translation>空中支援几率</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="121"/>
         <source>Ammo in boxes</source>
-        <translation>弹药箱</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="122"/>
         <source>Delays</source>
-        <translation>延迟回合数</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="116"/>
         <source>Karma</source>
-        <translation>因果报应</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="121"/>
         <source>Artillery</source>
-        <translation>射术</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="126"/>
         <source>Random Order</source>
-        <translation>随机顺序</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="131"/>
         <source>King</source>
-        <translation>国王模式</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="136"/>
         <source>Place Hedgehogs</source>
-        <translation>手动放置刺猬</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="141"/>
         <source>Clan Shares Ammo</source>
-        <translation>团队共享弹药</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="146"/>
         <source>Disable Girders</source>
-        <translation>禁止梁</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="151"/>
         <source>Disable Land Objects</source>
-        <translation>禁止地面物件</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="156"/>
         <source>AI Survival Mode</source>
-        <translation>AI生存模式</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="161"/>
         <source>Unlimited Attacks</source>
-        <translation>无限攻击</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="166"/>
         <source>Reset Weapons</source>
-        <translation>重置武器</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="176"/>
         <source>Disable Wind</source>
-        <translation>禁止风力作用</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="181"/>
         <source>More Wind</source>
-        <translation>让风来地更猛烈吧!</translation>
-    </message>
-    <message>
+        <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 @@
 <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="33"/>
         <source>Weapon controls</source>
-        <translation>武器控制</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="49"/>
         <source>Camera and cursor controls</source>
-        <translation>镜头和光标控制</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="28"/>
         <source>Traverse gaps and obstacles by jumping:</source>
-        <translation>使用跳跃越过沟渠、障碍:</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="32"/>
         <source>Switch your currently active hog (if possible):</source>
-        <translation>切换到您当前活动的刺猬(如果可用):</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="33"/>
         <source>Pick a weapon or utility item:</source>
-        <translation>选择一个武器或物品:</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="49"/>
         <source>Move the camera to the active hog:</source>
-        <translation>移动镜头到选中的刺猬:</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="55"/>
         <source>Modify the camera&apos;s zoom level:</source>
-        <translation>调整镜头放大倍数:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="58"/>
         <source>Talk to your team or all participants:</source>
-        <translation>同队友或全部参与者对话:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="60"/>
         <source>Pause, continue or leave your game:</source>
-        <translation>暂停、继续或离开游戏:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="63"/>
         <source>Modify the game&apos;s volume while playing:</source>
-        <translation>调整游戏时音量:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="66"/>
         <source>Toggle fullscreen mode:</source>
-        <translation>全屏模式:</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
         <source>Take a screenshot:</source>
-        <translation>截图:</translation>
-    </message>
-    <message>
+        <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>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="22"/>
         <source>Mouse: Middle button</source>
-        <translation>鼠标:中键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="23"/>
         <source>Mouse: Right button</source>
-        <translation>鼠标:右键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="24"/>
         <source>Mouse: Wheel up</source>
-        <translation>鼠标滚轮:向上</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="25"/>
         <source>Mouse: Wheel down</source>
-        <translation>鼠标滚轮:向下</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="26"/>
         <source>Backspace</source>
-        <translation>退格键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="27"/>
         <source>Tab</source>
-        <translation>Tab</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="28"/>
         <source>Clear</source>
-        <translation>Num Lock / Clear</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="29"/>
         <source>Return</source>
-        <translation>回车</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="30"/>
         <source>Pause</source>
-        <translation>暂停键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="31"/>
         <source>Escape</source>
-        <translation>ESC键(退出键)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="32"/>
         <source>Space</source>
-        <translation>空格键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="96"/>
         <source>Delete</source>
-        <translation>Del(删除键)</translation>
-    </message>
-    <message>
+        <translation type="unfinished">删除</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="97"/>
         <source>Numpad 0</source>
-        <translation>小键盘0</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="98"/>
         <source>Numpad 1</source>
-        <translation>小键盘1</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="99"/>
         <source>Numpad 2</source>
-        <translation>小键盘2</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="100"/>
         <source>Numpad 3</source>
-        <translation>小键盘3</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="101"/>
         <source>Numpad 4</source>
-        <translation>小键盘4</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="102"/>
         <source>Numpad 5</source>
-        <translation>小键盘5</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="103"/>
         <source>Numpad 6</source>
-        <translation>小键盘6</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="104"/>
         <source>Numpad 7</source>
-        <translation>小键盘7</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="105"/>
         <source>Numpad 8</source>
-        <translation>小键盘8</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="106"/>
         <source>Numpad 9</source>
-        <translation>小键盘9</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="107"/>
         <source>Numpad .</source>
-        <translation>小键盘.</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="108"/>
         <source>Numpad /</source>
-        <translation>小键盘/</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="109"/>
         <source>Numpad *</source>
-        <translation>小键盘*</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="110"/>
         <source>Numpad -</source>
-        <translation>小键盘-</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="111"/>
         <source>Numpad +</source>
-        <translation>小键盘+</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="112"/>
         <source>Enter</source>
-        <translation>回车键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="113"/>
         <source>Equals</source>
-        <translation>等于</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="114"/>
         <source>Up</source>
-        <translation>上</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="115"/>
         <source>Down</source>
-        <translation>下</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="116"/>
         <source>Right</source>
-        <translation>右</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="117"/>
         <source>Left</source>
-        <translation>左</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="118"/>
         <source>Insert</source>
-        <translation>插入键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="119"/>
         <source>Home</source>
-        <translation>Home键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="120"/>
         <source>End</source>
-        <translation>End键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="121"/>
         <source>Page up</source>
-        <translation>向上翻页键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="122"/>
         <source>Page down</source>
-        <translation>向下翻页键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="138"/>
         <source>Num lock</source>
-        <translation>小键盘数字锁</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="139"/>
         <source>Caps lock</source>
-        <translation>大小写切换键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="140"/>
         <source>Scroll lock</source>
-        <translation>Scroll Lock键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="141"/>
         <source>Right shift</source>
-        <translation>右Shift键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="142"/>
         <source>Left shift</source>
-        <translation>左Shift键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="143"/>
         <source>Right ctrl</source>
-        <translation>右Ctrl键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="144"/>
         <source>Left ctrl</source>
-        <translation>左Ctrl键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="145"/>
         <source>Right alt</source>
-        <translation>右Alt键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="146"/>
         <source>Left alt</source>
-        <translation>左Alt键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="147"/>
         <source>Right meta</source>
-        <translation>右meta键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="148"/>
         <source>Left meta</source>
-        <translation>左meta键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="155"/>
         <source>A button</source>
-        <translation>A 键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="156"/>
         <source>B button</source>
-        <translation>B 键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="157"/>
         <source>X button</source>
-        <translation>X 键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="158"/>
         <source>Y button</source>
-        <translation>Y 键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="159"/>
         <source>LB button</source>
-        <translation>LB 键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="160"/>
         <source>RB button</source>
-        <translation>RB 键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="161"/>
         <source>Back button</source>
-        <translation>返回键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="162"/>
         <source>Start button</source>
-        <translation>开始键</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="163"/>
         <source>Left stick</source>
-        <translation>左摇杆</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="164"/>
         <source>Right stick</source>
-        <translation>右摇杆</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="171"/>
         <source>Left stick (Right)</source>
-        <translation>右(左摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="172"/>
         <source>Left stick (Left)</source>
-        <translation>左(左摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="173"/>
         <source>Left stick (Down)</source>
-        <translation>下(左摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="174"/>
         <source>Left stick (Up)</source>
-        <translation>上(左摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="175"/>
         <source>Left trigger</source>
-        <translation>左制动</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="176"/>
         <source>Right trigger</source>
-        <translation>右制动</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="177"/>
         <source>Right stick (Down)</source>
-        <translation>下(右摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="178"/>
         <source>Right stick (Up)</source>
-        <translation>上(右摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="179"/>
         <source>Right stick (Right)</source>
-        <translation>右(右摇杆)</translation>
-    </message>
-    <message>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="180"/>
         <source>Right stick (Left)</source>
-        <translation>左(右摇杆)</translation>
-    </message>
-    <message>
+        <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>
--- a/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts	Sun Oct 28 13:28:23 2012 +0100
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="zh_TW">
 <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 &apos;%1&apos; for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file &apos;%1&apos;</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -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 yot 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,16 +153,14 @@
         <translation type="unfinished">匿稱</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Someone 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>
@@ -325,20 +286,6 @@
         <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,13 +302,35 @@
         <translation>%1***%2已經離開</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">匿稱</translation>
-    </message>
-    <message>
         <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>
@@ -371,16 +340,28 @@
     </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>Server message:</source>
-        <translation type="obsolete">伺服器資訊:</translation>
-    </message>
-    <message>
-        <source>Set message</source>
-        <translation type="obsolete">設定信息</translation>
-    </message>
-    <message>
         <source>Clear Accounts Cache</source>
         <translation>清空帳戶緩存</translation>
     </message>
@@ -415,10 +396,6 @@
         <source>Connecting...</source>
         <translation>連接中...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">取消</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -454,6 +431,10 @@
         <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 @@
 <context>
     <name>PageGameStats</name>
     <message>
-        <source>&lt;p&gt;The best shot award was won by &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; pts.&lt;/p&gt;</source>
-        <translation type="obsolete">&lt;p&gt;最佳射手是&lt;b&gt;%1&lt;/b&gt;。傷害 &lt;b&gt;%2&lt;/b&gt;點。&lt;/p&gt;</translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;The best killer is &lt;b&gt;%1&lt;/b&gt; with &lt;b&gt;%2&lt;/b&gt; kills in a turn.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;最佳殺手是&lt;b&gt;%1&lt;/b&gt;单回合擊殺刺蝟數&lt;b&gt;%2&lt;/b&gt;&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>&lt;p&gt;A total of &lt;b&gt;%1&lt;/b&gt; hedgehog(s) were killed during this round.&lt;/p&gt;</source>
-        <translation type="obsolete">
-            <numerusform>&lt;p&gt;本輪總共有&lt;b&gt;%1&lt;/b&gt;只刺蝟被擊殺&lt;/p&gt;</numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -545,16 +510,15 @@
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <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>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>網路遊戲(通過網路)</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&apos;ll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -803,6 +767,46 @@
         <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 @@
     </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>
-    </message>
-    <message>
-        <source>OK</source>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -851,6 +840,14 @@
         <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,18 +891,54 @@
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>General</source>
+        <translation type="unfinished">常規</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation type="unfinished">進階</translation>
+    </message>
+    <message>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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>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>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>確認</translation>
-    </message>
-    <message>
         <source>Rename dialog</source>
         <translation>重命名對話方塊</translation>
     </message>
@@ -913,18 +946,6 @@
         <source>Enter new file name:</source>
         <translation>輸入新的檔案名:</translation>
     </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>不能改變名字</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>不能刪除檔</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>請從清單選擇記錄</translation>
-    </message>
 </context>
 <context>
     <name>PageRoomsList</name>
@@ -937,18 +958,6 @@
         <translation>加入</translation>
     </message>
     <message>
-        <source>Refresh</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>
     </message>
@@ -957,62 +966,6 @@
         <translation type="unfinished">房間名:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished">遊戲正在等待中。
-您可以加入等待遊戲開始。</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you&apos;ll have to wait for the game to end to start playing.</source>
-        <translation type="unfinished">遊戲正在進行中。
-您可以加入觀戰但必須等遊戲結束才能參與遊戲。</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation type="unfinished">%1是房主,他可以調整設置、開始遊戲。</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation type="unfinished">隨機地圖</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 type="unfinished">遊戲設置包括一般選項例如回合時間,突然死亡或吸血模式。</translation>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation type="unfinished">武器設置包括可以選用的武器和彈藥數量。</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform>有%1個用戶端連接到這個房間。</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation type="unfinished">
-            <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 type="unfinished"></translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1028,15 +981,6 @@
         <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">
@@ -1055,10 +999,6 @@
         <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>
@@ -1091,10 +1031,6 @@
         <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 @@
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>快速遊戲 (對抗電腦,固定設置)</translation>
-    </message>
-    <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>多人遊戲 (熱坐對抗朋友或AI)</translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">訓練模式 (一系列訓練任務)。開發中</translation>
-    </message>
-    <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demo (觀看記錄的Demo)</translation>
-    </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>讀取 (讀取之前保存的遊戲)</translation>
-    </message>
-    <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <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</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>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>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 @@
         <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 @@
         <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 @@
         <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 @@
         <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 @@
         <translation>網路遊戲</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">武器</translation>
-    </message>
-    <message>
         <source>Game Modifiers</source>
         <translation>遊戲修改</translation>
     </message>
@@ -1511,18 +1516,34 @@
         <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>
     <message>
-        <source>Net nick</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>Resolution</source>
         <translation>解析度</translation>
     </message>
@@ -1643,10 +1664,6 @@
         <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 @@
         <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 @@
         <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 yot 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 @@
         <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 @@
         <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>
-    </message>
-    <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">不能刪除默認武器設定</translation>
-    </message>
-    <message>
-        <source>Really delete this weapon set?</source>
-        <translation>真的刪除這個武器設定嗎?</translation>
-    </message>
-    <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">不能更改默認的武器設定</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>Do you really want to delete the team &apos;%1&apos;?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme &apos;%1&apos;!</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.come 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>
-    </message>
-    <message>
-        <source>Can not overwrite default weapon set &apos;%1&apos;!</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">隊伍</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 &apos;%1&apos;!</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 &apos;%1&apos;!</source>
+
+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 type="unfinished">無法開始服務端: %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 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>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <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 &apos;%1&apos;?</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 &apos;%1&apos;?</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 &apos;%1&apos; for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open &apos;%1&apos; for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set &apos;%1&apos;!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set &apos;%1&apos;!</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 &apos;%1&apos;?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>Cannot create directory %1</source>
-        <translation>無法創建路徑 %1</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>確認</translation>
-    </message>
-    <message>
         <source>Nickname</source>
         <translation type="unfinished">匿稱</translation>
     </message>
@@ -1897,9 +2112,37 @@
         <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 @@
         <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 @@
     </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 @@
         <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 @@
         <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 @@
         <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>
--- a/share/hedgewars/Data/Locale/it.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/it.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -1,222 +1,922 @@
 locale = {
---      ["..."] = "",
+    ["..."] = "...",
 	[":("] = ":(",
 	["!!!"] = "!!!",
---      ["Accuracy Bonus!"] = "Bonus accuratezza",
---      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
---      ["a Hedgewars mini-game"] = "Mini gioco Hedgewars", -- Space_Invasion, The_Specialists
+--      ["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
+--      ["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",
---      ["Ammo Depleted!"] = "Munizioni scarse!",
---      ["ammo extended!"] = "",
---      ["Ammo is reset at the end of your turn."] = "",
---      ["Ammo Maniac!"] = "Maniaco delle munizioni!",
---      ["Available points remaining: "] = "Punti disponibili rimasti: ",
---      ["[Backspace]"] = "[Cancella]",
---      ["Bamboo Thicket"] = "",
---      ["Barrel Eater!"] = "",
---      ["Barrel Launcher"] = "",
-	["Bat balls at your enemies and|push them into the sea!"] = "Lancia delle palle ai tuoi nemici|e spingili in acqua!",
+--      ["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
+--      ["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
+--      ["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
+    ["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]",
+--      ["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",
+	["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: ",
+    ["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!",
---      ["Boss defeated!"] = "",
---      ["Boss Slayer!"] = "",
---      ["Build a track and race."] = "",
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
+    ["Boom!"] = "Kaboom!",
+    ["BOOM!"] = "KABOOM!",
+    ["Boss defeated!"] = "Boss sconfitto!",
+    ["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"] = "",
---      ["Change Weapon"] = "",
---      ["Clumsy"] = "",
-	["Codename: Teamwork"] = "Nome in codice: Lavoro di Squadra",
---      ["Complete the track as fast as you can!"] = "",
+    ["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",
+--      ["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.",
+	["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",
---      ["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"] = "",
+	["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
+--      ["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!",
+--      ["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!",
+    ["Drowner"] = "Affogato",
+--      ["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
+    ["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
+--      ["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 il 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 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",
---      ["Energetic Engineer"] = "",
-	["Enjoy the swim..."] = "Nuota con piacere...",
---      ["[Enter]"] = "",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+    ["Energetic Engineer"] = "Ingegnere Energetico",
+	["Enjoy the swim..."] = "Spero che tu gradisca una nuotata...",
+    ["[Enter]"] = "[Enter]",
+--      [" 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
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Giro migliore: ",
 	["Feeble Resistance"] = "Resistenza Finale",
---      ["Fire"] = "",
+--      ["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"] = "Fuoco",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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."] = "",
---      ["Flamer"] = "",
---      ["Friendly Fire!"] = "",
---      ["fuel extended!"] = "",
---      ["GAME BEGUN!!!"] = "",
---      ["Game Modifiers: "] = "",
+    ["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
+--      ["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 E' INIZIATO!!!",
+    ["Game Modifiers: "] = "Modificatori di Gioco: ",
 	["GAME OVER!"] = "GAME OVER!",
-	["Game Started!"] = "Gioco iniziato!",
+	["Game Started!"] = "Gioco Iniziato!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["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!",
---      ["Goal"] = "",
+--      ["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!"] = "",
---      ["Good to go!"] = "",
---      ["GOTCHA!"] = "",
---      ["Grab Mines/Explosives"] = "",
---      ["Hahahaha!"] = "",
---      ["Haha, now THAT would be something!"] = "",
---      ["Hapless Hogs"] = "",
---      [" Hapless Hogs left!"] = "",
---      ["Health crates extend your time."] = "",
---      ["Heavy"] = "",
+    ["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
+--      ["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!",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
+    ["Hapless Hogs left!"] = "Ricci Sfortunati rimanenti!",
+--      [" Hapless Hogs left!"] = "", -- User_Mission_-_That_Sinking_Feeling
+    ["Hapless Hogs"] = "Ricci Sfortunati",
+--      ["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
 	["Hedgewars-Basketball"] = "Hedgewars-Pallacanestro",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
---      ["Heh, it's not that bad."] = "",
---      ["Hit Combo!"] = "",
+--      ["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...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
 	["Hmmm..."] = "Mmmmm...",
-	["Hooray!"] = "Hurra!!!",
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["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
 	["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
---      ["invaders destroyed"] = "",
---      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
---      ["Jumping is disabled"] = "",
---      ["Kamikaze Expert!"] = "",
---      ["Keep it up!"] = "",
---      ["Killing spree!"] = "",
---      ["KILLS"] = "",
---      ["Last Target!"] = "",
---      ["[Left Shift]"] = "",
+--      ["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!",
+    ["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 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!!",
---      ["Lively Lifeguard"] = "",
---      ["Mine Deployer"] = "",
---      ["Mine Eater!"] = "",
---      ["|- Mines Time:"] = "|-Timer delle mine:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
+    ["Lively Lifeguard"] = "Bagnino Vivace",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
---      ["Multi-shot!"] = "",
---      ["Nameless Heroes"] = "",
---      ["New Barrels Per Turn"] = "",
---      ["NEW CLAN RECORD: "] = "",
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
+    ["Movement: [Up], [Down], [Left], [Right]"] = "Movimenti: [Su], [Giù], [Sinistra], [Destra]",
+    ["Multi-shot!"] = "Colpi multipli!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
+--      ["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"] = "",
---      ["NEW RACE RECORD: "] = "",
---      ["Newton's Hammock"] = "",
---      ["NOT ENOUGH WAYPOINTS"] = "",
-	["Not So Friendly Match"] = "Partita non molto amichevole", -- Basketball, Knockball
+    ["New Mines Per Turn"] = "Nuove Mine ad Ogni Turno",
+    ["NEW RACE RECORD: "] = "NUOVO RACE RECORD: ",
+    ["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
+--      ["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 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
 	["Pathetic Hog #%d"] = "Riccio Patetico #%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."] = "",
---      ["points"] = "", -- Control, Space_Invasion
+    ["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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",
+--      ["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",
---      ["Power Remaining"] = "",
---      ["Prepare yourself"] = "",
---      ["Press [Precise] to skip intro"] = "",
---      ["Race complexity limit reached."] = "",
---      ["RACER"] = "",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+	["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",
+--      ["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!",
---      ["Round Limit:"] = "",
---      ["Round Limit"] = "",
---      ["Rounds Complete: "] = "",
---      ["Rounds Complete"] = "",
---      ["RULES OF THE GAME [Press ESC to view]"] = "",
+--      ["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|"] = "",
---      ["Save as many hapless hogs as possible!"] = "",
---      ["SCORE"] = "",
---      ["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
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["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"] = "PUNTEGGIO",
+    ["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
+--      ["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!",
---      ["selected!"] = "",
---      ["s"] = "", -- GaudyRacer, Space_Invasion
---      ["Shield boosted! +30 power"] = "",
---      ["Shield Depleted"] = "",
---      ["Shield is fully recharged!"] = "",
---      ["Shield Master!"] = "",
---      ["Shield Miser!"] = "",
---      ["Shield OFF:"] = "",
---      ["Shield ON:"] = "",
---      ["Shield Seeker!"] = "",
-	["Shotgun Team"] = "Squadra FaP",
-	["Shotgun Training"] = "Allenamento con il Fucile a Pompa",
---      ["shots remaining."] = "",
---      ["Silly"] = "",
---      ["Sinky"] = "",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
+    ["selected!"] = "selezionato!",
+--      ["... 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 è 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 Team"] = "Squadra Shotgun",
+	["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",
-	["Sniperz"] = "Squadra FdP",
---      ["Sponge"] = "",
-	["Spooky Tree"] = "Albero stregato",
---      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
---      ["Switched to "] = "",
+	["%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
+--      ["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!"] = "", -- Space_Invasion
+	["Sniper Training"] = "Addestramento sull'utilizzo del Fucile di Precisione",
+	["Sniperz"] = "Cecchini",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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",
+    ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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"] = "", -- Control, Space_Invasion
---      ["That Sinking Feeling"] = "",
---      ["That was pointless."] = "Questo era senza scopo.",
+    ["Team Scores"] = "Punteggi della Squadra", -- 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"] = "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 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 flag will respawn next round."] = "La bandiera verrà restituita alla fine del turno.",
---      ["The Nameless One"] = "",
---      ["THE SPECIALISTS"] = "",
---      ["This one's tricky."] = "",
---      ["This rain is really something..."] = "",
---      ["TIME: "] = "",
---      ["Timed Kamikaze!"] = "",
---      ["Time Extended!"] = "",
---      ["Time Extension"] = "",
---      ["Toggle Shield"] = "",
+--      ["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 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",
+--      ["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...",
+--      ["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"] = "",
---      ["TRACK FAILED!"] = "",
+    ["TRACK COMPLETED"] = "PISTA COMPLETATA",
+    ["TRACK FAILED!"] = "PISTA FALLITA!",
+--      ["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!"] = "",
---      ["Turn Time"] = "",
---      ["Unit"] = "",
+    ["Tumbling Time Extended!"] = "Tempo di Caduta Prolungato!",
+--      ["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
+--      ["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"] = "",
---      ["Unlimited Attacks"] = "",
---      ["Unstoppable!"] = "",
---      ["User Challenge"] = "",
+    ["Unit 835"] = "Unità 835",
+--      ["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 "] = "", -- 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",
---      ["Waypoint placed."] = "",
---      ["Way-Points Remaining"] = "",
---      ["Weapons Reset"] = "",
---      ["Well done."] = "",
---      ["Will this ever end?"] = "",
---      ["WINNING TIME: "] = "",
---      ["You'd almost swear the water was rising!"] = "",
-	["You have SCORED!!"] = "Hai guadagnato un PUNTO!",
---      ["You saved"] = "",
-	["You've failed. Try again."] = "Hai fallito. Prova di nuovo!",
+    ["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",
+--      ["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 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 this ever end?"] = "Finirà mai?",
+    ["WINNING TIME: "] = "TEMPO VINCENTE: ",
+--      ["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 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
+	["'Zooka Team"] = "Squadra 'Zooka",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/it.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/it.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,12 +1,12 @@
 ; 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
@@ -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
@@ -36,23 +36,28 @@
 00:33=Danno Extra
 00:34=Invulnerabilità
 00:35=Tempo Extra
-00:36=Mirino LASER
+00:36=Mirino Laser
 00:37=Vampirismo
 00:38=Fucile di Precisione
 00:39=Disco Volante
 00:40=Bomba Molotov
 00:41=Uccellino
-00:42=Dispositivo Portatile per Portali
+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: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à
@@ -69,6 +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=Trascurabile
+01:16=Minimo
+01:17=Medio
+01:18=Massimo
+01:19=Estremo
+01:20=Rimbalzo %1
+01:21=Audio disattivato
 
 ; Event messages
 ; Hog (%1) died
@@ -77,7 +89,7 @@
 02:00=%1 ha visto la luce!
 02:00=%1 non ha capito cosa stesse succedendo!
 02:00=%1 non sapeva con chi aveva a che fare!
-02:00=%1 ha un appuntamento col Tristo Mietitore
+02:00=%1 ha un appuntamento con l'Oscuro Mietitore
 02:00=%1 puzza di cadavere!
 02:00=%1 ha un grande futuro dietro le spalle
 02:00=%1 è ormai mangime per vermi
@@ -88,16 +100,16 @@
 02:00=%1 non ha pagato il conto!
 02:00=%1 ha rifiutato l'offerta che non poteva rifiutare!
 02:00=%1 ora fa parte del panorama!
+02:00=%1 ha lanciato il suo ultimo missile
+02:00=%1 ha scagliato la sua ultima granata
+02:00=%1 ha infornato la sua ultima torta
+02:00=%1 lascia una moglie e quattro figli...
 02:00=%1 se n'è andato in un posto migliore!
 02:00=%1 saluta questo mondo!
-02:00=%1 incontra il creatore!
+02:00=%1 incontra il Creatore!
 02:00=%1 non può più aspettare!
 02:00=%1 ha finito il suo tempo!
 02:00=%1 sarà ricordato con affetto!
-02:00=%1 ha lanciato il suo ultimo missile!
-02:00=%1 ha scagliato la sua ultima granata!
-02:00=%1 ha infornato la sua ultima torta!
-02:00=%1 ha gettato la sua ultima anguria!
 02:00=%1 se n'è andato per giocare a un gioco migliore!
 02:00=%1 fallisce!
 02:00=%1 avrebbe davvero dovuto usare una cassa salute!
@@ -122,6 +134,15 @@
 02:00=I gatti hanno sette vite, %1 no!
 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 ti consiglio vivamente il Tetris
+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!
@@ -166,12 +187,20 @@
 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
-; Match starts
+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!
 02:02=Armato e pronto!
 02:02=Alle armi!
@@ -186,7 +215,6 @@
 02:02=Perdere non è un opzione
 02:02=Vittoria o morte
 02:02=Chi perde pulisce!
-02:02=Fai del tuo meglio!
 02:02=Che inizi la battaglia del millennio
 02:02=Che inizi la battaglia del secolo
 02:02=Che inizi la battaglia del decennio
@@ -194,17 +222,24 @@
 02:02=Che inizi la battaglia del mese
 02:02=Che inizi la battaglia della settimana
 02:02=Che inizi la battaglia del giorno
+02:02=Fai del tuo meglio!
+02:02=Distruggi il nemico!
 02:02=Buona fortuna
 02:02=Divertitevi!
 02:02=Combatti con onore!
 02:02=Combatti a oltranza!
 02:02=Mai arrendersi!
 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=...
+
 ; Round ends (draw; unused atm)
 02:04=...
+
 ; New health crate
 02:05=Pronto soccorso in arrivo!
 02:05=Chi ha bisogno di cure?
@@ -225,6 +260,8 @@
 02:05=Direttamente dall'ospedale!
 02:05=Correte! Casse salute in omaggio!
 02:05=Una superpozione! Ops... gioco sbagliato!
+02:05=Attenzione! Può causare effetti collaterali indesiderati.
+
 ; New ammo crate
 02:06=Altre armi!
 02:06=È qui la festa?!
@@ -232,7 +269,7 @@
 02:06=Armi! Armi! Armi!
 02:06=È ora di ravvivare la serata!
 02:06=Mi chiedo che arma ci sia là...
-02:06=Il natale arriva presto in Hedgewars
+02:06=Il Natale arriva presto in Hedgewars
 02:06=Un regalo!
 02:06=Consegna speciale!
 02:06=È stato un incubo farlo passare in dogana...
@@ -250,6 +287,7 @@
 02:06=Regali per ricci simpatici!
 02:06=Con questo non avrai più problemi!
 02:06=Nuove armi solo per te!
+
 ; New utility crate
 02:07=Attrezzi per tutti!
 02:07=Nuovi accessori per la casa!
@@ -261,6 +299,7 @@
 02:07=Oooh questa cassa è pesante
 02:07=Potrebbe servirti
 02:07=Utilissime queste utilità!
+
 ; Hog (%1) skips his turn
 02:08=%1 è così noioso...
 02:08=%1 deve riordinare le idee
@@ -295,6 +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, %1!
+02:08=Se ci fosse stato Chuck Norris dietro di te, ti avrebbe preso a calci volanti
+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!
@@ -321,7 +365,7 @@
 02:09=%1 è decisamente goffo
 02:09=%1 mostra al nemico di cosa è capace
 02:09=%1 non può aspettarsi di esser sempre bravo
-02:09=Non preoccuparti %1, nettuno è persetto
+02:09=Non preoccuparti %1, nessuno è perfetto
 02:09=%1 l'ha fatto chiaramente di proposito
 02:09=Non lo dirò a nessuno se non vuoi, %1
 02:09=Imbarazzante!
@@ -333,11 +377,23 @@
 02:09=Il colpo peggiore. Della storia.
 02:09=%1 fa la figura del peracottaio
 02:09=%1 fa la figura del cioccolataio
+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=Quello lì è fuori!
+02:10=Quello è fuori!
+02:10=Proprio un bel colpo!
+
+; Hog (%1) has to leave (team is gone)
+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 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
@@ -358,7 +414,7 @@
 03:15=Attacco Aereo
 03:16=Attacco Aereo
 03:17=Strumeno di Scavo
-03:18=Utilitàdi costruzione
+03:18=Utilità di costruzione
 03:19=Mezzo di Trasporto
 03:20=Azione di Cambio
 03:21=Arma Balistica
@@ -392,60 +448,73 @@
 03:48=E' tempo di martellate!
 03:49=Antica Arte Mistica
 03:50=Attacco Aereo
+03:51=Terreno al 100%
+03:52=NON USATO
+03:53=TARDIS Modello 40
+03:54=Kit di costruzione
+03:55=Utilità di costruzione
+03:56=Arma da congelamento di massa
+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 suo 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 suo|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 cercerà 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 un fucile con due colpi.|Grazie al suo raggio non hai bisogno di un colpo|diretto per ferire i nemici.|Attacco: Spara (più volte)
+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 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 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
+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
 04:24=Buon Compleanno! Lancia questa torta, falla camminare|fino ai tuoi nemici e lasciagli avere un party|esplosivo. La torta può passare quasi tutti i terreni|ma potrebbe detonare prima in questo modo.|Attacco: Avvia la torta o fermala per farla esplodere
-04:25=Usa questo kit di travestimento per far saltare|i nemici verso il tuo riccio (e in qualche|precipzio o buco).|Attacco: Usa il kit e cerca di sedurre un altro riccio
+04:25=Usa questo kit di travestimento per far saltare|i nemici verso il tuo riccio (e in qualche|precipizio o buco).|Attacco: Usa il kit e cerca di sedurre un altro riccio
 04:26=Lancia questa succosa anguria ai tuoi nemici.|Quando il timer finirà, si dividerà in molti altri|pezzi esplosivi.|1-5: Imposta il timer dell'anguria|Attacco: Tieni premuto per lanciare con più forza
 04:27=Lascia che il fuoco dell'inferno cada sui nemici|usando questo diabolico esplosivo. Non|avvicinarti troppo all'esplosione dato che piccoli|fuochi possono perdurare di più.|Attacco: Tieni premuto per lanciare con più forza
 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 aereo 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 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/Giu: Manovra l'aereo
+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 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:42=Questo creatore portatile di portali|può trasferire all'istante voi, i vostri nemici|o le vostre armi da un punto all'altro del|terreno.|Usatelo con accortezza e potrà riverlarsi|la vostra arma vincente!|Attacco: Lancia un portale|Tab: Cambia il colore del portale
+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=Risuscitate i vostri ricci morti in battaglia.|Ma attenzione a non risuscitare 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.|Cursore: Sceglie la zona da attaccare
+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.|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=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
@@ -469,3 +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 di uno stesso clan prendono turni in successione|Tempo Condiviso: Le squadre di uno stesso clan condividono il tempo di gioco
--- a/share/hedgewars/Data/Locale/ja.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/ja.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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=タグチーム:一族のチームは、連続ターンを取る|共有時間:一族の株のターン時間内にチーム
--- a/share/hedgewars/Data/Locale/ko.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/ko.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,158 +2,594 @@
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
 --      ["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
 --      ["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
+--      ["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!"] = "",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["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
 --      ["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...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
+--      ["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
 --      ["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 --      ["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 --      ["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|"] = "",
+--      ["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"] = "",
 --      ["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
+--      ["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 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!"] = "",
@@ -167,54 +603,317 @@
 --      ["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!"] = "", -- Space_Invasion
 --      ["Sniper Training"] = "",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
 --      ["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 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
 --      ["'Zooka Team"] = "",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/lt.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/lt.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,156 +2,592 @@
    [":("] = ":(",
    ["!!!"] = "!!!",
    ["..."] = "...",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
    ["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"] = "",
    ["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
    ["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
+--      ["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!"] = "",
+--      ["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!",
    ["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
    ["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
+--      ["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"],
+--      [" 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
+--      ["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"] = "Ugnis",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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",
+--      ["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
    ["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...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
+--      ["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
    ["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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",
+--      ["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
+--      ["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
+--      ["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
+--      ["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 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
    ["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
    ["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
+--      ["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"] = "Taðkai",
    ["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
+--      ["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 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!",
@@ -165,56 +601,319 @@
 --      ["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!"] = "", -- Space_Invasion
    ["Sniper Training"] = "Snaiperio Treniruotë",
    ["Sniperz"] = "Snaiperiai",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
    ["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 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
    ["'Zooka Team"] = "'Zukos Komanda",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/missions_da.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/share/hedgewars/Data/Locale/missions_en.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/missions_en.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,32 +1,47 @@
-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?"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/missions_fr.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/missions_it.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/missions_pl.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,35 @@
+Basic_Training_-_Bazooka.name=Podstawy korzystania z bazooki
+Basic_Training_-_Bazooka.desc="Pamiętaj o tym, że wiatr może działać na twoją korzyść!"
+
+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."
+
+Basic_Training_-_Sniper_Rifle.name=Podstawy strzelania ze snajperki
+Basic_Training_-_Sniper_Rifle.desc="Jeden strzał i kolejny jeż pójdzie do piachu."
+
+User_Mission_-_Dangerous_Ducklings.name=Kryptonim: Niebezpieczne Kaczki
+User_Mission_-_Dangerous_Ducklings.desc="Dobra Żółtodziobie! Zobaczymy czego się nauczyłeś na treningu!!!"
+
+User_Mission_-_Diver.name=Kryptonim: Nurek
+User_Mission_-_Diver.desc="To będzie kolejna "mokra robota"..."
+
+User_Mission_-_Teamwork.name=Kryptonim: Praca zespołowa
+User_Mission_-_Teamwork.desc="Miłość potrafi czasem zranić."
+
+User_Mission_-_Spooky_Tree.name=Kryptonim: Straszne drzewo
+User_Mission_-_Spooky_Tree.desc="Na tym drzewie rośnie bardzo dużo skrzynek. Mam tylko nadzieję, że ten ptak nie jest głodny"
+
+User_Mission_-_Bamboo_Thicket.name=Kryptonim: Bambusowy bór
+User_Mission_-_Bamboo_Thicket.desc="Śmierć nadchodzi z góry."
+
+User_Mission_-_That_Sinking_Feeling.name=Kryptonim: Cisza na morzu
+User_Mission_-_That_Sinking_Feeling.desc="Morze jest wzburzone, a czas szybko upływa. Wielu próbowało, ale nikomu nie udało się wszystkich uratować. Czy ty będziesz pierwszy?"
+
+User_Mission_-_Newton_and_the_Hammock.name=Kryptonim: Newton i jego hamak
+User_Mission_-_Newton_and_the_Hammock.desc="Zapamiętajcie jeżyki: Prędkość ciała nie zmienia się, chyba że działa na nie inna siła!"
--- a/share/hedgewars/Data/Locale/pl.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/pl.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,156 +2,592 @@
     [":("] = ":(",
     ["!!!"] = "!!!",
     ["..."] = "...",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
     ["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",
     ["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 przekiwników|wyrzucając przez kosz, poza mapę!",
+    ["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",
-    ["Build a track and race."] = "Zbuduj trasię i ścigaj się.",
+--      ["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.",  
     ["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
+--      ["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!"] = "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",
 --      ["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
     ["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
+--      ["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."] = "", -- 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]",
+--      [" 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
+--      ["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"] = "Ogień",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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ą umieszzcone tam gdzie zespół zakończy swą pierwszą turę.",
+    ["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
+--      ["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
+--      ["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
+--      ["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",
+--      ["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
     ["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...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
+--      ["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
     ["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",  
-    ["invaders destroyed"] = "najeźdzców zniszczonych",
+--      ["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!",
     ["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 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!",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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",
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
     ["Nameless Heroes"] = "Bezimienni Bohaterowie",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["Not all hogs are born equal."] = "", -- 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 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",
-    ["Pathetic Hog #%d"] = "Załosny Jeż #%d",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+    ["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",
-    ["Place more waypoints using [ENTER]"] = "Postaw więcej punktów orientacyjnych za pomocą [Entera]",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
     ["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"] = "Koniec",
     ["Rounds Complete: "] = "Ukończono rund: ",
-    ["Rounds Complete"] = "Koniec",
     ["RULES OF THE GAME [Press ESC to view]"] = "ZASADY GRY [Naciśnij ESC by zobaczyć]",        
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["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"] = "PUNKTY",
     ["sec"] = "sek",
+--      ["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 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",
@@ -165,56 +601,319 @@
     ["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!"] = "", -- Space_Invasion
     ["Sniper Training"] = "Trening Snajperski",
     ["Sniperz"] = "Snajperzy",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!",
+--      ["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
+--      ["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",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+    ["Unit"] = "Jednostka",
 --      ["Unlimited Attacks"] = "",
+--      ["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 your rope to get from start to finish as fast as you can!"] = "Użyj liny by jak najszybciej dotrzec od startu do mety",
+--      ["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."] = "", -- 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 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 this ever end?"] = "Co to się kiedyś skończy?",
     ["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 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
     ["'Zooka Team"] = "Bazookinierzy",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/pl.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/pl.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -12,7 +12,7 @@
 00:09=Desert Eagle
 00:10=Dynamit
 00:11=Kij bejsbolowy
-00:12=Shoryuken
+00:12=Ognista pięść
 00:13=sek
 00:14=Spadochron
 00:15=Nalot
@@ -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
@@ -185,7 +188,7 @@
 02:01=%1 podnosi poziom oceanu
 02:01=%1 nie zapisał się do marynarki.
 02:01=%1 robi za śniętą rybę...
-02:01=Przynajmmniej nie utonąłeś w muszli klozetowej, %1
+02:01=Przynajmniej nie utonąłeś w muszli klozetowej, %1
 02:01=%1 nie pobił Sonica w pływaniu
 02:01=%1 będzie grał w "Uwolnić Orkę"
 02:01=%1 szuka rybek do akwarium!
@@ -223,16 +226,16 @@
 02:02=Rozpoczynajmy walkę!
 02:02=Jedziemy z koksem!
 02:02=Rozpoczynamy tą imprezę!
-02:02=Ostani żywy jeż wygrywa!
+02:02=Ostatni żywy jeż wygrywa!
 02:02=Jazda!
 02:02=Rozkręćmy tą imprezę!
 02:02=To jest dopiero początek...
 02:02=To jest początek czegoś naprawdę wielkiego!
 02:02=Witamy w Hedgewars.
 02:02=Witaj na linii frontu!
-02:02=Zgnieć swoich przeciników!
+02:02=Zgnieć swoich przeciwników!
 02:02=Niech wygra lepszy!
-02:02=Zwycięztwo albo śmierć!
+02:02=Zwycięstwo albo śmierć!
 02:02=Zwycięzca zdobywa łup!
 02:02=Przegrana nie wchodzi w rachubę.
 02:02=Hedgewars, stworzone przez Hedgewars.org
@@ -295,7 +298,7 @@
 02:05=Najwięcej witaminy mają paczki od rodziny!
 02:05=Czy ktoś wzywał doktor Zosię?
 02:05=Oby to nie był Pavulon!
-02:05=Codziena dawka Panadolu!
+02:05=Codzienna dawka Panadolu!
 02:05=Chyba Goździkowa maczała w tym palce...
 02:05=Gdzie jest Doktor Queen?
 02:05=U mnie to jak u lekarza!
@@ -355,7 +358,7 @@
 02:07=Keczup prosto od MacGyvera!
 02:07=Zestaw Małego Majsterkowicza
 02:07=Darmowa paczka narzędzi!
-02:07=Zasobniki prosto z Ameryki!
+02:07=Zasobniki od wujka z Ameryki!
 02:07=Zapasy materiałów eksploatacyjnych!
 02:07=Dorwij przeciwnika szybciej z nowymi narzędziami
 
@@ -471,7 +474,7 @@
 02:10=Iiii Leciiii...
 02:10=Bzziuuuuu!
 02:10=Niezły rzut!
-02:10=Chyba padnie rekord Guinessa w rzucie jeżem!
+02:10=Chyba padnie rekord Guinnessa w rzucie jeżem!
 02:10=To było odlotowe!
 
 ; Hog (%1) has to leave (team is gone)
@@ -544,12 +547,12 @@
 04:00=Atakuj przeciwników zwykłym granatem.|Wybuchnie kiedy zapalnik skończy odliczanie.|1-5: Ustawia zapalnik|Atak: Przytrzymaj by rzucić z większą siłą
 04:01=Atakuj przeciwników granatem odłamkowym.|Rozpadnie się on na kilka odłamków gdy zapalnik|skończy odliczanie.|1-5: Ustawia zapalnik|Atak: Przytrzymaj by rzucić z większą siłą
 04:02=Atakuj przeciwników pociskiem balistycznym,|który jest podatny na wiatr.|Atak: Przytrzymaj by strzelić z większą siłą
-04:03=Wypuść zdenerwowaną pszczołe, która "użądli"|zaznaczony cel. By zwiększyć precyzję nie|strzelaj pełną mocą|Kursor: Wybierz cel|Atak: Przytrzymaj by strzelić z większą siłą
+04:03=Wypuść zdenerwowaną Pszczołę, która "użądli"|zaznaczony cel. By zwiększyć precyzję nie|strzelaj pełną mocą|Kursor: Wybierz cel|Atak: Przytrzymaj by strzelić z większą siłą
 04:04=Atakuj przeciwników strzelbą z dwoma strzałami.|Działa obszarowo, więc nie musisz dokładnie|celować by zranić przeciwników.|Atak: Strzel (kilka razy)
-04:05=Schowaj się pod ziemię! Użyj młota pneumatycznego|do wywiercenia dziury w podłożu i dostania się do|innych miejsc.|Attack: Zacznij/Zakończ kopać 
+04:05=Schowaj się pod ziemię! Użyj młota pneumatycznego|do wywiercenia dziury w podłożu i dostania się do|innych miejsc.|Atak: Zacznij/Zakończ kopać 
 04:06=Znudzony? Brak motywacji do ataku? Oszczędzasz broń?|No problemo! Po prostu pomiń turę, tchórzu!|Atak: Pomiń turę bez walki
 04:07=Skróć wielkie odległości używając liny. Rozpędź się|by wślizgnąć się w inne jeże lub upuścić na nich|granat albo inną broń.|Atak: Rozwiń albo odłącz linę|Długi skok: Upuść granat lub podobną broń      
-04:08=Trzymaj przeciwników na dystans przez upuszczenie|miny w wąskim przejściu lub zaraz obok ich stóp. I nie|zapomnij ucieć zanim się włączy!|Atak: Upuść minę obok siebie
+04:08=Trzymaj przeciwników na dystans przez upuszczenie|miny w wąskim przejściu lub zaraz obok ich stóp. I nie|zapomnij uciec zanim się włączy!|Atak: Upuść minę obok siebie
 04:09=Niepewny co do umiejętności w celowaniu?|Weź pistolet i powystrzelaj ich jak kaczki.|Atak: Strzel (kilka razy)
 04:10=Brutalna siła zawsze jest rozwiązaniem. Upuść ten|wybuchową laskę dynamitu obok przeciwnika i|uciekaj gdzie pieprz rośnie.|Atak: Upuść dynamit obok siebie
 04:11=Uwolnij się od przeciwników poprzez spałowanie|ich poza mapę albo do wody. A co powiesz o|strąceniu min w swoich wrogów?|Atak: Spałuj wszystko co jest przed tobą
@@ -563,26 +566,26 @@
 04:19=Teleport użyty w odpowiednim momencie, staje|się potężniejszy niż każda inna broń,|ponieważ potrafi wyzwolić jeża z tarapatów|w przeciągu sekund.|Kursor: Wybierz region
 04:20=Pozwala w tej turze zagrać innym jeżem.|Atak: Uaktywnij wybieranie jeża
 04:21=Odpal moździerz, który po uderzeniu|wypuści kilka bomb.|Atak: Strzel z całą mocą      
-04:22=Nie tylko dla Indiana Jones! Ten bicz może|być użyteczny w wielu wypadkach. Szczególnie|kiedy chcesz kogoś zrzucić z urwiska.|Atak: Zbiczuj wszystko co jest przed tobą
+04:22=Nie tylko dla Indiana Jones! Ten bicz może|być użyteczny w wielu wypadkach. Szczególnie|kiedy chcesz kogoś zrzucić z urwiska.|Atak: Ubiczuj wszystko co jest przed tobą
 04:23=Jeśli nie masz nic do stracenia, ten atak może być|całkiem użyteczny. Poświęć swojego jeża i poślij|go w odpowiednim kierunku, raniąc wszystkich po|drodze i eksplodując na końcu.|Atak: Odpal tę niszczycielską i zabójczą technikę
 04:24=Sto lat! Uruchom ciasto i pozwól mu pójść w stronę|twoich przeciwników urządzając im wybuchowe przyjęcie.|Może chodzić prawie po wszystkim, ale wtedy|wcześniej eksploduje.|Atak: Odpal ciasto albo zatrzymaj je, by wybuchło
 04:25=Użyj kostiumu by sprawić, żeby twój wróg zakochał się|w Tobie (i spadł w przepaść lub dziurę).|Atak: Użyj kostiumu i uwiedź jeża
 04:26=Rzuć tego smacznego arbuza w przeciwników. Kiedy jego|zapalnik wskaże zero, podzieli się na mniejsze kawałki.|1-5: Ustawia zapalnik arbuza|Atak: Przytrzymaj by rzucić z większą siłą
 04:27=Niech ognie piekielne ogarną twoich przeciwników!|Nie podchodź zbyt blisko po wybuchu, gdyż ogień|pali się przez dłuższy czas|Atak: Przytrzymaj by rzucić z większą siłą
 04:28=Krótko po wystrzeleniu, rakieta zacznie wiercić tunel w ziemi|i eksploduje gdy zapalnik zostanie uruchomiony lub|jeśli pojawi się po drugiej stronie terenu.|Atak: Przytrzymaj by strzelić z większą siłą   
-04:29=Tego nie powinny używać dzieci!|Pistolet na kulki wystrzeliwujetony małych|kolorowych kulek wypełnionych materiałem wybuchowym.|Atak: Strzel kulkami|Góra/Dół: Kontynuuj celowanie      
+04:29=Tego nie powinny używać dzieci!|Pistolet na kulki wystrzeliwuje tony małych|kolorowych kulek wypełnionych materiałem wybuchowym.|Atak: Strzel kulkami|Góra/Dół: Kontynuuj celowanie      
 04:30=Wezwij samolot, żeby zrzucić dużą ilość|napalmu. Dzięki dobremu celowi ten atak|może zlikwidować dużą część mapy, w tym|znajdujące się tam nieszczęsne jeże.|Lewo/Prawo: Określ kierunek ataku|Kursor: Wybierz region
 04:31=Zaatakuj odległych przeciwników, bądź zbierz|skrzynki! Nie zapomnij o zrzuceniu bomb!|Góra/Dół: Steruj samolotem|Atak: Zrzuć bombę (3x) |Długi skok: Niech walkirie wkroczą na pole bitwy!
 04:32=Niska grawitacja jest lepsza od diety! Skacz|wyżej i dalej albo pozwól przeciwnikom fruwać.|Atak: Aktywuj
 04:33=Czasami potrzebujesz dodatkowego kopa|żeby zadawać większe obrażenia.|Atak: Aktywuj
 04:34=Nie dotkniesz mnie!|Atak: Aktywuj
 04:35=Czasami bywa, że czas pędzi za szybko. Zyskaj kilka|dodatkowych sekund by dokończyć swój atak.|Atak: Aktywuj
-04:36=Czasami z celowaniem u ciebie jest kiepsko.|Zrób użytek ze zdobyczy współczesnej technologii.|Attack: Aktywuj
+04:36=Czasami z celowaniem u ciebie jest kiepsko.|Zrób użytek ze zdobyczy współczesnej technologii.|Atak: Aktywuj
 04:37=Nie bój się słońca. To potrwa tylko jedną turę,|ale pozwoli pochłonąć część obrażeń, które|zadałeś innym.|Atak: Aktywuj
 04:38=Karabin snajperski może stać się najbardziej niszczycielską|bronią w twoim arsenale. Jednakże jest bardzo nieskuteczny|na krótkie dystanse.| Im dalej od celu tym więcej HP zabierzesz.|Atak: Strzel (dwa strzały)
-04:39=Leć do innych części mapy uzywjąc spodka.|To ciężkie do opanowania narzędzie, może przenieść Ciebie|w prawie każdą pozycje na polu bitwy.|Atak: Aktywuj|Góra/Lewo/Prawo: Wyznacz lot w odpowiednim kierunku
+04:39=Leć do innych części mapy używając spodka.|To ciężkie do opanowania narzędzie, może przenieść Ciebie|w prawie każdą pozycje na polu bitwy.|Atak: Aktywuj|Góra/Lewo/Prawo: Wyznacz lot w odpowiednim kierunku
 04:40=Wznieć ogień używając koktajlu z łatwopalnym płynem.|Atak: Przytrzymaj by rzucić z większą siłą
-04:41=Natura może być na równi z technologią!|Ptaszek uniesie Ciebie ponad ziemię oraz|zrzuci jajka w przeciwników|Atak: Atywacja ptaka i zrzucanie jajek|Góra/Lewo/Prawo: Leć w wybranym kierunku
+04:41=Natura może być na równi z technologią!|Ptaszek uniesie Ciebie ponad ziemię oraz|zrzuci jajka w przeciwników|Atak: Aktywacja ptaka i zrzucanie jajek|Góra/Lewo/Prawo: Leć w wybranym kierunku
 04:42=To urządzenie umożliwia natychmiastowe|przetransportowanie Ciebie, Twoich|wrogów bądź uzbrojenia pomiędzy dwoma|miejscami na mapie|Użyj tego z głową a Twoja|misja zakończy się... WIELKIM SUKCESEM|Atak: Wystrzel portal|Zmiana (Tab): Zmień kolor portalu
 04:43=Niech twój debiut będzie WYBUCHOWY!|Zrzuć pianino z nieba, ale uważaj!|Ktoś musi na nim grać więc prawdopodobnie będziesz|musiał poświęcić swojego jeża|Kursor: Wybierz cel|F1-F9: Graj na pianinie
 04:44=To nie jest zwykły ser. To broń biologiczna!|Wybuch z pewnością nie będzie potężny, ale gdy|licznik dojdzie do zera, chmura gazu zatruje|każdego nieszczęśnika który będzie w pobliżu|1-5: Ustawia zapalnik|Atak: Przytrzymaj by rzucić z większą siłą
@@ -592,11 +595,11 @@
 04:48=Czyż walenie jeży po głowach nie|jest zabawne? Dobre uderzenie|z młotka zabierze 1/3 życia|przeciwnika i wkopie go w podłoże|Atak: Uderz
 04:49=Wskrześ swoich przyjaciół!|Jednakże uważaj byś nie pomógł swojemu wrogowi.|Atak: Przytrzymaj by powoli przywracać życie|Góra: Przyspiesz wskrzeszanie
 04:50=Wezwij szwadron śmiercionośnych wierteł|by wykurzyć kogoś z kryjówki. Po użyciu|zostanie zrzuconych 6 wiertniczych bomb|wkręcających się w podłoże|Lewo/Prawo: Określ kierunek ataku|Kursor: Wybierz miejsce zrzutu
-04:51=Obrzuć kogoś błotem! Broń ta nie zadaje dużych|obrażeń ale może gogoś zepchnąć z krawędzi!|Atak: Przytrzymaj by strzelić z większą siłą
+04:51=Obrzuć kogoś błotem! Broń ta nie zadaje dużych|obrażeń ale może Gogol zepchnąć z krawędzi!|Atak: Przytrzymaj by strzelić z większą siłą
 04:52=UNUSED
-04:53=Wybierz się na podróż w czasie i przestrzeni|zostawiając innne jeże na polu walki.|Bądź przygotowany na powrót w dowolnym momencie.|Gdy rozpocznie się|Nagła Śmierć lub większość jeży zostanie wybita.|Uwaga. Nie zadziała podczas Nagłej Śmierci,|gdy jesteś sam, lub jeśli jesteś Królem.
+04:53=Wybierz się na podróż w czasie i przestrzeni|zostawiając inne jeże na polu walki.|Bądź przygotowany na powrót w dowolnym momencie.|Gdy rozpocznie się|Nagła Śmierć lub większość jeży zostanie wybita.|Uwaga. Nie zadziała podczas Nagłej Śmierci,|gdy jesteś sam lub jeśli jesteś Królem.
 04:54=INCOMPLETE                                                                                                                                     
-04:55=Wystrzel strumień kleistej mazi.|Buduj mosty, zasypuj wrogów, ztykaj tunele.|Uważaj by nie zasypać samego siebie!
+04:55=Wystrzel strumień kleistej mazi.|Buduj mosty, zasypuj wrogów, zatykaj tunele.|Uważaj by nie zasypać samego siebie!
 
 ; Game goal strings
 05:00=Ustawienia gry
@@ -606,7 +609,7 @@
 05:04=Niezniszczalność: Jeże są (prawie) niezniszczalne
 05:05=Wampiryzm: Jeże dostają życie za zadane obrażenia
 05:06=Karma: Jeże doznają obrażeń za uszkodzenia zadane innym
-05:07=Broń Króla: Nie pozwój królowi umrzeć!|Umieść Króla: Wybierz pozycję startową dla króla
+05:07=Broń Króla: Nie pozwól królowi umrzeć!|Umieść Króla: Wybierz pozycję startową dla króla
 05:08=Umieść jeże: Umieść jeże przed rozpoczęciem gry.
 05:09=Artyleria: Jeże nie mogą się poruszać
 05:10=Niezniszczalny teren: Większość broni nie niszczy terenu.
--- a/share/hedgewars/Data/Locale/pt_BR.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/pt_BR.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,158 +2,594 @@
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
 	["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
 --      ["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
+--      ["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!"] = "",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["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
 	["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...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
+--      ["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
 	["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 --      ["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 --      ["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|"] = "",
+--      ["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"] = "",
 --      ["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
+--      ["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 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!"] = "",
@@ -167,54 +603,317 @@
 --      ["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!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Treino com o Rifle Sniper",
 	["Sniperz"] = "Franco-Atiradores",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
 --      ["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 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
 	["'Zooka Team"] = "Bazuqueiros",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/pt_PT.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/pt_PT.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,157 +2,593 @@
 	[":("] = ":(",
 	["!!!"] = "!!!",
 	["..."] = "...",
+--      ["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!"] = "Bónus de precisão!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "Desbloqueado", -- 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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
 	["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"] = "", -- 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."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
 	["Congratulations!"] = "Parabéns!",
+--      ["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
 --      ["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."] = "", -- 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
+--      ["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!"] = "",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      ["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
 	["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...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
 	["Hmmm..."] = "Hmmm...",
+--      ["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
+--      ["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
 	["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!",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 	["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 	["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|"] = "",
+--      ["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"] = "RESULTADOS",
 	["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
+--      ["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 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!",
@@ -166,56 +602,319 @@
 --      ["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!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Treino com Sniper",
 	["Sniperz"] = "Sniperz",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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: ",
---      ["Toggle Shield"] = "",
+--      ["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",
+--      ["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"] = "",
+--      ["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
+--      ["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"] = "",
+	["Unit 835"] = "Unidade 835",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+	["Unit"] = "Unidade",
 	["Unlimited Attacks"] = "Ataques Ilimitados",
---      ["Unstoppable!"] = "",
+--      ["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 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 this ever end?"] = "",
---      ["WINNING TIME: "] = "",
---      ["You'd almost swear the water was rising!"] = "",
+	["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 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
 	["'Zooka Team"] = "Bazuqueiros",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Locale/ro.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/share/hedgewars/Data/Locale/ru.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/ru.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,158 +2,594 @@
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
 --      ["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!"] = "Бум!",
-      ["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!"] = "Поздравления!",
 --      ["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
+--      ["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!"] = "Двойное убийство!",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["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
 --      ["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...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
+--      ["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
       ["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
       ["Nameless Heroes"] = "Безымянные герои",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 --      ["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 --      ["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|"] = "",
+--      ["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"] = "",
       ["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
+--      ["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 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!"] = "",
@@ -167,54 +603,317 @@
 --      ["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!"] = "", -- Space_Invasion
       ["Sniper Training"] = "Тренировка снайпера",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
 --      ["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 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
 --      ["'Zooka Team"] = "",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/sk.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/sk.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,175 +2,922 @@
         [":("] = ":(",
         ["!!!"] = "!!!",
         ["..."] = "...",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
         ["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",
 	["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
         ["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
+--      ["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!",
+--      ["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!",
+        ["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
+        ["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
+--      ["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]",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!",
+--      ["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
 	["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...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
+--      ["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
 	["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
+--      ["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 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
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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Á",
+--      ["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
+--      ["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
+--      ["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
+--      ["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 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
         ["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",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
         ["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
+--      ["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"] = "SKÓRE",
         ["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
+--      ["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 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 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!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Tréning pre ostreľovačov",
 	["Sniperz"] = "Ostreľovači",
---      ["Sponge"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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: ",
+--      ["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
+--      ["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 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 this ever end?"] = "Skončí to vôbec niekedy?",
+        ["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 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
 	["'Zooka Team"] = "Bazuka tím",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/stub.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/stub.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,158 +2,594 @@
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
 --      ["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
 --      ["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
+--      ["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!"] = "",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["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
 --      ["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...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
+--      ["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
 --      ["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 --      ["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 --      ["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|"] = "",
+--      ["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"] = "",
 --      ["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
+--      ["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 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!"] = "",
@@ -167,54 +603,317 @@
 --      ["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!"] = "", -- Space_Invasion
 --      ["Sniper Training"] = "",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
 --      ["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 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
 --      ["'Zooka Team"] = "",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/sv.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/sv.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -2,158 +2,594 @@
 --      ["..."] = "",
 	[":("] = ":(",
 	["!!!"] = "!!!",
+--      ["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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
 	["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
 	["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
+--      ["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!"] = "",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["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
 	["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...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
+--      ["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
 	["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
 	["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 --      ["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|"] = "",
+--      ["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"] = "",
     ["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
+--      ["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 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!"] = "",
@@ -167,54 +603,317 @@
 --      ["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!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Prickskyttesträning",
 	["Sniperz"] = "Prickskyttarna",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
 --      ["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 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
 	["'Zooka Team"] = "Bazookalaget",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
--- a/share/hedgewars/Data/Locale/uk.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/uk.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -1,159 +1,592 @@
 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
+--      ["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
+--      ["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
+--      ["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
         ["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"] = "Катапульта для бочок",
         ["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!"] = "БАБАХ!",
-        ["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!"] = "Вітаємо!",
         ["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
+--      ["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!"] = "Подвійне Вбивство!",
+--      ["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!"] = "Мисливець за Джмелями!",
         ["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
         ["Each turn you get 1-3 random weapons"] = "Кожного ходу ви отримуєте 1-3 випадкової зброї",
         ["Each turn you get one random weapon"] = "Кожного ходу ви отримуєте одну випадкову зброю",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "Вогонь",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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"] = "Нещасні Їжаки",
+--      ["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
         ["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...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
+--      ["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
         ["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!"] = "Так тримати!",
         ["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 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"] = "Жвавий Рятівник",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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 SUCCESSFUL"] = "МІСІЮ ВИКОНАНО", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
         ["MISSION SUCCESS"] = "УСПІХ МІСІЇ",
-        ["MISSION SUCCESSFUL"] = "МІСІЮ ВИКОНАНО", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
         ["Nameless Heroes"] = "Безіменні Герої",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
         ["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"] = "Боєприпаси на їжака",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
         ["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
+--      ["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"] = "РАХУНОК",
         ["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
+--      ["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 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!"] = "Щит повністю заряджений!",
@@ -167,54 +600,320 @@
         ["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!"] = "", -- Space_Invasion
         ["Sniper Training"] = "Снайперське тренування",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "ТРАСУ НЕ ПРОЙДЕНО!",
+--      ["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
+--      ["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 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 this ever end?"] = "Це коли-небудь закінчиться?",
         ["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 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
         ["'Zooka Team"] = "Команда 'Zooka",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+        ["!!!"] = "Я!",
     }
--- a/share/hedgewars/Data/Locale/zh_CN.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/zh_CN.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -1,162 +1,598 @@
 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
+--      ["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
+--      ["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
+--      ["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
 --      ["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"] = "",
       ["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!"] = "恭喜",
       ["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
+--      ["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!"] = "",
+--      ["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!"] = "",
 --      ["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
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["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]"] = "",
+--      [" 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
+--      ["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"] = "",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["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
+--      ["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
+--      ["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
+--      ["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!"] = "",
+--      ["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
       ["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...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
+--      ["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
       ["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!"] = "",
 --      ["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 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"] = "",
+--      ["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
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["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
+--      ["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
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["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
+--      ["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 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
       ["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"] = "",
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["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
 --      ["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|"] = "",
+--      ["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"] = "",
 --      ["sec"] =
+--      ["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 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!"] = "",
@@ -170,55 +606,318 @@
 --      ["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!"] = "", -- Space_Invasion
       ["Sniper Training"] = "狙击训练",
       ["Sniperz"] = "狙击手",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["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
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["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 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!"] = "",
+--      ["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
+--      ["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 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 this ever end?"] = "",
 --      ["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 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
       ["'Zooka Team"] = "火箭队",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
       [":("] = "囧",
     }
--- a/share/hedgewars/Data/Locale/zh_CN.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Locale/zh_CN.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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=出现紧急情况!
--- a/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -238,7 +238,7 @@
 	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 @@
 
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 
 	end
 
--- a/share/hedgewars/Data/Maps/Control/map.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/Control/map.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -400,7 +400,7 @@
 			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 @@
 	if GetGearType(gear) == gtHedgehog then
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 	end
 
 end
Binary file share/hedgewars/Data/Maps/Islands/map.png has changed
--- a/share/hedgewars/Data/Maps/Knockball/map.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/Knockball/map.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -34,7 +34,7 @@
 
 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)
--- a/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,5 +1,6 @@
 install(FILES
 	map.png
+	mask.png
 	map.cfg
 	preview.png
 	DESTINATION ${SHAREPATH}Data/Maps/Mushrooms)
Binary file share/hedgewars/Data/Maps/Mushrooms/mask.png has changed
--- a/share/hedgewars/Data/Maps/Ruler/map.cfg	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/Ruler/map.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -1,1 +1,2 @@
 Nature
+12
--- a/share/hedgewars/Data/Maps/Trash/map.cfg	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/Trash/map.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -1,1 +1,1 @@
-Nature
\ No newline at end of file
+Compost
--- a/share/hedgewars/Data/Maps/TrophyRace/map.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Maps/TrophyRace/map.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -70,19 +70,22 @@
 	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 @@
 		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
--- a/share/hedgewars/Data/Missions/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Missions/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,2 +1,2 @@
 add_subdirectory(Training)
-add_subdirectory(Campaign)
\ No newline at end of file
+add_subdirectory(Campaign)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,7 @@
+file(GLOB Config *.ini)
+file(GLOB Missions *.lua)
+
+install(FILES
+	${Config}
+	${Missions}
+	DESTINATION "${SHAREPATH}Data/Missions/Campaign/A Classic Fairytale")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/campaign.ini	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
+
--- a/share/hedgewars/Data/Missions/Campaign/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -1,3 +1,5 @@
+add_subdirectory("A Classic Fairytale")
+
 file(GLOB Scripts *.lua)
 
 install(FILES
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -111,11 +111,11 @@
 -- 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 @@
 			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 @@
 -- 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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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 = 1652 end
+	if scored == 1 then x = 1915 end
+	if scored == 2 then x = 2333 end
+	if scored == 3 then x = 2152 end
+	if scored == 4 then x = 1434 end
+	if scored == 5 then x = 2588 end
+	if scored == 6 then x = 2372 end
+	if scored == 7 then x = 1193 end
+	if scored == 8 then x = 2744 end
+	if scored == 9 then x = 2465 end
+	if scored == 10 then x = 1623 end
+	if scored == 11 then x = 2662 end
+
+	if scored == 6 then
+		SetGearPosition(gear, 2272, 1500)
+	else
+		SetGearPosition(gear, x, 1000)
+	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, 1780, 1300)
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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-1350)
+	
+	-- move the target to a higher vertical position
+	-- to ensure it's not somewhere down below
+	x, y = GetGearPosition(gear)
+	SetGearPosition(gear, x, 500)
+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, 1530, 1100)
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,199 @@
+--Created by Patrick Nielsen
+--It's been so fun to create this, your welcome to contact me at Trivkz@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
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -111,11 +111,11 @@
 -- 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 @@
 			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 @@
 -- 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.
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -112,7 +112,7 @@
 -- 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 @@
 	-- 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 @@
 			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 @@
 -- 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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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(2066, 1588, 0)
+PlaceGirder(2052, 1498, 6)
+PlaceGirder(2098, 1498, 6)
+PlaceGirder(2074, 1409, 0)
+PlaceGirder(2199, 1755, 7)
+PlaceGirder(2476, 1929, 2)
+PlaceGirder(2546, 1879, 4)
+PlaceGirder(2520, 1924, 3)
+PlaceGirder(2706, 1879, 4)
+PlaceGirder(2797, 1911, 2)
+PlaceGirder(2671, 1925, 1)
+PlaceGirder(2895, 1907, 6)
+PlaceGirder(2895, 1747, 6)
+PlaceGirder(2798, 1792, 6)
+PlaceGirder(2797, 1791, 6)
+PlaceGirder(2845, 1928, 1)
+PlaceGirder(2846, 1826, 3)
+PlaceGirder(2844, 1747, 1)
+PlaceGirder(2806, 1702, 4)
+PlaceGirder(2846, 1685, 0)
+PlaceGirder(2846, 1668, 0)
+PlaceGirder(2766, 1668, 0)
+PlaceGirder(2766, 1685, 0)
+PlaceGirder(2718, 1700, 2)
+PlaceGirder(2927, 1659, 0)
+------ HEALTH CRATE LIST ------
+SpawnHealthCrate(2500, 1193)
+SpawnHealthCrate(2575, 1201)
+SpawnHealthCrate(2610, 1224)
+SpawnHealthCrate(2463, 1213)
+SpawnHealthCrate(2425, 1235)
+SpawnHealthCrate(2657, 1234)
+------ MINE LIST ------
+tempG = AddGear(2034, 1704, gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(2055, 1744, gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(2063, 1772, gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(2075, 1801, gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(2089, 1820, gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(2118, 1824, gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+------ REPOSITION LIST ------
+SetGearPosition(player, 2074, 1558)
+SetGearPosition(enemy, 2536, 1182)
+SetHealth(player, 1)
+SetHealth(enemy, 1)
+------ AMMO CRATE LIST ------
+SpawnAmmoCrate(2656, 1967, 5)
+SpawnAmmoCrate(2747, 1912, 12)
+SpawnAmmoCrate(2939, 1623, 1)
+------ UTILITY CRATE LIST ------
+SpawnUtilityCrate(2543, 1969, 15)
+SpawnUtilityCrate(2251, 1664, 6)
+SpawnUtilityCrate(2440, 1937, 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
Binary file share/hedgewars/Data/Music/Golf.ogg has changed
Binary file share/hedgewars/Data/Music/Nature.ogg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -144,7 +144,7 @@
 		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 @@
 	if GetGearType(gear) == gtHedgehog then
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 
 	elseif GetGearType(gear) == gtPiano then
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,2 @@
+Default
+Default
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,233 @@
+--------------------------------
+-- HIGHLANDER / HOGS OF WAR
+-- version 0.3c
+-- by mikade
+--------------------------------
+
+-----------
+--0.1
+-----------
+
+-- concept test
+
+-----------
+--0.2
+-----------
+
+-- remove tardis till Henek fixes his tracker
+-- change wep crates to health crates
+-- reset arb turntimevalue
+-- include randomOrder
+-- Until fixed .17 methods come out, remove switches and resurrector
+-- on request, removed kamikaze and piano weapons
+-- provisional fixing of bugs that can't actually be fixed yet
+
+-----------
+--0.3
+-----------
+
+-- meh, update incorrect display
+-- may change this in the future to have switches
+-- but for now people are used to it without, so~
+
+-- mudball is now counted as a utility
+
+-----------
+--0.3b
+-----------
+
+-- cleaned up code and got rid of unneccessary vars
+-- mudball is a weapon again
+-- landgun is now a utility
+-- extra time, vampirism utility removed
+-- 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 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
+local started = false
+local switchStage = 0
+
+function StartingSetUp(gear)
+
+	for i = 1, #wepArray do
+		setGearValue(gear,wepArray[i],0)
+	end
+
+	setGearValue(gear,amKamikaze,1)
+
+	i = 1 + GetRandom(#atkArray)
+	setGearValue(gear,atkArray[i],1)
+
+	i = 1 + GetRandom(#utilArray)
+	setGearValue(gear,utilArray[i],1)
+
+	SetHealth(gear, 100)
+
+end
+
+--[[function SaveWeapons(gear)
+
+	-
+	for i = 1, (#wepArray) do
+		setGearValue(gear, wepArray[i], GetAmmoCount(gear, wepArray[i]) )
+		 --AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
+	end
+
+end]]
+
+function ConvertValues(gear)
+
+	for i = 1, #wepArray do
+		AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
+	end
+
+
+end
+
+
+function TransferWeps(gear)
+
+	if CurrentHedgehog ~= nil then
+
+		for i = 1, #wepArray do
+			val = getGearValue(gear,wepArray[i])
+			if val ~= 0 then
+				setGearValue(CurrentHedgehog, wepArray[i], val)
+				AddAmmo(CurrentHedgehog, wepArray[i], val)
+			end
+		end
+
+	end
+
+end
+
+function onGameInit()
+	GameFlags = gfInfAttack + gfRandomOrder
+	HealthCaseProb = 100
+end
+
+function onGameStart()
+
+
+	ShowMission	(
+				loc("HIGHLANDER"),
+				loc("Not all hogs are born equal."),
+
+				"- " .. loc("Eliminate enemy hogs and take their weapons.") .. "|" ..
+				"- " .. loc("Per-Hog Ammo") .. "|" ..
+				"- " .. loc("Weapons reset.") .. "|" ..
+				"- " .. loc("Unlimited Attacks") .. "|" ..
+				"", 4, 4000
+				)
+
+	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)
+
+
+end
+
+--function onNewTurn()
+--
+--end
+
+
+function onGameTick20()
+
+	if (CurrentHedgehog ~= nil) then
+
+		currName = GetHogName(CurrentHedgehog)
+
+		if (currName ~= lastName) then
+			AddCaption(loc("Switched to ") .. currName .. "!")
+			ConvertValues(CurrentHedgehog)
+		end
+
+		lastName = currName
+	end
+
+end
+
+--[[function onHogHide(gear)
+	-- waiting for Henek
+end
+
+function onHogRestore(gear)
+	-- waiting for Henek
+end]]
+
+function onGearAdd(gear)
+
+	--if GetGearType(gear) == gtSwitcher then
+	--	SaveWeapons(CurrentHedgehog)
+	--end
+
+	if (GetGearType(gear) == gtHedgehog) then
+		trackGear(gear)
+	end
+
+end
+
+function onGearDelete(gear)
+
+	if (GetGearType(gear) == gtHedgehog) then --or (GetGearType(gear) == gtResurrector) then
+		TransferWeps(gear)
+		trackDeletion(gear)
+	end
+
+end
+
+function onAmmoStoreInit()
+	SetAmmo(amSkip, 9, 0, 0, 0)
+	SetAmmo(amKamikaze, 9, 0, 0, 0)
+	--SetAmmo(amSwitch, 9, 0, 0, 0) -------1
+end
+
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -107,7 +107,6 @@
 --------
 
 local cGear = nil
-local gTimer = 0
 
 local bestClan = nil
 local bestTime = nil
@@ -116,7 +115,6 @@
 local gameOver = false
 local racerActive = false
 local trackTime = 0
-local wpCheckCounter = 0
 
 local wpCirc = {}
 local wpX = {}
@@ -353,7 +351,7 @@
 	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 @@
 		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 @@
 			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 @@
 
 end
 
-function onGameTick()
+function onGameTick20()
 
 	-- airstrike detected, convert this into a potential waypoint spot
 	if cGear ~= nil then
-		x,y = GetGearTarget(cGear)
+		x,y = GetGearPosition(cGear)
+        if x > -9000 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
-
+            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 @@
 		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
+			trackTime = trackTime + 20
 
-			wpCheckCounter = wpCheckCounter + 1
-			if (wpCheckCounter == 100) then
-
-				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 @@
 
 
 		-- 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 @@
 	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
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -5,7 +5,7 @@
 ---------------------------------------------------
 ---------------------------------------------------
 ---------------------------------------------------
---- Space Invasion Code Follows (1.0)
+--- Space Invasion Code Follows (1.1)
 ---------------------------------------------------
 ---------------------------------------------------
 -- VERSION HISTORY
@@ -125,24 +125,56 @@
 ------------------------
 -- 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! +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 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 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 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 pShield
 local shieldHealth
 
+local shockwave
+local shockwaveHealth = 0
+local shockwaveRad = 300
+
 local Timer100 = 0
 
 local vTag = {}
@@ -362,7 +413,7 @@
 		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 @@
 
 		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 @@
 		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 @@
 -- 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()
-
-	--WriteLnToConsole("onPrecise event handler at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
+-- old method
+--[[function onPrecise()
+
 
 	-- Fire Barrel
 	if (primShotsLeft > 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
@@ -734,25 +870,61 @@
 
 		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
 
 
+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 @@
 	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 @@
 	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 @@
 
 	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 @@
 
 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 @@
 	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 @@
 		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 @@
 
 	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 @@
 		end
 
 
+
 		--nw WriteLnToConsole("Starting ThingsToBeRunOnGears()")
 
 		runOnGears(ThingsToBeRunOnGears)
@@ -1063,6 +1270,7 @@
 		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 @@
 				--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 @@
 
 			end
 
+
+			HandleFlameThrower()
+
+
 		end -- new end I put here to check if he's still alive or not
 
 	end
@@ -1196,6 +1415,16 @@
 
 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 @@
 		TimeLeft = 0
 		--WriteLnToConsole("Current hedgehog just drowned himself")
 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
-
 	end
 
 end
@@ -1220,7 +1448,7 @@
 	--end
 
 	if GetGearType(gear) == gtHedgehog then
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 
 		-----------
 		-- control
@@ -1233,7 +1461,8 @@
 
 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 @@
 		--end
 	elseif GetGearType(gear) == gtFlame then
 		--WriteLnToConsole("on GearDelete flame")
-	end
-
-
-
-
+	end]]
 
 	if isATrackedGear(gear) then
 		trackDeletion(gear)
@@ -1281,10 +1506,6 @@
 
 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 @@
 	w = g1Y - g2Y
 	r = math.sqrt( (q*q) + (w*w) )	--alternate
 
-
 	opp = w
 	if opp < 0 then
 		opp = opp*-1
@@ -1307,13 +1527,18 @@
 	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 @@
 	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 @@
 	--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 @@
 			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 @@
 		--nw WriteLnToConsole("Start of CheckVarious(): Shell ID: " .. getGearValue(gear,"ID"))
 	--end
 
-
-
-
 	targetHit = false
 
 	-- if circle is hit by player fire
@@ -1730,10 +1961,29 @@
 
 				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 @@
 
 					shotsHit = shotsHit + 1
 
+
+
 				end
 
 			--end
@@ -1760,7 +2012,7 @@
 		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 @@
 				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 @@
 			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 @@
 
 		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 @@
 	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)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,2 @@
+Default
+Default
--- a/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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 @@
 	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
+function onNewAmmoStore(groupIndex, hogIndex)
 
-                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)
+	SetAmmo(amSkip, 9, 0, 0, 0)
 
-                elseif z == 4 then
-
-                        SetHogName(hhs[i],"Demo")
-                        SetHogHat(hhs[i], "Skull")
-                        SetHealth(hhs[i],200)
-
-                elseif z == 5 then
-
-                        SetHogName(hhs[i],"Sniper")
-                        SetHogHat(hhs[i], "Sniper")
-                        SetHealth(hhs[i],120)
-
-                elseif z == 6 then
-
-                        SetHogName(hhs[i],"Saint")
-                        SetHogHat(hhs[i], "angel")
-                        SetHealth(hhs[i],300)
-
-                elseif z == 7 then
-
-                        SetHogName(hhs[i],"Pyro")
-                        SetHogHat(hhs[i], "Gasmask")
-                        SetHealth(hhs[i],150)
-
-                elseif z == 8 then
-
-                        SetHogName(hhs[i],"Loon")
-                        SetHogHat(hhs[i], "clown")
-                        SetHealth(hhs[i],100)
-
-                end
-
-                lastTeam = GetHogTeamName(hhs[i])
-
-        end
+	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
 
 end
 
-function ResetAllAmmo()
+function CreateTeam()
 
-        AddAmmo(CurrentHedgehog, amBazooka, 0)
-        AddAmmo(CurrentHedgehog, amGrenade, 0)
-        AddAmmo(CurrentHedgehog, amShotgun, 0)
+	currTeam = ""
+	lastTeam = ""
+	z = 0
+
+	for i = 0, (numhhs-1) do
 
-        AddAmmo(CurrentHedgehog, amGirder, 0)
-        AddAmmo(CurrentHedgehog, amBlowTorch, 0)
-        AddAmmo(CurrentHedgehog, amPickHammer, 0)
-        AddAmmo(CurrentHedgehog, amSwitch, 0)
+			currTeam = GetHogTeamName(hhs[i])
 
-        AddAmmo(CurrentHedgehog, amRope, 0)
-        AddAmmo(CurrentHedgehog, amParachute, 0)
-        AddAmmo(CurrentHedgehog, amFirePunch, 0)
-
-        AddAmmo(CurrentHedgehog, amDynamite, 0)
-        AddAmmo(CurrentHedgehog, amDrill, 0)
-        AddAmmo(CurrentHedgehog, amMine, 0)
+			if currTeam == lastTeam then
+					z = z + 1
+			else
+					z = 1
+			end
 
-        AddAmmo(CurrentHedgehog, amSniperRifle, 0)
-        AddAmmo(CurrentHedgehog, amDEagle, 0)
-        AddAmmo(CurrentHedgehog, amPortalGun, 0)
+			if z == 1 then
 
-        AddAmmo(CurrentHedgehog, amSeduction, 0)
-        AddAmmo(CurrentHedgehog, amResurrector, 0)
-        AddAmmo(CurrentHedgehog, amInvulnerable, 0)
+					SetHogName(hhs[i],"Soldier")
+					SetHogHat(hhs[i], "sf_vega")
+					SetHealth(hhs[i],200)
+
+			elseif z == 2 then
 
-        AddAmmo(CurrentHedgehog, amFlamethrower, 0)
-        AddAmmo(CurrentHedgehog, amMolotov, 0)
-        AddAmmo(CurrentHedgehog, amNapalm, 0)
+					SetHogHat(hhs[i], "Glasses")
+					SetHogName(hhs[i],"Engineer")
 
-        AddAmmo(CurrentHedgehog, amBaseballBat, 0)
-        AddAmmo(CurrentHedgehog, amGasBomb, 0)
-        AddAmmo(CurrentHedgehog, amKamikaze, 0)
+			elseif z == 3 then
 
-end
-
-function AssignAmmo()
+					SetHogName(hhs[i],"Ninja")
+					SetHogHat(hhs[i], "NinjaFull")
+					SetHealth(hhs[i],80)
 
-        ResetAllAmmo()
-        n = GetHogName(CurrentHedgehog)
+			elseif z == 4 then
+
+					SetHogName(hhs[i],"Demo")
+					SetHogHat(hhs[i], "Skull")
+					SetHealth(hhs[i],200)
+
+			elseif z == 5 then
 
-        AddAmmo(CurrentHedgehog, amSkip,100)
+					SetHogName(hhs[i],"Sniper")
+					SetHogHat(hhs[i], "Sniper")
+					SetHealth(hhs[i],120)
+
+			elseif z == 6 then
+
+					SetHogName(hhs[i],"Saint")
+					SetHogHat(hhs[i], "angel")
+					SetHealth(hhs[i],300)
 
-        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
+			elseif z == 7 then
+
+					SetHogName(hhs[i],"Pyro")
+					SetHogHat(hhs[i], "Gasmask")
+					SetHealth(hhs[i],150)
+
+			elseif z == 8 then
+
+					SetHogName(hhs[i],"Loon")
+					SetHogHat(hhs[i], "clown")
+					SetHealth(hhs[i],100)
+
+			end
+
+			lastTeam = GetHogTeamName(hhs[i])
+
+	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 @@
 
 
 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 @@
 				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 @@
 
 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
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,2 @@
+Default
+Default
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,2 @@
+Shoppa
+Shoppa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- a/share/hedgewars/Data/Scripts/Tracker.lua	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Scripts/Tracker.lua	Sun Oct 28 13:28:23 2012 +0100
@@ -32,19 +32,17 @@
         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 @@
     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 @@
     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
--- a/share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/Capture the Flag.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/Gaudy Racer.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/No Jumping.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/Normal.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/Random Weapon.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/Space Invasion.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/The Specialists.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Scripts/plist/Tumbler.plist	Thu Nov 24 13:44:30 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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>
--- a/share/hedgewars/Data/Sounds/voices/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Sounds/voices/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -9,6 +9,7 @@
 	Singer
 	Surfer
 	Default_uk
+	Default_es
 	HillBilly
 	)
 	add_subdirectory(${dir})
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Boring.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Byebye.ogg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Sounds/voices/Default_es/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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)
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Comeonthen.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Coward.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Enemydown.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Firstblood.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Flawless.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Hello.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Hurry.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Illgetyou.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Incoming.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Jump1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Jump2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Jump3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Kamikaze.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Laugh.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Missed.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Nooo.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Nutter.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ooff1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ooff2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ooff3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Oops.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ow1.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ow2.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ow3.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Ow4.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/PoisonCough.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/PoisonMoan.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Reinforcements.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Sameteam.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Stupid.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Takecover.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Traitor.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Uh-oh.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Victory.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Watchit.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Yessir.ogg has changed
Binary file share/hedgewars/Data/Sounds/voices/Default_es/Youllregretthat.ogg has changed
Binary file share/hedgewars/Data/Themes/Art/LandBackTex.png has changed
--- a/share/hedgewars/Data/Themes/Eyes/theme.cfg	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/Themes/Eyes/theme.cfg	Sun Oct 28 13:28:23 2012 +0100
@@ -7,3 +7,4 @@
 clouds = 9
 flakes = 50, 1, 1000, 50, 50
 ;1, 1000, 50, 50 are copied from bamboo theme, as these numbers are required
+flatten-flakes = yes
Binary file share/hedgewars/Data/Themes/Island/SkyL.png has changed
Binary file share/hedgewars/Data/Themes/Jungle/LandBackTex.png has changed
Binary file share/hedgewars/Data/Themes/Jungle/LandBackTex.xcf has changed
Binary file share/hedgewars/Data/Themes/Stage/horizont.png has changed
--- a/share/hedgewars/Data/misc/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/misc/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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)
 
--- a/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml	Sun Oct 28 13:28:23 2012 +0100
@@ -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"/>
--- a/share/hedgewars/Data/misc/hwengine.desktop.in	Thu Nov 24 13:44:30 2011 +0100
+++ b/share/hedgewars/Data/misc/hwengine.desktop.in	Sun Oct 28 13:28:23 2012 +0100
@@ -15,6 +15,7 @@
 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
--- a/tools/CMakeLists.txt	Thu Nov 24 13:44:30 2011 +0100
+++ b/tools/CMakeLists.txt	Sun Oct 28 13:28:23 2012 +0100
@@ -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()
+    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}")
 
-	#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}")
 
-	#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_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()
+    #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)
+    #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)
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
 endif()
 
--- a/tools/CreateMacBundle.cmake.in	Thu Nov 24 13:44:30 2011 +0100
+++ b/tools/CreateMacBundle.cmake.in	Sun Oct 28 13:28:23 2012 +0100
@@ -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})
+# macdeployqt will convert safely any absolute path library for 'hedgewars'
+execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/${bundle_name} 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)
+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)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/PascalBasics.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -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)
--- a/tools/PascalParser.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/tools/PascalParser.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -1,137 +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 Expression)
-    | 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 Expression Expression
-    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 Expression Phrase
-        | Phrases [Phrase]
-        | SwitchCase Expression [(Expression, Phrase)] (Maybe Phrase)
-        | Assignment Reference Expression
-    deriving Show
-data Expression = Expression String
-    | PrefixOp String Expression
-    | PostfixOp String Expression
-    | BinOp String Expression Expression
-    | StringLiteral String
-    | CharCode String
-    | NumberLiteral 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
-    
-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"
-            ]
-    , reservedOpNames= [] 
-    , caseSensitive  = False   
-    }
-    
-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
@@ -142,36 +38,49 @@
     comments
     return $ Unit name int impl Nothing Nothing
 
-    
+
 reference = buildExpressionParser table term <?> "reference"
     where
     term = comments >> choice [
-        parens pas reference 
-        , char '@' >> reference >>= return . Address
-        , iD >>= return . SimpleReference
+        parens pas (liftM RefExpression expression >>= postfixes) >>= postfixes
+        , try $ typeCast >>= postfixes
+        , char '@' >> liftM Address reference >>= postfixes
+        , liftM SimpleReference iD >>= postfixes 
         ] <?> "simple reference"
 
-    table = [ 
-            [Postfix $ (parens pas) (option [] parameters) >>= return . FunCall]
-          , [Postfix (char '^' >> return Dereference)]
-          , [Postfix $ (brackets pas) (commaSep1 pas $ expression) >>= return . ArrayElement]
-          , [Infix (try (char '.' >> notFollowedBy (char '.')) >> return RecordField) AssocLeft]
+    table = [
         ]
 
-    
-varsDecl1 = varsParser sepEndBy1    
+    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
+        ]
+
+    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")
@@ -183,10 +92,10 @@
     init <- option Nothing $ do
         char '='
         comments
-        e <- expression
+        e <- initExpression
         comments
         return (Just e)
-    return $ VarDeclaration False (ids, t) init
+    return $ VarDeclaration isVar False (ids, t) init
 
 
 constsDecl = do
@@ -196,47 +105,98 @@
     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 <- expression
+        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
-    , rangeDecl >>= return . RangeType
+    , setDecl
+    , functionType
     , sequenceDecl >>= return . Sequence
-    , identifier pas >>= return . SimpleType . Identifier
+    , try iD >>= return . SimpleType
+    , rangeDecl >>= return . RangeType
     ] <?> "type declaration"
     where
     arrayDecl = do
-        try $ string "array"
+        try $ do
+            optional $ (try $ string "packed") >> comments
+            string "array"
         comments
-        char '['
-        r <- rangeDecl
-        char ']'
-        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
@@ -252,91 +212,108 @@
         semi pas
         comments
         return $ TypeDeclaration i t
-        
+
 rangeDecl = choice [
     try $ rangeft
     , iD >>= return . Range
     ] <?> "range declaration"
     where
     rangeft = do
-    e1 <- expression
+    e1 <- initExpression
     string ".."
-    e2 <- expression
+    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"
-        comments
-        i <- iD
-        optional $ do
-            char '('
-            varsDecl False
-            char ')'
+
+    operatorDecl = do
+        try $ string "operator"
         comments
-        char ';'
-        b <- if isImpl then
-                do
-                comments
-                optional $ typeVarDeclaration True
-                comments
-                liftM Just functionBody
-                else
-                return Nothing
+        i <- manyTill anyChar space
         comments
-        return $ [FunctionDeclaration i UnknownType b]
-        
-    funcDecl = do
-        try $ string "function"
+        vs <- parens pas $ varsDecl False
         comments
-        i <- iD
-        optional $ do
-            char '('
-            varsDecl False
-            char ')'
+        rid <- iD
         comments
         char ':'
         comments
         ret <- typeDecl
         comments
+        return ret
         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 Nothing]
+        return $ [OperatorDeclaration i rid inline ret vs b]
+
+
+    funcDecl = do
+        fp <- try (string "function") <|> try (string "procedure")
+        comments
+        i <- iD
+        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
+        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 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"
@@ -344,9 +321,16 @@
     name <- iD
     (char ';')
     comments
-    impl <- implementation
+    comments
+    u <- uses
+    comments
+    tv <- typeVarDeclaration True
     comments
-    return $ Program name impl
+    p <- phrase
+    comments
+    char '.'
+    comments
+    return $ Program name (Implementation u (TypesAndVars tv)) p
 
 interface = do
     string "interface"
@@ -367,52 +351,74 @@
     comments
     return $ Implementation u (TypesAndVars tv)
 
-expression = buildExpressionParser table term <?> "expression"
+expression = do
+    buildExpressionParser table term <?> "expression"
     where
     term = comments >> choice [
-        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
+        , 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 "and")) AssocNone
-           , Infix (try $ string "shr" >> return (BinOp "or")) 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
@@ -422,15 +428,17 @@
         , 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
@@ -439,9 +447,9 @@
     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
@@ -457,17 +465,17 @@
     return $ WhileCycle e o
 
 withBlock = do
-    try $ string "with"
+    try $ string "with" >> space
     comments
-    e <- expression
+    rs <- (commaSep1 pas) reference
     comments
     string "do"
     comments
     o <- phrase
-    return $ WithBlock e o
-    
+    return $ foldr WithBlock o rs
+
 repeatCycle = do
-    try $ string "repeat"
+    try $ string "repeat" >> space
     comments
     o <- many phrase
     string "until"
@@ -477,7 +485,7 @@
     return $ RepeatCycle e o
 
 forCycle = do
-    try $ string "for"
+    try $ string "for" >> space
     comments
     i <- iD
     comments
@@ -485,7 +493,12 @@
     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
@@ -493,8 +506,8 @@
     comments
     p <- phrase
     comments
-    return $ ForCycle i e1 e2 p
-    
+    return $ ForCycle i e1 e2 p up
+
 switchCase = do
     try $ string "case"
     comments
@@ -504,35 +517,38 @@
     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
@@ -543,3 +559,101 @@
             char ';'
             comments
             return u
+
+initExpression = buildExpressionParser table term <?> "initialization expression"
+    where
+    term = comments >> choice [
+        liftM (uncurry BuiltInFunction) $ builtInFunction initExpression 
+        , 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 >>= \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
+        char ':'
+        spaces
+        e <- initExpression
+        spaces
+        return (i ,e)
+
+    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
+           , 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
+           , Infix (try (string ">=") >> return (InitBinOp ">=")) AssocNone
+           , Infix (char '<' >> return (InitBinOp "<")) AssocNone
+           , Infix (char '>' >> return (InitBinOp ">")) AssocNone
+           , Infix (char '=' >> return (InitBinOp "=")) AssocNone
+          ]
+        {--, [  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 "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 <- 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)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/PascalPreprocessor.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -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 ++ "}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/PascalUnitSyntaxTree.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/build_windows.bat	Sun Oct 28 13:28:23 2012 +0100
@@ -0,0 +1,63 @@
+@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
--- a/tools/pas2c.hs	Thu Nov 24 13:44:30 2011 +0100
+++ b/tools/pas2c.hs	Sun Oct 28 13:28:23 2012 +0100
@@ -1,95 +1,1086 @@
+{-# LANGUAGE ScopedTypeVariables #-}
 module Pas2C where
 
-import PascalParser
 import Text.PrettyPrint.HughesPJ
 import Data.Maybe
 import Data.Char
+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
 
 
-pascal2C :: PascalUnit -> Doc
-pascal2C (Unit unitName interface implementation init fin) = implementation2C implementation
+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
 
 
-implementation2C :: Implementation -> Doc
-implementation2C (Implementation uses tvars) = typesAndVars2C tvars
+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
 
 
-typesAndVars2C :: TypesAndVars -> Doc
-typesAndVars2C (TypesAndVars ts) = vcat $ map tvar2C ts
+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"
 
 
-tvar2C :: TypeVarDeclaration -> Doc
-tvar2C (FunctionDeclaration (Identifier name) returnType Nothing) = 
-    type2C returnType <+> text (name ++ "();")
+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 (FunctionDeclaration (Identifier name) returnType (Just phrase)) = 
-    type2C returnType <+> text (name ++ "()") 
-    $$
-    phrase2C phrase
-tvar2C _ = empty
+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
 
-type2C :: TypeDecl -> Doc
-type2C UnknownType = text "void"
-type2C _ = text "<<type>>"
+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
 
-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
+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
-    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
+    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
-    case2C :: (Expression, Phrase) -> Doc
-    case2C (e, p) = text "case" <+> parens (expr2C e) <> char ':' <> nest 4 (phrase2C p $+$ text "break;")
-{-
-        | RepeatCycle Expression Phrase
-        | ForCycle
-        -}
-phrase2C _ = empty
+    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 -> 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
+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
 
 
-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 :: 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
 
-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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/w32DownloadUnzip.vbs	Sun Oct 28 13:28:23 2012 +0100
@@ -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@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