# HG changeset patch # User Medo # Date 1337805997 -7200 # Node ID 9fe1c4091dd1ef36b1e2fd0368a207a6578c2ab6 # Parent c91d33837b0de6670bfdf932b2218737bdd19763# Parent ce5e70fe4eb3ea1e8289459f93c7d64c4d897059 Merge diff -r c91d33837b0d -r 9fe1c4091dd1 CMakeLists.txt --- a/CMakeLists.txt Tue May 22 11:19:32 2012 +0200 +++ b/CMakeLists.txt Wed May 23 22:46:37 2012 +0200 @@ -70,9 +70,18 @@ #what system are we building for set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET}) - #detect on which system are we - EXEC_PROGRAM("/usr/bin/sw_vers" ARGS "-productVersion" OUTPUT_VARIABLE current_macosx_version) - STRING(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version}) + #detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version + find_program(sw_vers sw_vers) + if(sw_vers) + exec_program(${sw_vers} ARGS "-productVersion" OUTPUT_VARIABLE current_macosx_version) + string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version}) + else() + if(NOT minimum_macosx_version) + message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set") + else() + set(current_macosx_version ${minimum_macosx_version}) + endif() + endif() #if nothing is set, we deploy only for the current system if(NOT minimum_macosx_version) @@ -84,7 +93,16 @@ message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4") endif() - #this variable needs to be set for freepascal universal binary + #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*") @@ -97,33 +115,23 @@ endif() endif() - #be sure to select ppc-compatible toolchains just in case - if(minimum_macosx_version LESS "10.6") - set(CMAKE_C_COMPILER "gcc-4.0") - set(CMAKE_CXX_COMPILER "g++-4.0") + #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() - if(minimum_macosx_version MATCHES "10.4") - set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/") - #workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2) - if(current_macosx_version MATCHES "10.4") - find_package(SDL_mixer REQUIRED) - set(pascal_compiler_flags_cmn "-k-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg" "-k-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod" ${pascal_compiler_flags_cmn}) - set(CMAKE_C_FLAGS "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg -dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod") - endif() - else() - STRING(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version}) - set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/") - endif() - - #add user framework directory - set(pascal_compiler_flags_cmn "-Ff~/Library/Frameworks" ${pascal_compiler_flags_cmn}) + #add user framework directory, other paths can be passed via FPFLAGS + set(pascal_flags "-Ff~/Library/Frameworks" ${pascal_flags}) #set deployment target - set(pascal_compiler_flags_cmn "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_compiler_flags_cmn}) - #link with libsdlmain.a (when building an executable) - if(NOT BUILD_ENGINE_LIBRARY) - set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/libSDLmain.a" ${pascal_compiler_flags_cmn}) - endif() + 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}") @@ -152,17 +160,18 @@ set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) -separate_arguments(FPFLAGSINT UNIX_COMMAND ${FPFLAGS}) -set(pascal_compiler_flags_cmn ${FPFLAGSINT} "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_compiler_flags_cmn}) -set(haskell_compiler_flags_cmn "-O2" ${haskell_compiler_flags_cmn}) +separate_arguments(fpflags_full UNIX_COMMAND ${FPFLAGS}) +set(pascal_flags ${fpflags_full} "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_flags}) +separate_arguments(ghflags_full UNIX_COMMAND ${GHFLAGS}) +set(haskell_flags "-O2" ${haskell_flags} ${ghflags_full}) if(Optz) -# set(pascal_compiler_flags_cmn "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) - set(pascal_compiler_flags_cmn "-Os" "-Ooregvar" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) - set(haskell_compiler_flags_cmn "-w" "-fno-warn-unused-do-bind" ${haskell_compiler_flags_cmn}) +# 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_compiler_flags_cmn "-O-" "-g" "-gl" "-gv" "-Ct" "-dDEBUGFILE" ${pascal_compiler_flags_cmn}) - set(haskell_compiler_flags_cmn "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind" ${haskell_compiler_flags_cmn}) + 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}) endif(Optz) @@ -175,7 +184,11 @@ if(WITH_SERVER) - find_program(ghc_executable ghc) + if(GHC) + set(ghc_executable ${GHC}) + else() + find_program(ghc_executable ghc) + endif() if(ghc_executable) set(HAVE_NETSERVER true) @@ -192,12 +205,12 @@ if(NOT ${LUA_FOUND}) message(STATUS "Lua library not found, building bundled dependency") add_subdirectory(misc/liblua) - #link with liblua.a (which requires readline) - set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_compiler_flags_cmn}) + #link with liblua.a (which requires system readline) + set(pascal_flags "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_flags}) endif() add_subdirectory(hedgewars) -#run cmake -DBUILD_ANDROID_PORT=1 to enable this +#run cmake -DANDROID=1 to enable this if(ANDROID) add_subdirectory(project_files/Android-build) endif() diff -r c91d33837b0d -r 9fe1c4091dd1 gameServer/Actions.hs --- a/gameServer/Actions.hs Tue May 22 11:19:32 2012 +0200 +++ b/gameServer/Actions.hs Wed May 23 22:46:37 2012 +0200 @@ -332,8 +332,9 @@ AnswerClients chans ["EM", rmTeamMsg], ModifyRoom (\r -> r{ gameInfo = liftM (\g -> g{ - teamsInGameNumber = teamsInGameNumber g - 1, - roundMsgs = roundMsgs g Seq.|> rmTeamMsg + teamsInGameNumber = teamsInGameNumber g - 1 + , roundMsgs = roundMsgs g Seq.|> rmTeamMsg + , leftTeams = teamName : leftTeams g }) $ gameInfo r }) ] @@ -354,18 +355,13 @@ chans <- othersChans if not $ inGame then mapM_ processAction [ - AnswerClients chans ["REMOVE_TEAM", teamName], ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) + , AnswerClients chans ["REMOVE_TEAM", teamName] ] else mapM_ processAction [ - SendTeamRemovalMessage teamName, - ModifyRoom (\r -> r{ - teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r, - gameInfo = liftM (\g -> g{ - leftTeams = teamName : leftTeams g - }) $ gameInfo r - }) + ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) + , SendTeamRemovalMessage teamName ] diff -r c91d33837b0d -r 9fe1c4091dd1 gameServer/CMakeLists.txt --- a/gameServer/CMakeLists.txt Tue May 22 11:19:32 2012 +0200 +++ b/gameServer/CMakeLists.txt Wed May 23 22:46:37 2012 +0200 @@ -1,8 +1,3 @@ -find_program(ghc_executable ghc) - -if(NOT ghc_executable) - message(FATAL_ERROR "Cannot find GHC") -endif(NOT ghc_executable) set(hwserver_sources @@ -35,9 +30,8 @@ -i${hedgewars_SOURCE_DIR}/gameServer -o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX} -odir ${CMAKE_CURRENT_BINARY_DIR} - -hidir ${CMAKE_CURRENT_BINARY_DIR}) - -set(ghc_flags ${haskell_compiler_flags_cmn} ${ghc_flags}) + -hidir ${CMAKE_CURRENT_BINARY_DIR} + ${haskell_flags}) add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" COMMAND "${ghc_executable}" diff -r c91d33837b0d -r 9fe1c4091dd1 hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Tue May 22 11:19:32 2012 +0200 +++ b/hedgewars/CMakeLists.txt Wed May 23 22:46:37 2012 +0200 @@ -72,17 +72,16 @@ if(BUILD_ENGINE_LIBRARY) message(STATUS "Engine will be built as library (experimental)") set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas) - set(engine_sources ${hwengine_project} PascalExports.pas ${engine_sources}) - set(pascal_compiler_flags_cmn "-dHWLIBRARY" ${pascal_compiler_flags_cmn}) + set(pascal_flags "-dHWLIBRARY" ${pascal_flags}) # create position independent code, only required for x68_64 builds, similar to -fPIC if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(pascal_compiler_flags_cmn "-Cg" ${pascal_compiler_flags_cmn}) + set(pascal_flags "-Cg" ${pascal_flags}) endif(CMAKE_SIZEOF_VOID_P MATCHES "8") - # due to compiling/linker issues on Max OS X 10.6 -k-no_order_inits is needed to avoid linking fail + # due to compiler/linker issues on Max OS X 10.6 -k-no_order_inits is needed to avoid linking fail if(APPLE AND current_macosx_version GREATER "10.5") - set(pascal_compiler_flags_cmn "-k-no_order_inits" ${pascal_compiler_flags_cmn}) + set(pascal_flags "-k-no_order_inits" ${pascal_flags}) endif() if (APPLE) @@ -122,6 +121,27 @@ if(powerpc_build) set(powerpc_build "powerpc") endif() + + #on OSX we need to provide the main() function when building as executable + if(NOT BUILD_ENGINE_LIBRARY) + #let's look for the bundled sdlmain, if not found build our own + find_package(SDL REQUIRED) + #remove the ";-framework Cocoa" from the SDL_LIBRARY variable + string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") + #find libsdmain.a + find_file(SDLMAIN_LIB libSDLMain.a PATHS ${sdl_dir}/Resources/) + + if(SDLMAIN_LIB MATCHES "SDLMAIN_LIB-NOTFOUND") + set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) + include_directories(${SDL_INCLUDE_DIR}) + add_library (SDLmain STATIC SDLMain.m) + #add a dependency to the hwengine target + set(engine_sources ${engine_sources} SDLmain) + set(SDLMAIN_LIB "${CMAKE_BINARY_DIR}/bin/libSDLmain.a") + endif() + + set(pascal_flags "-k${SDLMAIN_LIB}" ${pascal_flags}) + endif() endif(APPLE) @@ -133,11 +153,11 @@ string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}") string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}") message(STATUS "Freepascal version installed: ${fpc_vers_major}.${fpc_vers_minor}") - math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}") + math(EXPR fpc_version "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}") - if(fpc_ver LESS "020200") + if(fpc_version LESS "020200") message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0") - elseif(APPLE AND (fpc_ver LESS "020600")) + elseif(APPLE AND (fpc_version LESS "020600")) message(FATAL_ERROR "Minimum required version of FreePascal is 2.6.0 on Mac OS X") endif() else() @@ -146,48 +166,40 @@ #DEPENDECIES AND EXECUTABLES SECTION -find_package(PNG) -if(${PNG_FOUND}) - message(STATUS "PNG screenshots enabled (library found at ${PNG_LIBRARY})") - set(pascal_compiler_flags_cmn "-dPNG_SCREENSHOTS" ${pascal_compiler_flags_cmn}) - if(APPLE) # need to explictly link with the static lib - string(REGEX REPLACE "(.*)libpng.*" "\\1" PNG_LIBDIR "${PNG_LIBRARY}") - set(pascal_compiler_flags_cmn "-k${PNG_LIBDIR}/libpng.a" ${pascal_compiler_flags_cmn}) +if(NOT NOPNG) + find_package(PNG) + 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 + 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 library not found, switching to screenshots in BMP format") endif() -set(pascal_compiler ${fpc_executable}) -set(pascal_compiler_flags ${noexecstack_flags} ${pascal_compiler_flags_cmn} ${hwengine_project}) +set(fpc_flags ${noexecstack_flags} ${pascal_flags} ${hwengine_project}) IF(NOT APPLE) #here is the command for standard executables or for shared library add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" - COMMAND "${pascal_compiler}" - ARGS ${pascal_compiler_flags} + COMMAND "${fpc_executable}" + ARGS ${fpc_flags} MAIN_DEPENDENCY ${hwengine_project} DEPENDS ${engine_sources} ) ELSE() - #let's build sdlmain, which is absent from the framework - find_package(SDL REQUIRED) - - set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) - include_directories(${SDL_INCLUDE_DIR}) - - add_library (SDLmain STATIC SDLMain.m) - - #these are the dependencies for building a universal binary on Mac OS X foreach (build_arch ${powerpc_build} ${i386_build} ${x86_64_build}) set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}" ${lipo_args_list}) add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}" - COMMAND "${pascal_compiler}" - ARGS ${pascal_compiler_flags} -ohwengine.${build_arch} -P${build_arch} + COMMAND "${fpc_executable}" + ARGS ${fpc_flags} -ohwengine.${build_arch} -P${build_arch} MAIN_DEPENDENCY ${hwengine_project} - DEPENDS ${engine_sources} SDLmain + DEPENDS ${engine_sources} ) add_custom_target(hwengine.${build_arch} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}") endforeach() diff -r c91d33837b0d -r 9fe1c4091dd1 hedgewars/uChat.pas --- a/hedgewars/uChat.pas Tue May 22 11:19:32 2012 +0200 +++ b/hedgewars/uChat.pas Wed May 23 22:46:37 2012 +0200 @@ -277,7 +277,6 @@ var i, btw: integer; utf8: shortstring; begin - if Key <> 0 then case Key of {Backspace} @@ -293,6 +292,7 @@ FreezeEnterKey; SDL_EnableKeyRepeat(0,0); GameState:= gsGame; + ResetKbd; end; {Return} 3, 13, 271: begin @@ -304,6 +304,7 @@ FreezeEnterKey; SDL_EnableKeyRepeat(0,0); GameState:= gsGame; + ResetKbd; end; else if (Key < $80) then diff -r c91d33837b0d -r 9fe1c4091dd1 hedgewars/uInputHandler.pas --- a/hedgewars/uInputHandler.pas Tue May 22 11:19:32 2012 +0200 +++ b/hedgewars/uInputHandler.pas Wed May 23 22:46:37 2012 +0200 @@ -45,7 +45,7 @@ implementation uses uConsole, uCommands, uMisc, uVariables, uConsts, uUtils, uDebug; -var tkbd, tkbdn: TKeyboardState; +var tkbd: TKeyboardState; quitKeyCode: Byte; KeyNames: array [0..cKeyMaxIndex] of string[15]; CurrentBinds: TBinds; @@ -69,29 +69,30 @@ and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0); -tkbdn[code]:= ord(KeyDown); +tkbd[code]:= ord(KeyDown); // ctrl/cmd + q to close engine and frontend if(KeyDown and (code = quitKeyCode)) then begin {$IFDEF DARWIN} - if ((tkbdn[KeyNameToCode('left_meta')] = 1) or (tkbdn[KeyNameToCode('right_meta')] = 1)) then + if ((tkbd[KeyNameToCode('left_meta')] = 1) or (tkbd[KeyNameToCode('right_meta')] = 1)) then {$ELSE} - if ((tkbdn[KeyNameToCode('left_ctrl')] = 1) or (tkbdn[KeyNameToCode('right_ctrl')] = 1)) then + if ((tkbd[KeyNameToCode('left_ctrl')] = 1) or (tkbd[KeyNameToCode('right_ctrl')] = 1)) then {$ENDIF} ParseCommand('halt', true); end; if CurrentBinds[code][0] <> #0 then begin - if (code > 3) and (tkbdn[code] <> 0) and not ((CurrentBinds[code] = 'put') or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true; - if (tkbd[code] = 0) and (tkbdn[code] <> 0) then + if (code > 3) and (KeyDown) and not ((CurrentBinds[code] = 'put') or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true; + + if (KeyDown) then begin ParseCommand(CurrentBinds[code], Trusted); if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then ParseCommand('gencmd R', true) end - else if (CurrentBinds[code][1] = '+') and (tkbdn[code] = 0) and (tkbd[code] <> 0) then + else if (CurrentBinds[code][1] = '+') and not KeyDown then begin s:= CurrentBinds[code]; s[1]:= '-'; @@ -99,7 +100,6 @@ if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then ParseCommand('gencmd R', true) end; - tkbd[code]:= tkbdn[code] end end; @@ -126,56 +126,11 @@ end; procedure ResetKbd; -var j, t: LongInt; - i: LongInt; - pkbd: PByteArray; +var t: LongInt; begin - -//k:= SDL_GetMouseState(nil, nil); -pkbd:=SDL_GetKeyState(@j); - -//TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + IntToStr(j) + ')', true); - -for i:= 1 to pred(j) do - tkbdn[i]:= pkbd^[i]; - -(* -// TODO: reimplement -// Controller(s) -k:= j; // should we test k for hitting the limit? sounds rather unlikely to ever reach it -for j:= 0 to Pred(ControllerNumControllers) do - begin - for i:= 0 to Pred(ControllerNumAxes[j]) do - begin - if ControllerAxes[j][i] > 20000 then - tkbdn[k + 0]:= 1 - else - tkbdn[k + 0]:= 0; - if ControllerAxes[j][i] < -20000 then - tkbdn[k + 1]:= 1 - else - tkbdn[k + 1]:= 0; - inc(k, 2); - end; - for i:= 0 to Pred(ControllerNumHats[j]) do - begin - tkbdn[k + 0]:= ControllerHats[j][i] and SDL_HAT_UP; - tkbdn[k + 1]:= ControllerHats[j][i] and SDL_HAT_RIGHT; - tkbdn[k + 2]:= ControllerHats[j][i] and SDL_HAT_DOWN; - tkbdn[k + 3]:= ControllerHats[j][i] and SDL_HAT_LEFT; - inc(k, 4); - end; - for i:= 0 to Pred(ControllerNumButtons[j]) do - begin - tkbdn[k]:= ControllerButtons[j][i]; - inc(k, 1); - end; - end; -*) - -// what is this final loop for? for t:= 0 to cKeyMaxIndex do - tkbd[t]:= tkbdn[t] + if(tkbd[t] <> 0) then + ProcessKey(t, False); end; procedure InitKbdKeyTable; diff -r c91d33837b0d -r 9fe1c4091dd1 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Tue May 22 11:19:32 2012 +0200 +++ b/hedgewars/uStore.pas Wed May 23 22:46:37 2012 +0200 @@ -1128,7 +1128,7 @@ begin RegisterVariable('fullscr', @chFullScr, true); - cScaleFactor:= 0; + cScaleFactor:= 2.0; Step:= 0; ProgrTex:= nil; SupportNPOTT:= false; diff -r c91d33837b0d -r 9fe1c4091dd1 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Tue May 22 11:19:32 2012 +0200 +++ b/hedgewars/uTeams.pas Wed May 23 22:46:37 2012 +0200 @@ -580,12 +580,13 @@ exit; with TeamsArray[t]^ do - begin - AddChatString('** '+ TeamName + ' is gone'); - hasGone:= true - end; + if not hasGone then + begin + AddChatString('** '+ TeamName + ' is gone'); + hasGone:= true; -RecountTeamHealth(TeamsArray[t]) + RecountTeamHealth(TeamsArray[t]) + end; end; diff -r c91d33837b0d -r 9fe1c4091dd1 project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt --- a/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt Tue May 22 11:19:32 2012 +0200 +++ b/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt Wed May 23 22:46:37 2012 +0200 @@ -53,9 +53,10 @@ 00:50=Drill Strike 00:51=Mudball 00:52=No weapon selected -00:53=TARDIS +00:53=TimeBox 00:54=Structure 00:55=Land Spray +00:56=Freezer 01:00=Let's fight! 01:01=Round draw @@ -448,6 +449,7 @@ 03:52=UNUSED 03:53=Type 40 03:54=Build something +03:55=Utility ; Weapon Descriptions (use | as line breaks) 04:00=Attack your enemies using a simple grenade.|It will explode once its timer reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power @@ -491,7 +493,7 @@ 04:38=The sniper rifle can be the most devastating weapon|in your whole arsenal, however it's very ineffective|at close quarters. The damage dealt increases with|the distance to its target.|Attack: Shoot (twice) 04:39=Fly to other parts of the map using the flying|saucer. This hard to master utility is able to|take you to almost any position on the battlefield.|Attack: Activate|Up/Left/Right: Apply force in one direction|Long Jump: Drop grenades or similar weapons 04:40=Set some ground on fire using this bottle filled|with (soon to be) burning liquid.|Attack: Hold to shoot with more power -04:41=The evidence nature might even top the flying|saucer. Birdy can carry your hog around and|drop eggs on your enemies!|Attack: Activate and drop eggs|Up/Left/Right: Flap in one direction +04:41=The evidence nature might even top the flying|saucer. Birdy can carry your hog around and|drop eggs on your enemies!|Be quick, as using Birdy eats into your turn|time!|Attack: Activate and drop eggs|Up/Left/Right: Flap in one direction 04:42=This portable portal device is capable|of instantly transporting you, your enemies,|or your weaponry between two points on the|terrain.|Use it wisely and your campaign will be a...|HUGE SUCCESS!|Attack: Shoot a portal|Switch: Cycle portal colours 04:43=Make your musical debut an explosive success!|Drop a piano from the heavens, but beware...|someone needs to play it, and that may cost you|your life!|Cursor: Select target region|F1-F9: Play the piano 04:44=This isn't just cheese, it's biological warfare!|It won't cause an huge amount of damage once|the timer reaches zero but it will definitely|poison anyone unlucky to touch the smell!|1-5: Set grenade's timer|Attack: Hold to throw with more power @@ -500,6 +502,12 @@ 04:47=Double the fun with two spiky, sneaky, sticky mines.|Set up a chain reaction or defend yourself (or both!)|Attack: Hold to shoot with more power (twice) 04:48=Why should the moles get all the abuse?|Wacking a hog can be just as fun! A good|blow from this hammer will shave off one|third of a hog's health and plunge them|underground.|Attack: Activate 04:49=Resurrect your friends!|But beware that this also resurrects your foes.|Attack: Keep attack pressed to resurrect slowly|Up: Accelerate resurrection +04:50=Is someone hiding underground?|Dig them out with a drill strike!|Timer controls how far it will dig. +04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back. +04:52=UNUSED +04:53=Go on an adventure through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King. +04:54=INCOMPLETE +04:55=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you! ; Game goal strings 05:00=Game Modes diff -r c91d33837b0d -r 9fe1c4091dd1 project_files/Android-build/Templates/Makefile.android --- a/project_files/Android-build/Templates/Makefile.android Tue May 22 11:19:32 2012 +0200 +++ b/project_files/Android-build/Templates/Makefile.android Wed May 23 22:46:37 2012 +0200 @@ -14,7 +14,7 @@ #LINKERFLAGS= -k"--static" FPC_DEFINES=-dandroid -darm -all: install +all: install/debug build: -${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/out diff -r c91d33837b0d -r 9fe1c4091dd1 tools/CMakeLists.txt --- a/tools/CMakeLists.txt Tue May 22 11:19:32 2012 +0200 +++ b/tools/CMakeLists.txt Wed May 23 22:46:37 2012 +0200 @@ -32,11 +32,11 @@ string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") #this tool is present in qt 4.5 but only if you compile from sources; from qt 4.6 is present also in the binary version - find_program(macdeployqt_EXE NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin) - if(NOT macdeployqt_EXE) + find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin) + if(NOT macdeployqt_executable) message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})") else() - message(STATUS "macdeployqt found in ${macdeployqt_EXE}") + message(STATUS "macdeployqt found in ${macdeployqt_executable}") endif() #dummy target, we're interested in the postscript file diff -r c91d33837b0d -r 9fe1c4091dd1 tools/CreateMacBundle.cmake.in --- a/tools/CreateMacBundle.cmake.in Tue May 22 11:19:32 2012 +0200 +++ b/tools/CreateMacBundle.cmake.in Wed May 23 22:46:37 2012 +0200 @@ -3,7 +3,7 @@ execute_process(COMMAND ls ${frameworks_dir} RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET) execute_process(COMMAND mkdir -p ${frameworks_dir}) -execute_process(COMMAND ${macdeployqt_EXE} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET) +execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET) if(doBundle EQUAL 1) execute_process(COMMAND cp -pPR ${sdl_dir} ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL.framework)