merge further changes from 0.9.20
authorkoda
Sun, 29 Dec 2013 12:36:16 +0100
changeset 9870 acf1ccf06b2d
parent 9861 2b4f9e1496c6 (current diff)
parent 9867 bfc2fdc1ccd1 (diff)
child 9879 141c0d6c2179
merge further changes from 0.9.20
CMakeLists.txt
cmake_modules/paths.cmake
--- a/CMakeLists.txt	Thu Dec 26 16:52:51 2013 +0100
+++ b/CMakeLists.txt	Sun Dec 29 12:36:16 2013 +0100
@@ -51,9 +51,10 @@
 
 #general utilities
 include(${CMAKE_MODULE_PATH}/utils.cmake)
+#paths initialization
+include(${CMAKE_MODULE_PATH}/paths.cmake)
 #platform specific init code
 include(${CMAKE_MODULE_PATH}/platform.cmake)
-include(${CMAKE_MODULE_PATH}/paths.cmake)
 
 
 #when build type is not specified, assume Debug/Release according to build version information
--- a/QTfrontend/res/css/chat.css	Thu Dec 26 16:52:51 2013 +0100
+++ b/QTfrontend/res/css/chat.css	Sun Dec 29 12:36:16 2013 +0100
@@ -9,7 +9,7 @@
  *
  * In the QTfrontend of hedgewars also display:none; will work for class names
  * that start with msg_ and .timestamp -  as long as they are referenced
- * directly and not within any class hierachy.
+ * directly and not within any class hierarchy.
  * Note: Will only effect new lines!
  *
  ******************************************************************************
--- a/cmake_modules/paths.cmake	Thu Dec 26 16:52:51 2013 +0100
+++ b/cmake_modules/paths.cmake	Sun Dec 29 12:36:16 2013 +0100
@@ -55,14 +55,16 @@
 #which point to directories outside the build tree to the install RPATH
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
 
-#paths where to find libraries (final slash not optional):
-# - the first is relative to the executable
-# - the second is the same directory of the executable (so it runs in bin/)
-# - the third one is the full path of the system dir
-#source http://www.cmake.org/pipermail/cmake/2008-January/019290.html
-set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/")
-
-
-#install_name_tool magic for OS X
-set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks")
-
+if(APPLE)
+    #@rpath mangling
+    set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
+    #install_name_tool for libraries
+    set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks")
+else(APPLE)
+    #paths where to find libraries (final slash not optional):
+    # - the first is relative to the executable
+    # - the second is the same directory of the executable (so it runs in bin/)
+    # - the third one is the full path of the system dir
+    #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html
+    set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/")
+endif(APPLE)
--- a/cmake_modules/platform.cmake	Thu Dec 26 16:52:51 2013 +0100
+++ b/cmake_modules/platform.cmake	Sun Dec 29 12:36:16 2013 +0100
@@ -31,24 +31,15 @@
         set(minimum_macosx_version ${current_macosx_version})
     endif()
 
-    #lower systems don't have enough processing power anyway
-    if (minimum_macosx_version 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 VERSION_EQUAL "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")
-        add_flag_append(CMAKE_C_FLAGS "${DYLIB_SMPEG} ${DYLIB_MIKMOD}")
-        add_flag_append(CMAKE_CXX_FLAGS "${DYLIB_SMPEG} ${DYLIB_MIKMOD}")
-        add_flag_append(CMAKE_Pascal_FLAGS "-k${DYLIB_SMPEG} -k${DYLIB_MIKMOD}")
+    #10.3 systems don't have enough processing power anyway
+    #10.4 does not have @rpath support (which SDL uses)
+    if(minimum_macosx_version VERSION_LESS "10.5")
+        message(FATAL_ERROR "Hedgewars is not supported on your version of Mac OS X")
     endif()
 
     if(NOT CMAKE_OSX_ARCHITECTURES)
         if(current_macosx_version VERSION_LESS "10.6")
-            #SDL is only 32 bit on lower OS
+            #SDL is only 32 bit on older OS version
             if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*")
                 set(CMAKE_OSX_ARCHITECTURES "ppc7400")
             else()
@@ -83,20 +74,21 @@
     #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} VERSION_EQUAL ${current_macosx_version})
-        if(minimum_macosx_version VERSION_EQUAL "10.4")
-            set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
-            set(CMAKE_C_COMPILER "/Developer/usr/bin/gcc-4.0")
-            set(CMAKE_CXX_COMPILER "/Developer/usr/bin/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()
+        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/")
         add_flag_append(CMAKE_Pascal_FLAGS "-XR${CMAKE_OSX_SYSROOT}")
         add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version}")
     endif()
 
     #add user framework directory
     add_flag_append(CMAKE_Pascal_FLAGS "-Ff~/Library/Frameworks")
+
+    #workaround older cmake versions
+    if(${CMAKE_VERSION} VERSION_LESS "2.8.12")
+        add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}")
+        add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}")
+        add_flag_append(CMAKE_Pascal_LINK_FLAGS "-k-rpath -k${CMAKE_INSTALL_RPATH}")
+    endif()
 endif(APPLE)
 
 if(MINGW)
--- a/hedgewars/uLandGraphics.pas	Thu Dec 26 16:52:51 2013 +0100
+++ b/hedgewars/uLandGraphics.pas	Sun Dec 29 12:36:16 2013 +0100
@@ -210,22 +210,22 @@
         Land[y, i]:= Land[y, i] and lfNotCurrentMask;
         end;
     changePixelSetNotCurrent:
-    for i:= fromPix to toPix do
-        begin
-        if Land[y, i] and lfObjMask > 0 then
-            Land[y, i]:= (Land[y, i] and lfNotObjMask) or ((Land[y, i] and lfObjMask) - 1);
-        end;
+        for i:= fromPix to toPix do
+            begin
+            if Land[y, i] and lfObjMask > 0 then
+                Land[y, i]:= Land[y, i] - 1;
+            end;
     setCurrentHog:
     for i:= fromPix to toPix do
         begin
         Land[y, i]:= Land[y, i] or lfCurrentHog
         end;
     changePixelNotSetNotCurrent:
-    for i:= fromPix to toPix do
-        begin
-        if Land[y, i] and lfObjMask < lfObjMask then
-            Land[y, i]:= (Land[y, i] and lfNotObjMask) or ((Land[y, i] and lfObjMask) + 1)
-        end;
+        for i:= fromPix to toPix do
+            begin
+            if Land[y, i] and lfObjMask < lfObjMask then
+                Land[y, i]:= Land[y, i] + 1
+            end;
     end;
 end;
 
--- a/share/hedgewars/Data/misc/hedgewars.desktop	Thu Dec 26 16:52:51 2013 +0100
+++ b/share/hedgewars/Data/misc/hedgewars.desktop	Sun Dec 29 12:36:16 2013 +0100
@@ -20,5 +20,5 @@
 Exec=hedgewars %U
 Terminal=false
 StartupNotify=false
-Categories=Application;Game;StrategyGame;
+Categories=Game;StrategyGame;
 MimeType=x-scheme-handler/hwplay;