Merge
authorMedo <smaxein@googlemail.com>
Tue, 19 Jun 2012 21:20:08 +0200
changeset 7267 710f3ced8934
parent 7234 613998625a3c (current diff)
parent 7265 3f96073156e1 (diff)
child 7269 5b0aeef8ba2a
Merge
QTfrontend/CMakeLists.txt
QTfrontend/game.cpp
share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist
share/hedgewars/Data/Scripts/plist/Capture the Flag.plist
share/hedgewars/Data/Scripts/plist/Highlander.plist
share/hedgewars/Data/Scripts/plist/No Jumping.plist
share/hedgewars/Data/Scripts/plist/Normal.plist
share/hedgewars/Data/Scripts/plist/Racer.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/CMakeLists.txt	Tue Jun 19 21:17:05 2012 +0200
+++ b/CMakeLists.txt	Tue Jun 19 21:20:08 2012 +0200
@@ -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,26 +15,26 @@
 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)
+    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)
 ENDIF()
 
 
@@ -47,108 +47,107 @@
 
 
 #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)
+    SET(BUILD_ENGINE_LIBRARY 0)
 ENDIF(NOT BUILD_ENGINE_LIBRARY)
 set(target_dir "bin")
 
-
 #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")
+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 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})
+    #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()
-		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()
+            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()
 
-	#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()
+    #lower systems don't have enough processing power anyways
+    if (minimum_macosx_version LESS "10.4")
+        message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4")
+    endif()
 
-	#workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2)
-	if(current_macosx_version MATCHES "10.4")
-		find_package(SDL_mixer REQUIRED)
-		set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg")
-		set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod")
-		set(pascal_flags "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}" ${pascal_flags})
-		set(CMAKE_C_FLAGS "${DYLIB_SMPEG}" "${DYLIB_MIKMOD}" ${CMAKE_C_FLAGS})
-	endif()
+    #workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2)
+    if(current_macosx_version MATCHES "10.4")
+        find_package(SDL_mixer REQUIRED)
+        set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg")
+        set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod")
+        set(pascal_flags "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}" ${pascal_flags})
+        set(CMAKE_C_FLAGS "${DYLIB_SMPEG}" "${DYLIB_MIKMOD}" ${CMAKE_C_FLAGS})
+    endif()
 
-	#CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking
-	if(NOT CMAKE_OSX_ARCHITECTURES)
-		if(current_macosx_version LESS "10.6")
-			if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*")
-				set(CMAKE_OSX_ARCHITECTURES "ppc7400")
-			else()
-				set(CMAKE_OSX_ARCHITECTURES "i386")
-			endif()
-		else()
-			set(CMAKE_OSX_ARCHITECTURES "x86_64")
-		endif()
-	endif()
+    #CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking
+    if(NOT CMAKE_OSX_ARCHITECTURES)
+        if(current_macosx_version LESS "10.6")
+            if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*")
+                set(CMAKE_OSX_ARCHITECTURES "ppc7400")
+            else()
+                set(CMAKE_OSX_ARCHITECTURES "i386")
+            endif()
+        else()
+            set(CMAKE_OSX_ARCHITECTURES "x86_64")
+        endif()
+    endif()
 
-	#CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on
-	#we need to provide the correct one when host and target differ
-	if(NOT ${minimum_macosx_version} MATCHES ${current_macosx_version})
-		if(minimum_macosx_version MATCHES "10.4")
-			set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
-			set(CMAKE_C_COMPILER "gcc-4.0")
-			set(CMAKE_CXX_COMPILER "g++-4.0")
-		else()
-			string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version})
-			set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/")
-		endif()
-	endif()
+    #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on
+    #we need to provide the correct one when host and target differ
+    if(NOT ${minimum_macosx_version} MATCHES ${current_macosx_version})
+        if(minimum_macosx_version MATCHES "10.4")
+            set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
+            set(CMAKE_C_COMPILER "gcc-4.0")
+            set(CMAKE_CXX_COMPILER "g++-4.0")
+        else()
+            string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version})
+            set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/")
+        endif()
+    endif()
 
-	#add user framework directory, other paths can be passed via FPFLAGS
-	set(pascal_flags "-Ff~/Library/Frameworks" ${pascal_flags})
-	#set deployment target
-	set(pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_flags})
+    #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}")
+    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)
+    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)
+    message(STATUS "Building Debug")
+    set(Optz false)
 else()
-	message(STATUS "Building Release")
-	set(Optz true)
+    message(STATUS "Building Release")
+    set(Optz true)
 endif()
 
 
@@ -161,66 +160,76 @@
 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
 
 separate_arguments(fpflags_full UNIX_COMMAND ${FPFLAGS})
-set(pascal_flags ${fpflags_full} "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_flags})
+set(pascal_flags ${fpflags_full} "-B" "-FE../bin" "-Cs2000000" "-vewn" "-dDEBUGFILE" ${pascal_flags})
 separate_arguments(ghflags_full UNIX_COMMAND ${GHFLAGS})
 set(haskell_flags "-O2" ${haskell_flags} ${ghflags_full})
 
 if(Optz)
-#	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})
+#    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})
 else(Optz)
-	set(pascal_flags "-O-" "-g" "-gl" "-gv" "-Ct" "-dDEBUGFILE" ${pascal_flags})
-	set(haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind" ${haskell_flags})
+    set(pascal_flags "-O-" "-g" "-gl" "-gv" "-Ct" ${pascal_flags})
+    set(haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind" ${haskell_flags})
 endif(Optz)
 
 
 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)
 
 
-if(WITH_SERVER)
-	if(GHC)
-		set(ghc_executable ${GHC})
-	else()
-		find_program(ghc_executable ghc)
-	endif()
+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)
+    else()
+        message(STATUS "No GHC executable found, 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()
 
 find_package(Lua)
-if(NOT ${LUA_FOUND})
-        message(STATUS "Lua library not found, building bundled dependency")
-	add_subdirectory(misc/liblua)
-	#link with liblua.a (which requires system readline)
-	set(pascal_flags "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_flags})
+if(LUA_FOUND)
+    message(STATUS "Lua library is present on your system (${LUA_DEFAULT})")
+else()
+    message(STATUS "Lua library not found, building bundled dependency")
+    add_subdirectory(misc/liblua)
+    #linking with liblua.a requires system readline -- this works everywhere, right?
+    if(WIN32)
+        set(pascal_flags "-k${CMAKE_BINARY_DIR}/bin/liblua.dll.a" "-k-lreadline" ${pascal_flags})
+    else()
+        set(pascal_flags "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_flags})
+    endif()
 endif()
+
 add_subdirectory(hedgewars)
 
+
 #run cmake -DANDROID=1 to enable this
 if(ANDROID)
-	add_subdirectory(project_files/Android-build)
+    add_subdirectory(project_files/Android-build)
 endif()
 
+
 if(NOT (BUILD_ENGINE_LIBRARY OR ANDROID))
-	add_subdirectory(bin)
-	add_subdirectory(misc/quazip)
-	add_subdirectory(QTfrontend)
-	add_subdirectory(share)
-	add_subdirectory(tools)
+    add_subdirectory(bin)
+    add_subdirectory(misc/quazip)
+    add_subdirectory(QTfrontend)
+    add_subdirectory(share)
+    add_subdirectory(tools)
 endif()
 
 
@@ -235,74 +244,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/QTfrontend/CMakeLists.txt	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/CMakeLists.txt	Tue Jun 19 21:20:08 2012 +0200
@@ -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)
@@ -139,7 +141,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})
 
@@ -185,7 +187,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/game.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/game.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -21,6 +21,7 @@
 #include <QUuid>
 #include <QColor>
 #include <QStringListModel>
+#include <QTextStream>
 
 #include "game.h"
 #include "hwconsts.h"
@@ -28,8 +29,7 @@
 #include "gamecfgwidget.h"
 #include "teamselect.h"
 #include "proto.h"
-
-#include <QTextStream>
+#include "ThemeModel.h"
 
 QString training, campaign; // TODO: Cleaner solution?
 
--- a/QTfrontend/hwconsts.cpp.in	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/hwconsts.cpp.in	Tue Jun 19 21:20:08 2012 +0200
@@ -72,19 +72,3 @@
 
 int season = SEASON_NONE;
 int years_since_foundation = 0;
-
-QStandardItemModel * colorsModel;
-
-void hwConstsInit()
-{
-    colorsModel = new QStandardItemModel();
-
-    int i = 0;
-    while(colors[i])
-    {
-        QStandardItem * item = new QStandardItem();
-        item->setData(QColor(colors[i]));
-        colorsModel->appendRow(item);
-        ++i;
-    }
-}
--- a/QTfrontend/hwconsts.h	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/hwconsts.h	Tue Jun 19 21:20:08 2012 +0200
@@ -44,8 +44,7 @@
 extern int cAmmoNumber;
 extern QList< QPair<QString, QString> > cDefaultAmmos;
 
-//extern unsigned int colors[];
-extern QStandardItemModel * colorsModel;
+extern unsigned int colors[];
 
 extern QString * netHost;
 extern quint16 netPort;
@@ -60,8 +59,6 @@
 //Could be used to implement a text/graphic like "This is the xxth birthday of hedgewars" or similar
 extern int years_since_foundation;
 
-void hwConstsInit();
-
 #endif
 
 #define HEDGEHOGS_PER_TEAM           8
--- a/QTfrontend/main.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/main.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -104,8 +104,6 @@
 {
     HWApplication app(argc, argv);
 
-    hwConstsInit();
-
     app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
 
     QStringList arguments = app.arguments();
--- a/QTfrontend/model/GameStyleModel.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/model/GameStyleModel.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -21,6 +21,8 @@
  * @brief GameStyleModel class implementation
  */
 
+#include <QTextStream>
+
 #include "GameStyleModel.h"
 
 
--- a/QTfrontend/model/roomslistmodel.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/model/roomslistmodel.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -21,12 +21,13 @@
  * @brief RoomsListModel class implementation
  */
 
-#include "roomslistmodel.h"
-
 #include <QBrush>
 #include <QColor>
 #include <QIcon>
 
+#include "roomslistmodel.h"
+#include "MapModel.h"
+
 RoomsListModel::RoomsListModel(QObject *parent) :
     QAbstractTableModel(parent),
     c_nColumns(8)
--- a/QTfrontend/team.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/team.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -26,6 +26,7 @@
 
 #include "team.h"
 #include "hwform.h"
+#include "DataManager.h"
 
 HWTeam::HWTeam(const QString & teamname) :
     QObject(0)
@@ -150,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;
@@ -351,12 +352,12 @@
 
 QColor HWTeam::qcolor() const
 {
-    return colorsModel->item(m_color)->data().value<QColor>();
+    return DataManager::instance().colorsModel()->item(m_color)->data().value<QColor>();
 }
 
 void HWTeam::setColor(int color)
 {
-    m_color = color % colorsModel->rowCount();
+    m_color = color % DataManager::instance().colorsModel()->rowCount();
 }
 
 
--- a/QTfrontend/ui/page/pageeditteam.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/ui/page/pageeditteam.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -26,12 +26,13 @@
 #include <QGroupBox>
 #include <QToolBox>
 #include <QMessageBox>
-
-#include "sdlkeys.h"
+#include <QStandardItemModel>
+#include <QDebug>
 #include "SquareLabel.h"
 #include "HWApplication.h"
 
 #include "DataManager.h"
+#include "HatModel.h"
 
 #include "pageeditteam.h"
 
@@ -196,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);
     }
 
@@ -422,9 +423,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);
     }
 }
 
@@ -450,9 +457,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;
--- a/QTfrontend/ui/widget/frameTeam.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/ui/widget/frameTeam.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -25,6 +25,7 @@
 #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)
@@ -54,12 +55,12 @@
 
 void FrameTeams::resetColors()
 {
-    currentColor = colorsModel->rowCount() - 1; // ensure next color is the first one
+    currentColor = DataManager::instance().colorsModel()->rowCount() - 1; // ensure next color is the first one
 }
 
 int FrameTeams::getNextColor()
 {
-    currentColor = (currentColor + 1) % colorsModel->rowCount();
+    currentColor = (currentColor + 1) % DataManager::instance().colorsModel()->rowCount();
     return currentColor;
 }
 
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -32,6 +32,7 @@
 #include "hwconsts.h"
 #include "ammoSchemeModel.h"
 #include "proto.h"
+#include "GameStyleModel.h"
 
 GameCFGWidget::GameCFGWidget(QWidget* parent) :
     QGroupBox(parent)
--- a/QTfrontend/ui/widget/mapContainer.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -36,6 +36,7 @@
 #include "mapContainer.h"
 #include "igbox.h"
 #include "HWApplication.h"
+#include "ThemeModel.h"
 
 HWMapContainer::HWMapContainer(QWidget * parent) :
     QWidget(parent),
--- a/QTfrontend/ui/widget/mapContainer.h	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/ui/widget/mapContainer.h	Tue Jun 19 21:20:08 2012 +0200
@@ -31,6 +31,7 @@
 
 #include "hwmap.h"
 #include "drawmapscene.h"
+#include "MapModel.h"
 
 class QPushButton;
 class IconedGroupBox;
--- a/QTfrontend/ui/widget/teamselhelper.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/ui/widget/teamselhelper.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -28,6 +28,7 @@
 #include "hwconsts.h"
 #include "frameTeam.h"
 #include "colorwidget.h"
+#include "DataManager.h"
 
 void TeamLabel::teamButtonClicked()
 {
@@ -69,7 +70,7 @@
     if(m_isPlaying)
     {
         // team color
-        colorWidget = new ColorWidget(colorsModel, this);
+        colorWidget = new ColorWidget(DataManager::instance().colorsModel(), this);
         colorWidget->setMinimumWidth(26);
         colorWidget->setMaximumWidth(26);
         colorWidget->setMinimumHeight(26);
--- a/QTfrontend/util/DataManager.cpp	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/util/DataManager.cpp	Tue Jun 19 21:20:08 2012 +0200
@@ -23,13 +23,19 @@
 
 #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()
 {
@@ -42,6 +48,8 @@
     m_hatModel = NULL;
     m_mapModel = NULL;
     m_themeModel = NULL;
+    m_colorsModel = NULL;
+    m_bindsModel = NULL;
 }
 
 
@@ -154,6 +162,43 @@
     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()
 {
     m_gameStyleModel->loadGameStyles();
--- a/QTfrontend/util/DataManager.h	Tue Jun 19 21:17:05 2012 +0200
+++ b/QTfrontend/util/DataManager.h	Tue Jun 19 21:20:08 2012 +0200
@@ -26,21 +26,13 @@
 
 #include <QDir>
 #include <QFile>
-
 #include <QStringList>
 
-#include "GameStyleModel.h"
-#include "HatModel.h"
-#include "MapModel.h"
-#include "ThemeModel.h"
-
-class QDir;
-class QFile;
-class QStringList;
 class GameStyleModel;
 class HatModel;
 class MapModel;
 class ThemeModel;
+class QStandardItemModel;
 
 /**
  * @brief Offers access to the data files of hedgewars.
@@ -135,6 +127,9 @@
          */
         ThemeModel * themeModel();
 
+        QStandardItemModel * colorsModel();
+        QStandardItemModel * bindsModel();
+
     public slots:
         /// Reloads data from storage.
         void reload();
@@ -163,6 +158,8 @@
         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/cmake_modules/FindLua.cmake	Tue Jun 19 21:17:05 2012 +0200
+++ b/cmake_modules/FindLua.cmake	Tue Jun 19 21:20:08 2012 +0200
@@ -20,8 +20,8 @@
             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)
-            ELSE()
                 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)
--- a/gameServer/ClientIO.hs	Tue Jun 19 21:17:05 2012 +0200
+++ b/gameServer/ClientIO.hs	Tue Jun 19 21:20:08 2012 +0200
@@ -48,6 +48,7 @@
         listenLoop s chan ci >> return "Connection closed")
         `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
         `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e)
+        `Exception.catch` (\(e :: Exception.SomeException) -> return . B.pack . show $ e)
         >>= clientOff >> remove
     where
         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
--- a/hedgewars/CMakeLists.txt	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/CMakeLists.txt	Tue Jun 19 21:20:08 2012 +0200
@@ -171,13 +171,15 @@
     if(${PNG_FOUND})
         message(STATUS "PNG screenshots enabled (library found at ${PNG_LIBRARY})")
         set(pascal_flags "-dPNG_SCREENSHOTS" ${pascal_flags})
-        if(APPLE)  # need to explictly link with the static lib
+        if(APPLE)  # need to explictly link with the static lib -- maybe windows too?
             string(REGEX REPLACE "(.*)libpng.*" "\\1" PNG_LIBDIR "${PNG_LIBRARY}")
             set(pascal_flags "-k${PNG_LIBDIR}/libpng.a" ${pascal_flags})
         endif()
     else()
         message(STATUS "PNG library not found, switching to screenshots in BMP format")
     endif()
+else()
+    message(STATUS "PNG screenshots disabled per user request, using BMP format")
 endif()
 
 set(fpc_flags ${noexecstack_flags} ${pascal_flags} ${hwengine_project})
@@ -215,7 +217,7 @@
 add_custom_target(${engine_output_name} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}")
 
 #when system Lua is not found we need to compile it before engine
-if(NOT ${LUA_FOUND})
+if(NOT LUA_FOUND)
     add_dependencies(${engine_output_name} lua)
 endif()
 
--- a/hedgewars/SDLh.pas	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/SDLh.pas	Tue Jun 19 21:20:08 2012 +0200
@@ -981,9 +981,6 @@
 function SDL_getenv(const text: PChar): PChar; cdecl; external SDLLibName;
 {$ENDIF}
 
-{$IFDEF ANDROID}
-function Android_JNI_getDensity(): Single; cdecl; external SDLLibName;
-{$ENDIF}
 
 {* Compatibility between SDL-1.2 and SDL-1.3 *}
 procedure SDL_WarpMouse(x, y: Word); {$IFDEF SDL13}inline{$ELSE}cdecl; external SDLLibName{$ENDIF};
--- a/hedgewars/options.inc	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/options.inc	Tue Jun 19 21:20:08 2012 +0200
@@ -16,60 +16,53 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-{$IFDEF FPC}
-    {$WRITEABLECONST OFF}
-    {$IMPLICITEXCEPTIONS OFF}
-    {$VARSTRINGCHECKS ON}
-    {$MODE OBJFPC}
-{$ELSE}
-    {$ERROR Only Free Pascal supported!}
+{$IFNDEF FPC}
+    {$ERROR Only FreePascal Compiler is supported!}
 {$ENDIF}
 
 {$MACRO ON}
+{$MODE OBJFPC}
 {$DEFINE GLunit:=GL}
+{$WRITEABLECONST OFF}
+{$IMPLICITEXCEPTIONS OFF}
+{$VARSTRINGCHECKS ON}
+
+{$DEFINE USE_LUA_SCRIPT}
+
 
 {$IFDEF ANDROID}
+    {$DEFINE MOBILE}
+    {$DEFINE USE_SDLTHREADS}
+    {$DEFINE USE_CONTEXT_RESTORE}
+    {$DEFINE Java_Prefix:= 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'}
+{$ENDIF}
+
+{$IFDEF IPHONEOS}
+    {$DEFINE MOBILE}
+{$ENDIF}
+
+{$IFDEF MOBILE}
     {$DEFINE SDL13}
     {$DEFINE HWLIBRARY}
     {$DEFINE S3D_DISABLED}
     {$DEFINE GLunit:=gles11}
-    {$DEFINE MOBILE}
-    {$DEFINE Java_Prefix:= 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'}
-    {$DEFINE USE_SDLTHREADS}
-    {$DEFINE USE_CONTEXT_RESTORE}
     {$DEFINE USE_LANDSCAPE_AMMOMENU}
     {$DEFINE USE_TOUCH_INTERFACE}
+{$ELSE}
+    {$DEFINE USE_AM_NUMCOLUMN}
 {$ENDIF}
 
-{$IFDEF IPHONEOS}
-    {$DEFINE SDL13}
-    {$DEFINE HWLIBRARY}
-    {$DEFINE S3D_DISABLED}
-    {$DEFINE GLunit:=gles11}
-    {$DEFINE MOBILE}
-    {$DEFINE USE_LANDSCAPE_AMMOMENU}
-    {$DEFINE USE_TOUCH_INTERFACE}
-{$ENDIF}
 
 {$IFDEF WIN32}
     {$DEFINE USE_CONTEXT_RESTORE}
 {$ENDIF}
 
-{$IFNDEF IPHONEOS}
-    {$IFDEF DARWIN}
+{$IFDEF DARWIN}
+    {$IFNDEF IPHONEOS}
         {$DEFINE USE_CONTEXT_RESTORE}
     {$ENDIF}
-    // not needed on ios because DEBUGFILE is switched from command line
-    {$DEFINE DEBUGFILE}
-    //{$DEFINE TRACEAIACTIONS}
-    //{$DEFINE COUNTTICKS}
 {$ENDIF}
 
-{$IFNDEF MOBILE}
-    {$DEFINE USE_AM_NUMCOLUMN}
-{$ENDIF}
-
-{$DEFINE USE_LUA_SCRIPT}
 
 {$IFDEF PAS2C}
     {$DEFINE NOCONSOLE}
@@ -78,3 +71,7 @@
 
 {$DEFINE _S:=}
 {$DEFINE _P:=}
+
+//{$DEFINE TRACEAIACTIONS}
+//{$DEFINE COUNTTICKS}
+
--- a/hedgewars/uAI.pas	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/uAI.pas	Tue Jun 19 21:20:08 2012 +0200
@@ -284,9 +284,15 @@
                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
                         end;
             if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
+                begin
+                // push current position so we proceed from it after checking jump opportunities
+                if CanGo then Push(ticks, Actions, Me^, Me^.Message);
+                // first check where we go after jump
                 if Push(ticks, Actions, AltMe, Me^.Message) then
                     with Stack.States[Pred(Stack.Count)] do
                         AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
+                break
+                end;
 
             // 'not CanGO' means we can't go straight, possible jumps are checked above
             if not CanGo then
--- a/hedgewars/uMobile.pas	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/uMobile.pas	Tue Jun 19 21:20:08 2012 +0200
@@ -28,6 +28,7 @@
 interface
 
 function  isPhone: Boolean; inline;
+function  getScreenDPI: Single; inline;
 procedure performRumble; inline;
 
 procedure GameLoading; inline;
@@ -47,6 +48,10 @@
 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
 {$ENDIF}
 
+{$IFDEF ANDROID}
+function Android_JNI_getDensity(): Single; cdecl; external;
+{$ENDIF}
+
 // this function is just to determine whether we are running on a limited screen device
 function isPhone: Boolean; inline;
 begin
@@ -61,6 +66,15 @@
 {$ENDIF}
 end;
 
+function getScreenDPI: Single; inline;
+begin
+{$IFDEF ANDROID}
+    getScreenDPI:= Android_JNI_getDensity();
+{$ELSE}
+    getScreenDPI:= 1;
+{$ENDIF}
+end;
+
 // this function should make the device vibrate in some way
 procedure PerformRumble; inline;
 {$IFDEF IPHONEOS}const kSystemSoundID_Vibrate = $00000FFF;{$ENDIF}
--- a/hedgewars/uTouch.pas	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/uTouch.pas	Tue Jun 19 21:20:08 2012 +0200
@@ -22,7 +22,7 @@
 
 interface
 
-uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions, uAmmos, uWorld;
+uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions, uAmmos, uWorld, uMobile;
 
 
 procedure initModule;
@@ -557,7 +557,7 @@
     isOnCrosshair:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger);
     printFinger(finger);
     WriteLnToConsole(inttostr(finger.x) + '   ' + inttostr(x));
-    WriteLnToConsole(inttostr(x) + '  ' + inttostr(y) + '   ' + inttostr(round(Android_JNI_getDensity() * 10)));
+    WriteLnToConsole(inttostr(x) + '  ' + inttostr(y) + '   ' + inttostr(round(uMobile.getScreenDPI * 10)));
 end;
 
 function isOnCurrentHog(finger: TTouch_Data): boolean;
@@ -632,7 +632,6 @@
 var
     index: Longword;
     //uRenderCoordScaleX, uRenderCoordScaleY: Longword;
-    density: Single;
 begin
     buttonsDown:= 0;
 
@@ -640,13 +639,7 @@
     for index := 0 to High(fingers) do 
         fingers[index].id := nilFingerId;
 
-{$IFDEF ANDROID}
-    density:= Android_JNI_getDensity();
-{$ELSE}
-    density:= 1.0;
-{$ENDIF}
-
-    rectSize:= round(baseRectSize * density);
+    rectSize:= round(baseRectSize * uMobile.getScreenDPI);
     halfRectSize:= rectSize shl 1;
 end;
 
--- a/hedgewars/uWorld.pas	Tue Jun 19 21:17:05 2012 +0200
+++ b/hedgewars/uWorld.pas	Tue Jun 19 21:20:08 2012 +0200
@@ -216,11 +216,7 @@
 {$IFDEF USE_TOUCH_INTERFACE}
 
 //positioning of the buttons
-{$IFDEF ANDROID}
-buttonScale:= Android_JNI_getDensity()/cDefaultZoomLevel;
-{$ELSE}
-buttonScale:= 1.5/cDefaultZoomLevel;
-{$ENDIF}
+buttonScale:= uMobile.getScreenDPI/cDefaultZoomLevel;
 
 
 with JumpWidget do
--- a/misc/liblua/CMakeLists.txt	Tue Jun 19 21:17:05 2012 +0200
+++ b/misc/liblua/CMakeLists.txt	Tue Jun 19 21:20:08 2012 +0200
@@ -7,6 +7,8 @@
     add_definitions(-DLUA_BUILD_AS_DLL)
     add_library(lua SHARED ${lua_src})
 
+    set(LUA_LIBRARY lua.dll)
+
     set_target_properties(lua PROPERTIES PREFIX "")
     install(TARGETS lua RUNTIME DESTINATION ${target_dir})
 else(WIN32)
--- a/misc/quazip/CMakeLists.txt	Tue Jun 19 21:17:05 2012 +0200
+++ b/misc/quazip/CMakeLists.txt	Tue Jun 19 21:20:08 2012 +0200
@@ -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")
--- a/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h	Tue Jun 19 21:17:05 2012 +0200
+++ b/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h	Tue Jun 19 21:20:08 2012 +0200
@@ -67,7 +67,7 @@
 #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");
--- a/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m	Tue Jun 19 21:17:05 2012 +0200
+++ b/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m	Tue Jun 19 21:20:08 2012 +0200
@@ -85,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);
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Tue Jun 19 21:17:05 2012 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Tue Jun 19 21:20:08 2012 +0200
@@ -72,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;
 }
 
@@ -202,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;
@@ -223,11 +222,11 @@
     return cell;
 }
 
--(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section {
+-(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger) section {
     return IS_IPAD() ? 0 : 50;
 }
 
--(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section {
+-(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)];
@@ -239,6 +238,32 @@
     return [theView autorelease];
 }
 
+-(CGFloat) tableView:(UITableView *)aTableView heightForFooterInSection:(NSInteger) section {
+    return 40;
+}
+
+-(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 -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -287,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];
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Tue Jun 19 21:17:05 2012 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Tue Jun 19 21:20:08 2012 +0200
@@ -1472,7 +1472,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#copy mono audio\ncp -R ${PROJECT_DIR}/../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#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\necho \"Done\"";
+			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#copy mono audio\ncp -R ${PROJECT_DIR}/../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 */ = {
@@ -1740,7 +1740,6 @@
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
 				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -1749,14 +1748,11 @@
 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
 				GCC_WARN_PEDANTIC = YES;
 				GCC_WARN_SHADOW = YES;
-				GCC_WARN_SIGN_COMPARE = YES;
 				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
 				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = NO;
 				GCC_WARN_UNKNOWN_PRAGMAS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_LABEL = YES;
-				GCC_WARN_UNUSED_PARAMETER = NO;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
@@ -1850,7 +1846,6 @@
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
 				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -1859,14 +1854,11 @@
 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
 				GCC_WARN_PEDANTIC = YES;
 				GCC_WARN_SHADOW = YES;
-				GCC_WARN_SIGN_COMPARE = YES;
 				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
 				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = NO;
 				GCC_WARN_UNKNOWN_PRAGMAS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_LABEL = YES;
-				GCC_WARN_UNUSED_PARAMETER = NO;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
@@ -2002,7 +1994,6 @@
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
 				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -2011,14 +2002,11 @@
 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
 				GCC_WARN_PEDANTIC = YES;
 				GCC_WARN_SHADOW = YES;
-				GCC_WARN_SIGN_COMPARE = YES;
 				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
 				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = NO;
 				GCC_WARN_UNKNOWN_PRAGMAS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_LABEL = YES;
-				GCC_WARN_UNUSED_PARAMETER = NO;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
@@ -2076,7 +2064,6 @@
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
 				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -2085,14 +2072,11 @@
 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
 				GCC_WARN_PEDANTIC = YES;
 				GCC_WARN_SHADOW = YES;
-				GCC_WARN_SIGN_COMPARE = YES;
 				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
 				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = NO;
 				GCC_WARN_UNKNOWN_PRAGMAS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_LABEL = YES;
-				GCC_WARN_UNUSED_PARAMETER = NO;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
--- a/share/CMakeLists.txt	Tue Jun 19 21:17:05 2012 +0200
+++ b/share/CMakeLists.txt	Tue Jun 19 21:20:08 2012 +0200
@@ -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)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.cfg	Tue Jun 19 21:20:08 2012 +0200
@@ -0,0 +1,2 @@
+Default
+Default
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Tue Jun 19 21:17:05 2012 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Tue Jun 19 21:20:08 2012 +0200
@@ -1608,7 +1608,7 @@
 
 		vType[i] = "generic"
 		vCounter[i] = 0
-		vCounterLim[i] = 3000
+		vCounterLim[i] = 150
 		vCircScore[i] = 0
 		vCircHealth[i] = 1
 
@@ -1801,7 +1801,7 @@
 			vType[i] = "drone"
 			vCircRadMin[i] = 50	*5
 			vCircRadMax[i] = 90	*5
-			vCounterLim[i] = 3000
+			vCounterLim[i] = 150
 			vCircScore[i] = 10
 			vCircHealth[i] = 1
 		--else
@@ -1826,7 +1826,7 @@
 			vCircRadMin[i] = 100*5
 			vCircRadMax[i] = 180*5
 			vCircWidth[i] = 1
-			vCounterLim[i] = 2000
+			vCounterLim[i] = 100
 			vCircScore[i] = 30
 			vCircHealth[i] = 3
 		else
@@ -1998,7 +1998,7 @@
 		end
 
 	-- if player is hit by circle bazooka
-	elseif (GetGearType(gear) == gtShell) then --or (GetGearType(gear) == gtBall) then
+	elseif (GetGearType(gear) == gtShell) and (CurrentHedgehog ~= nil) then --or (GetGearType(gear) == gtBall) then
 
 		dist = GetDistFromGearToGear(gear, CurrentHedgehog)
 
@@ -2387,17 +2387,19 @@
 		--WriteLnToConsole("I just got the velocity of the shell. It is dx: " .. dx .. "; dy: " .. dy)
 		--WriteLnToConsole("CurrentHedgehog is at X: " .. GetX(CurrentHedgehog) .. "; Y: " .. GetY(CurrentHedgehog) )
 
-		if GetX(gear) > GetX(CurrentHedgehog) then
-			dx = dx - turningSpeed--0.1
-		else
-			dx = dx + turningSpeed--0.1
-		end
-
-		if GetY(gear) > GetY(CurrentHedgehog) then
-			dy = dy - turningSpeed--0.1
-		else
-			dy = dy + turningSpeed--0.1
-		end
+        if CurrentHedgehog ~= nil then
+            if GetX(gear) > GetX(CurrentHedgehog) then
+                dx = dx - turningSpeed--0.1
+            else
+                dx = dx + turningSpeed--0.1
+            end
+
+            if GetY(gear) > GetY(CurrentHedgehog) then
+                dy = dy - turningSpeed--0.1
+            else
+                dy = dy + turningSpeed--0.1
+            end
+        end
 
 
 		if (GetGearType(gear) == gtShell) then
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.cfg	Tue Jun 19 21:20:08 2012 +0200
@@ -0,0 +1,2 @@
+Default
+Default
--- a/share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist	Tue Jun 19 21:17:05 2012 +0200
+++ /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	Tue Jun 19 21:17:05 2012 +0200
+++ /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/Highlander.plist	Tue Jun 19 21:17:05 2012 +0200
+++ /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/Highlander.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	Tue Jun 19 21:17:05 2012 +0200
+++ /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	Tue Jun 19 21:17:05 2012 +0200
+++ /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/Racer.plist	Tue Jun 19 21:17:05 2012 +0200
+++ /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/Racer.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Shoppa.plist</string>
-	<key>weapon</key>
-	<string>Shoppa.plist</string>
-</dict>
-</plist>
--- a/share/hedgewars/Data/Scripts/plist/Random Weapon.plist	Tue Jun 19 21:17:05 2012 +0200
+++ /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	Tue Jun 19 21:17:05 2012 +0200
+++ /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	Tue Jun 19 21:17:05 2012 +0200
+++ /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	Tue Jun 19 21:17:05 2012 +0200
+++ /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/tools/pas2c.hs	Tue Jun 19 21:17:05 2012 +0200
+++ b/tools/pas2c.hs	Tue Jun 19 21:20:08 2012 +0200
@@ -89,8 +89,8 @@
     s <- flip execStateT initState $ f fn
     renderCFiles s
     where
-    printLn = liftIO . hPutStrLn stderr
-    print = liftIO . hPutStr stderr
+    printLn = liftIO . hPutStrLn stdout
+    print = liftIO . hPutStr stdout
     initState = Map.empty
     f :: String -> StateT (Map.Map String PascalUnit) IO ()
     f fileName = do
@@ -122,7 +122,7 @@
 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)
+    --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
@@ -166,7 +166,7 @@
 toCFiles :: Map.Map String Records -> (String, PascalUnit) -> IO ()
 toCFiles _ (_, System _) = return ()
 toCFiles ns p@(fn, pu) = do
-    hPutStrLn stderr $ "Rendering '" ++ fn ++ "'..."
+    hPutStrLn stdout $ "Rendering '" ++ fn ++ "'..."
     toCFiles' p
     where
     toCFiles' (fn, p@(Program {})) = writeFile (fn ++ ".c") $ (render2C initialState . pascal2C) p