# HG changeset patch # User koda # Date 1316988194 -7200 # Node ID cac1d5601d7cd549554d5ab2b0581ef03d6e396d # Parent a28be05b20bc35504c2f27190faa46ce2d21785a reviewed the build system and parts of the previous merge, performed some code cleanup diff -r a28be05b20bc -r cac1d5601d7c CMakeLists.txt --- a/CMakeLists.txt Sun Sep 25 18:24:01 2011 +0200 +++ b/CMakeLists.txt Mon Sep 26 00:03:14 2011 +0200 @@ -192,8 +192,10 @@ add_subdirectory(misc/liblua) add_subdirectory(hedgewars) -#Xeli: Should if/endif this one too? -add_subdirectory(project_files/Android-build) +#run cmake -DBUILD_ANDROID_PORT=1 to enable this +if(BUILD_ANDROID_PORT) + add_subdirectory(project_files/Android-build) +endif() if(NOT BUILD_ENGINE_LIBRARY) add_subdirectory(bin) @@ -267,7 +269,7 @@ "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/liblua" # "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libtremor" "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/HedgewarsMobile/" "^${CMAKE_CURRENT_SOURCE_DIR}/bin/[a-z]" diff -r a28be05b20bc -r cac1d5601d7c QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Sun Sep 25 18:24:01 2011 +0200 +++ b/QTfrontend/CMakeLists.txt Mon Sep 26 00:03:14 2011 +0200 @@ -1,5 +1,6 @@ # Configure for Qt4 set(QT_MIN_VERSION "4.5.0") +include(CheckLibraryExists) set(QT_USE_QTCORE TRUE) set(QT_USE_QTGUI TRUE) diff -r a28be05b20bc -r cac1d5601d7c hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/CMakeLists.txt Mon Sep 26 00:03:14 2011 +0200 @@ -183,8 +183,10 @@ add_custom_target(${engine_output_name} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}") -add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars") -add_dependencies(${engine_output_name} ENGINECLEAN) +IF(NOT APPLE) + add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars") + add_dependencies(${engine_output_name} ENGINECLEAN) +ENDIF() install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) diff -r a28be05b20bc -r cac1d5601d7c hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/SDLh.pas Mon Sep 26 00:03:14 2011 +0200 @@ -83,19 +83,11 @@ SDL_ImageLibName = 'SDL_image'; SDL_NetLibName = 'SDL_net'; {$ELSE} - {$IFDEF ANDROID} - SDLLibName = 'SDL'; - SDL_TTFLibName = 'libSDL_ttf.so'; - SDL_MixerLibName = 'libSDL_mixer.so'; - SDL_ImageLibName = 'libSDL_image.so'; - SDL_NetLibName = 'libSDL_net.so'; - {$ELSE} - SDLLibName = 'SDL'; - SDL_TTFLibName = 'libSDL_ttf.so'; - SDL_MixerLibName = 'libSDL_mixer.so'; - SDL_ImageLibName = 'libSDL_image.so'; - SDL_NetLibName = 'libSDL_net.so'; - {$ENDIF} + SDLLibName = 'SDL'; + SDL_TTFLibName = 'libSDL_ttf.so'; + SDL_MixerLibName = 'libSDL_mixer.so'; + SDL_ImageLibName = 'libSDL_image.so'; + SDL_NetLibName = 'libSDL_net.so'; {$ENDIF} {$ENDIF} diff -r a28be05b20bc -r cac1d5601d7c hedgewars/hwLibrary.pas --- a/hedgewars/hwLibrary.pas Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/hwLibrary.pas Mon Sep 26 00:03:14 2011 +0200 @@ -18,14 +18,6 @@ Library hwLibrary; -{$IFDEF fpc} -{$MODE delphi} -{$ENDIF} - -{$IFDEF ANDROID} - {$MACRO ON} - {$DEFINE Java_Prefix := 'Java_org_hedgewars_mobile_EngineProtocol_PascalExports_'} -{$ENDIF} // 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 @@ -33,8 +25,8 @@ // these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group) // to make these functions available in the C/C++/Objective-C source files // (add "#include PascalImports.h" near the top of these files if it's not there yet) -uses PascalExports, hwengine{$IFDEF ANDROID},jni{$ENDIF}; -exports Game{$IFNDEF ANDROID}, HW_versionInfo{$ENDIF}; +uses PascalExports, hwengine{$IFDEF ANDROID}, jni{$ENDIF}; +exports Game, HW_versionInfo; function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; begin @@ -48,7 +40,7 @@ {$IFDEF ANDROID} - exports +exports JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', GenLandPreview name Java_Prefix + 'GenLandPreview', diff -r a28be05b20bc -r cac1d5601d7c hedgewars/options.inc --- a/hedgewars/options.inc Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/options.inc Mon Sep 26 00:03:14 2011 +0200 @@ -28,12 +28,13 @@ {$DEFINE GLunit:=GL} {$IFDEF ANDROID} + {$MODE delphi} {$DEFINE SDL13} {$DEFINE HWLIBRARY} {$DEFINE S3D_DISABLED} {$DEFINE GLunit:=gles11} - {$DEFINE DEBUGFILE} {$DEFINE MOBILE} + {$DEFINE Java_Prefix := 'Java_org_hedgewars_mobile_EngineProtocol_PascalExports_'} {$ENDIF} {$IFDEF IPHONEOS} @@ -42,10 +43,10 @@ {$DEFINE S3D_DISABLED} {$DEFINE GLunit:=gles11} {$DEFINE MOBILE} +{$ELSE} + {$DEFINE DEBUGFILE} + //{$DEFINE TRACEAIACTIONS} + //{$DEFINE COUNTTICKS} {$ENDIF} -{$DEFINE DEBUGFILE} -//{$DEFINE TRACEAIACTIONS} -//{$DEFINE COUNTTICKS} - //also available LUA_DISABLED diff -r a28be05b20bc -r cac1d5601d7c hedgewars/uAI.pas --- a/hedgewars/uAI.pas Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/uAI.pas Mon Sep 26 00:03:14 2011 +0200 @@ -31,7 +31,7 @@ implementation uses uConsts, SDLh, uAIMisc, uAIAmmoTests, uAIActions, uAmmos, SysUtils{$IFDEF UNIX}{$IFNDEF ANDROID}, cthreads{$ENDIF}{$ENDIF}, uTypes, - uVariables, uCommands, uUtils, uDebug, uConsole; + uVariables, uCommands, uUtils, uDebug; var BestActions: TActions; CanUseAmmo: array [TAmmoType] of boolean; @@ -353,6 +353,7 @@ procedure initModule; begin hasThread:= 0; + ThinkThread:= ThinkThread; end; procedure freeModule; diff -r a28be05b20bc -r cac1d5601d7c hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/uLand.pas Mon Sep 26 00:03:14 2011 +0200 @@ -1414,7 +1414,10 @@ if digest = '' then digest:= s else -// TryDo(s = digest, 'Different maps generated, sorry', true); +{$IFNDEF ANDROID} +{TODO: Xeli can you re-enable this? it is a very important check} + TryDo(s = digest, 'Different maps generated, sorry', true); +{$ENDIF} end; procedure chSendLandDigest(var s: shortstring); diff -r a28be05b20bc -r cac1d5601d7c hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/uStore.pas Mon Sep 26 00:03:14 2011 +0200 @@ -290,7 +290,7 @@ ((vobCount > 0) or (ii <> sprFlake)) then begin if AltPath = ptNone then - if ii in [sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR, sprChunk] then // FIXME: hack + if ii in [sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR, sprChunk, sprFireButton] then // FIXME: hack begin if not reload then begin diff -r a28be05b20bc -r cac1d5601d7c hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Sun Sep 25 18:24:01 2011 +0200 +++ b/hedgewars/uTypes.pas Mon Sep 26 00:03:14 2011 +0200 @@ -82,7 +82,8 @@ sprSMineOff, sprSMineOn, sprHandSMine, sprHammer, sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb, sprBulletHit, sprSnowball, sprHandSnowball, sprSnow, - sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis, sprFireButton + sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis, + sprFireButton ); // Gears that interact with other Gears and/or Land