--- a/QTfrontend/CMakeLists.txt Thu Mar 17 23:11:48 2011 +0100
+++ b/QTfrontend/CMakeLists.txt Thu Mar 17 23:53:51 2011 +0100
@@ -12,9 +12,6 @@
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
-#find_package(QCA2 REQUIRED)
-#include_directories(${QCA2_INCLUDE_DIR})
-
# Configure for SDL
find_package(SDL REQUIRED)
find_package(SDL_mixer REQUIRED)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake_modules/FindSDL_Extras.cmake Thu Mar 17 23:53:51 2011 +0100
@@ -0,0 +1,53 @@
+#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)
+ file(STRINGS ${sdlmixer_h} sdlmixer_majorversion_tmp REGEX "SDL_MIXER_MAJOR_VERSION[\t' ']+[0-9]+")
+ file(STRINGS ${sdlmixer_h} sdlmixer_minorversion_tmp REGEX "SDL_MIXER_MINOR_VERSION[\t' ']+[0-9]+")
+ file(STRINGS ${sdlmixer_h} sdlmixer_patchversion_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
+ string(REGEX MATCH ".([0-9]+)" sdlmixer_majorversion "${sdlmixer_majorversion_tmp}")
+ string(REGEX MATCH ".([0-9]+)" sdlmixer_minorversion "${sdlmixer_minorversion_tmp}")
+ string(REGEX MATCH ".([0-9]+)" sdlmixer_patchversion "${sdlmixer_patchversion_tmp}")
+ 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})
+ endif()
+endif()
+
+#find which version of SDL_image we have (for IMG_Init)
+find_file(sdlimage_h SDL_image.h ${SDLIMAGE_INCLUDE_DIR})
+if(sdlimage_h)
+ file(STRINGS ${sdlimage_h} sdlimage_majorversion_tmp REGEX "SDL_IMAGE_MAJOR_VERSION[\t' ']+[0-9]+")
+ file(STRINGS ${sdlimage_h} sdlimage_minorversion_tmp REGEX "SDL_IMAGE_MINOR_VERSION[\t' ']+[0-9]+")
+ file(STRINGS ${sdlimage_h} sdlimage_patchversion_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
+ string(REGEX MATCH ".([0-9]+)" sdlimage_majorversion "${sdlimage_majorversion_tmp}")
+ string(REGEX MATCH ".([0-9]+)" sdlimage_minorversion "${sdlimage_minorversion_tmp}")
+ string(REGEX MATCH ".([0-9]+)" sdlimage_patchversion "${sdlimage_patchversion_tmp}")
+ 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})
+ endif()
+endif()
+
--- a/hedgewars/CMakeLists.txt Thu Mar 17 23:11:48 2011 +0100
+++ b/hedgewars/CMakeLists.txt Thu Mar 17 23:53:51 2011 +0100
@@ -5,31 +5,9 @@
find_package(SDL_mixer)
find_package(Lua)
-configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
-
-#find which version of SDL_image and SDL_mixer we have (for IMG_Init and Mix_Init)
-#if the headers are not installed, the newer apis won't be activated
-find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
-if(sdlmixer_h)
- file(STRINGS ${sdlmixer_h} sdlmixer_version_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
- string(REGEX MATCH ".([0-9]+)" sdlmixer_version "${sdlmixer_version_tmp}")
+include(${CMAKE_MODULE_PATH}/FindSDL_Extras.cmake)
- if(sdlmixer_version GREATER 9)
- message(STATUS "Enabling enhanced SDL_Mixer calls")
- set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn})
- endif()
-endif()
-
-find_file(sdlimage_h SDL_image.h ${SDLIMAGE_INCLUDE_DIR})
-if(sdlimage_h)
- file(STRINGS ${sdlimage_h} sdlimage_version_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
- string(REGEX MATCH ".([0-9]+)" sdlimage_version "${sdlimage_version_tmp}")
-
- if(sdlimage_version GREATER 7)
- message(STATUS "Enabling enhanced SDL_Image calls")
- set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn})
- endif()
-endif()
+configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
#SOURCE AND PROGRAMS SECTION
set(fpc_tryexe fpc)
@@ -154,8 +132,8 @@
if(fpc_ver 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!")
+ 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!")
endif()
else()
message(FATAL_ERROR "No Pascal compiler found!")
--- a/hedgewars/SDLh.pas Thu Mar 17 23:11:48 2011 +0100
+++ b/hedgewars/SDLh.pas Thu Mar 17 23:53:51 2011 +0100
@@ -184,6 +184,9 @@
SDL_WINDOWEVENT_FOCUS_GAINED = 11; //*< Window has gained keyboard focus
SDL_WINDOWEVENT_FOCUS_LOST = 12; //*< Window has lost keyboard focus
SDL_WINDOWEVENT_CLOSE = 13; //*< The window manager requests that the window be closed */
+
+ SDL_RENDERER_ACCELERATED = $00000001; //*< The renderer uses hardware acceleration
+ SDL_RENDERER_PRESENTVSYNC = $00000002; //*< Present is synchronized with the refresh rate
{$ELSE}
// SDL_Event types
SDL_NOEVENT = 0;
--- a/hedgewars/uStore.pas Thu Mar 17 23:11:48 2011 +0100
+++ b/hedgewars/uStore.pas Thu Mar 17 23:53:51 2011 +0100
@@ -930,7 +930,7 @@
y:= {$IFDEF IPHONEOS}(SDL_WINDOWPOS_CENTERED_MASK or (SDL_GetNumVideoDisplays() - 1)){$ELSE}0{$ENDIF};
SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN
{$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS {$ENDIF});
- SDLrender:= SDL_CreateRenderer(SDLwindow, -1, 1 and 2);
+ SDLrender:= SDL_CreateRenderer(SDLwindow, -1, SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC);
end;
SDL_SetRenderDrawColor(SDLrender, 0, 0, 0, 255);
--- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h Thu Mar 17 23:11:48 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h Thu Mar 17 23:53:51 2011 +0100
@@ -1,24 +1,23 @@
/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2011 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.
+ * 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 13/03/2011.
+ */
- 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
-*/
#import <UIKit/UIKit.h>
#import "SDL_uikitappdelegate.h"
--- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Thu Mar 17 23:11:48 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Thu Mar 17 23:53:51 2011 +0100
@@ -1,24 +1,23 @@
/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2011 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.
+ * 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 13/03/2011.
+ */
- 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, mods for Hedgewars by Vittorio Giovara
- slouken@libsdl.org, vittorio.giovara@gmail.com
-*/
#import "HedgewarsAppDelegate.h"
#import "PascalImports.h"