# HG changeset patch # User sheepluva # Date 1441902172 -7200 # Node ID 5c40c65b619dae2175d0ac98d58b62f0cdc5d2df # Parent 1fb80cd8ba7baee2a2ead728cfe4d15038daa5ba# Parent 877de65e0e13534f593db1aab7e8c506960aa51f merge branch ios-revival into default diff -r 1fb80cd8ba7b -r 5c40c65b619d .hgignore --- a/.hgignore Thu Sep 10 04:59:02 2015 +0200 +++ b/.hgignore Thu Sep 10 18:22:52 2015 +0200 @@ -26,7 +26,7 @@ glob:*.diff glob:vittorio.* glob:project_files/HedgewarsMobile/Data/ -glob:project_files/HedgewarsMobile/build/ +glob:project_files/HedgewarsMobile/Build/ glob:gameServer/dist/ glob:misc/liblua/Xcode/build/ glob:misc/libphysfs/Xcode/build/ @@ -70,3 +70,13 @@ glob:share/Info.plist glob:CTestTestfile.cmake glob:arch.c +glob:*.swp +glob:*~.nib +glob:*.pbxuser +glob:*.perspective +glob:*.perspectivev3 +glob:*.project.xcworkspace +glob:*.xcuserdata +glob:xcuserdata +glob:*.mode1v3 +glob:*.mode2v3 diff -r 1fb80cd8ba7b -r 5c40c65b619d .hgtags --- a/.hgtags Thu Sep 10 04:59:02 2015 +0200 +++ b/.hgtags Thu Sep 10 18:22:52 2015 +0200 @@ -63,3 +63,4 @@ af0520a6bf0061b27f8321514d35fcd2b1ef5f9c 0.9.20-release 7e55468ffe384a3065524c483eb5e3cdb1658fd5 0.9.21-release 7e55468ffe384a3065524c483eb5e3cdb1658fd5 fab746a3597e +0f5961910e2712582b162abd08ae3eed330cc978 Nice one diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/ArgParsers.pas --- a/hedgewars/ArgParsers.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/ArgParsers.pas Thu Sep 10 18:22:52 2015 +0200 @@ -335,7 +335,7 @@ //var tmpInt: LongInt; begin - paramIndex:= 1; + paramIndex:= {$IFDEF HWLIBRARY}0{$ELSE}1{$ENDIF}; paramTotal:= ParamCount; //-1 because pascal enumeration is inclusive (* WriteLn(stdout, 'total parameters: ' + inttostr(paramTotal)); diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/SDLh.pas Thu Sep 10 18:22:52 2015 +0200 @@ -63,11 +63,19 @@ SDL_ImageLibName = 'SDL_image.dll'; SDL_NetLibName = 'SDL_net.dll'; {$ELSE} - SDLLibName = 'libSDL'; - SDL_TTFLibName = 'libSDL_ttf'; - SDL_MixerLibName = 'libSDL_mixer'; - SDL_ImageLibName = 'libSDL_image'; - SDL_NetLibName = 'libSDL_net'; + {$IFDEF SDL2} + SDLLibName = 'libSDL2'; + SDL_TTFLibName = 'libSDL2_ttf'; + SDL_MixerLibName = 'libSDL2_mixer'; + SDL_ImageLibName = 'libSDL2_image'; + SDL_NetLibName = 'libSDL2_net'; + {$ELSE} + SDLLibName = 'libSDL'; + SDL_TTFLibName = 'libSDL_ttf'; + SDL_MixerLibName = 'libSDL_mixer'; + SDL_ImageLibName = 'libSDL_image'; + SDL_NetLibName = 'libSDL_net'; + {$ENDIF} {$ENDIF} ///////////////////////////////////////////////////////////////// diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/hwLibrary.pas diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/hwengine.pas Thu Sep 10 18:22:52 2015 +0200 @@ -29,7 +29,7 @@ program hwengine; {$ENDIF} -uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler +uses {$IFDEF IPHONEOS}cmem, {$ENDIF} SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender @@ -541,7 +541,11 @@ /////////////////////////////////////////////////////////////////////////////// procedure GenLandPreview; +{$IFDEF MOBILE} +var Preview: TPreview; +{$ELSE} var Preview: TPreviewAlpha; +{$ENDIF MOBILE} begin initEverything(false); @@ -550,7 +554,11 @@ TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); ScriptOnPreviewInit; +{$IFDEF MOBILE} + GenPreview(Preview); +{$ELSE} GenPreviewAlpha(Preview); +{$ENDIF MOBILE} WriteLnToConsole('Sending preview...'); SendIPCRaw(@Preview, sizeof(Preview)); SendIPCRaw(@MaxHedgehogs, sizeof(byte)); @@ -602,9 +610,13 @@ end; {$IFDEF PAS2C} - exit(HaltNoError); + exit(HaltNoError); {$ELSE} - halt(HaltNoError); + {$IFDEF IPHONEOS} + exit; + {$ELSE} + halt(HaltNoError); + {$ENDIF} {$ENDIF} {$IFDEF HWLIBRARY} end; diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uLocale.pas Thu Sep 10 18:22:52 2015 +0200 @@ -30,7 +30,7 @@ function GetEventString(e: TEventId): ansistring; {$IFDEF HWLIBRARY} -procedure LoadLocaleWrapper(str: pchar); cdecl; export; +procedure LoadLocaleWrapper(path: pchar; filename: pchar); cdecl; export; {$ENDIF} implementation @@ -133,9 +133,17 @@ end; {$IFDEF HWLIBRARY} -procedure LoadLocaleWrapper(str: pchar); cdecl; export; +procedure LoadLocaleWrapper(path: pchar; filename: pchar); cdecl; export; begin - LoadLocale(Strpas(str)); + PathPrefix := Strpas(path); + + uUtils.initModule(false); + uPhysFSLayer.initModule; + + LoadLocale(Strpas(filename)); + + uPhysFSLayer.freeModule; + uUtils.freeModule; end; {$ENDIF} diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uPhysFSLayer.pas --- a/hedgewars/uPhysFSLayer.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uPhysFSLayer.pas Thu Sep 10 18:22:52 2015 +0200 @@ -151,7 +151,9 @@ procedure initModule; var i: LongInt; cPhysfsId: shortstring; +{$IFNDEF MOBILE} fp: PChar; +{$ENDIF MOBILE} begin {$IFDEF HWLIBRARY} //TODO: http://icculus.org/pipermail/physfs/2011-August/001006.html @@ -163,6 +165,7 @@ i:= PHYSFS_init(Str2PChar(cPhysfsId)); AddFileLog('[PhysFS] init: ' + inttostr(i)); +{$IFNDEF MOBILE} // mount system fonts paths first for i:= low(cFontsPaths) to high(cFontsPaths) do begin @@ -170,6 +173,7 @@ if fp <> nil then pfsMount(ansistring(fp), PChar('/Fonts')); end; +{$ENDIF MOBILE} pfsMountAtRoot(PathPrefix); pfsMountAtRoot(UserPathPrefix + ansistring('/Data')); diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uRender.pas --- a/hedgewars/uRender.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uRender.pas Thu Sep 10 18:22:52 2015 +0200 @@ -360,6 +360,7 @@ function glLoadExtension(extension : shortstring) : boolean; begin +(* //TODO: pas2c does not handle {$IF (GLunit = gles11) OR DEFINED(PAS2C)} {$IFNDEF PAS2C} {$IF GLunit = gles11} @@ -378,6 +379,11 @@ {$ELSE} // pas2c part glLoadExtension:= false; {$ENDIF} +*) + + extension:= extension; // avoid hint + glLoadExtension:= false; + AddFileLog('OpenGL - "' + extension + '" skipped') end; {$IFDEF USE_S3D_RENDERING OR USE_VIDEO_RECORDING} @@ -428,17 +434,6 @@ tmpint: LongInt; tmpn: LongInt; begin -{$IFDEF MOBILE} - // TODO: this function creates an opengles1.1 context - // un-comment below and add proper logic to support opengles2.0 - //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); - if SDLGLcontext = nil then - SDLGLcontext:= SDL_GL_CreateContext(SDLwindow); - SDLTry(SDLGLcontext <> nil, true); - SDL_GL_SetSwapInterval(1); -{$ENDIF} - // suppress hint/warning AuxBufNum:= AuxBufNum; diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uStore.pas --- a/hedgewars/uStore.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uStore.pas Thu Sep 10 18:22:52 2015 +0200 @@ -370,7 +370,11 @@ begin MakeCrossHairs; LoadGraves; +{$IFDEF IPHONEOS} + tmpHatSurf:= LoadDataImage(ptHats, 'chef', ifNone); +{$ELSE} tmpHatSurf:= LoadDataImage(ptHats, 'Reserved/chef', ifNone); +{$ENDIF} ChefHatTexture:= Surface2Tex(tmpHatSurf, true); freeTmpHatSurf(); end; @@ -719,6 +723,9 @@ {$IFDEF IPHONEOS} SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1); + + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); {$ELSE} SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); {$ENDIF} @@ -745,6 +752,17 @@ AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')'); {$ENDIF} +{$IFDEF MOBILE} + // TODO: this function creates an opengles1.1 context + // un-comment below and add proper logic to support opengles2.0 + //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); + //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); + if SDLGLcontext = nil then + SDLGLcontext:= SDL_GL_CreateContext(SDLwindow); + SDLTry(SDLGLcontext <> nil, true); + SDL_GL_SetSwapInterval(1); +{$ENDIF} + RendererSetup(); end; diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uTouch.pas --- a/hedgewars/uTouch.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uTouch.pas Thu Sep 10 18:22:52 2015 +0200 @@ -63,6 +63,7 @@ const clickTime = 200; + nilFingerId = High(TSDL_FingerId); baseRectSize = 96; var diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uVariables.pas Thu Sep 10 18:22:52 2015 +0200 @@ -21,7 +21,7 @@ unit uVariables; interface -uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils, uMatrix; +uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils{$IFDEF GL2}, uMatrix{$ENDIF}; var /////// init flags /////// @@ -418,13 +418,13 @@ {$IFDEF USE_TOUCH_INTERFACE} (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprFireButton - (FileName: 'arrowUp'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; + (FileName: 'arrowup'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowUp - (FileName: 'arrowDown'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; + (FileName: 'arrowdown'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowDown - (FileName: 'arrowLeft'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; + (FileName: 'arrowleft'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowLeft - (FileName: 'arrowRight'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; + (FileName: 'arrowright'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowRight (FileName: 'forwardjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprAMWidget @@ -2674,8 +2674,13 @@ vobSDVelocity:= 15; vobSDFallSpeed:= 250; +{$IFDEF MOBILE} + cMinScreenWidth := min(cScreenWidth, 480); + cMinScreenHeight := min(cScreenHeight, 320); +{$ELSE} cMinScreenWidth := min(cScreenWidth, 640); cMinScreenHeight := min(cScreenHeight, 480); +{$ENDIF} cNewScreenWidth := cScreenWidth; cNewScreenHeight := cScreenHeight; diff -r 1fb80cd8ba7b -r 5c40c65b619d hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu Sep 10 04:59:02 2015 +0200 +++ b/hedgewars/uWorld.pas Thu Sep 10 18:22:52 2015 +0200 @@ -1148,7 +1148,7 @@ procedure ShiftWorld(Dir: LongInt); inline; begin preShiftWorldDx:= WorldDx; - WorldDx:= WorldDx + Dir * LongInt(playWidth); + WorldDx:= WorldDx + LongInt(Dir * LongInt(playWidth)); end; diff -r 1fb80cd8ba7b -r 5c40c65b619d misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj --- a/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj Thu Sep 10 04:59:02 2015 +0200 +++ b/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj Thu Sep 10 18:22:52 2015 +0200 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -289,8 +289,11 @@ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + }; buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Lua" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -354,7 +357,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = NO; DSTROOT = /tmp/Lua.dst; GCC_DYNAMIC_NO_PIC = NO; @@ -365,6 +367,8 @@ GCC_PREFIX_HEADER = Lua_Prefix.pch; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = Lua; + SKIP_INSTALL = YES; + VALID_ARCHS = "armv7 x86_64 arm64"; }; name = Debug; }; @@ -372,49 +376,77 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; DSTROOT = /tmp/Lua.dst; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Lua_Prefix.pch; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = Lua; + SKIP_INSTALL = YES; + VALID_ARCHS = "armv7 x86_64 arm64"; }; name = Release; }; 1DEB922308733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Debug; }; 1DEB922408733DC00010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_FAST_MATH = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_LDFLAGS = "-ObjC"; PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Release; }; diff -r 1fb80cd8ba7b -r 5c40c65b619d misc/libphysfs/Xcode/Physfs.xcodeproj/project.pbxproj --- a/misc/libphysfs/Xcode/Physfs.xcodeproj/project.pbxproj Thu Sep 10 04:59:02 2015 +0200 +++ b/misc/libphysfs/Xcode/Physfs.xcodeproj/project.pbxproj Thu Sep 10 18:22:52 2015 +0200 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -178,8 +178,11 @@ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + }; buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Physfs" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -230,7 +233,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = NO; DSTROOT = /tmp/Physfs.dst; GCC_DYNAMIC_NO_PIC = NO; @@ -241,6 +243,7 @@ GCC_PREFIX_HEADER = Physfs_Prefix.pch; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = Physfs; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -248,13 +251,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; DSTROOT = /tmp/Physfs.dst; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Physfs_Prefix.pch; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = Physfs; + SKIP_INSTALL = YES; }; name = Release; }; @@ -262,20 +265,35 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../liblua\"", "\"$(SRCROOT)/../../../../Library/SDL/include\"", ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PREBINDING = NO; SDKROOT = iphoneos; + VALID_ARCHS = "armv7 x86_64 arm64"; }; name = Debug; }; @@ -283,19 +301,33 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../liblua\"", "\"$(SRCROOT)/../../../../Library/SDL/include\"", ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_LDFLAGS = "-ObjC"; PREBINDING = NO; SDKROOT = iphoneos; + VALID_ARCHS = "armv7 x86_64 arm64"; }; name = Release; }; diff -r 1fb80cd8ba7b -r 5c40c65b619d misc/libphyslayer/Xcode/Physlayer.xcodeproj/project.pbxproj --- a/misc/libphyslayer/Xcode/Physlayer.xcodeproj/project.pbxproj Thu Sep 10 04:59:02 2015 +0200 +++ b/misc/libphyslayer/Xcode/Physlayer.xcodeproj/project.pbxproj Thu Sep 10 18:22:52 2015 +0200 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -124,8 +124,11 @@ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + }; buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Physlayer" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -162,7 +165,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = NO; DSTROOT = /tmp/Physlayer.dst; GCC_DYNAMIC_NO_PIC = NO; @@ -173,6 +175,7 @@ GCC_PREFIX_HEADER = Physlayer_Prefix.pch; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = Physlayer; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -180,24 +183,69 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; DSTROOT = /tmp/Physlayer.dst; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Physlayer_Prefix.pch; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = Physlayer; + SKIP_INSTALL = YES; }; name = Release; }; 1DEB922308733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../libphysfs\"", + "\"$(SRCROOT)/../../liblua\"", + "\"$(SRCROOT)/../../../../Library/SDL/include\"", + ); + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; + PREBINDING = NO; + SDKROOT = iphoneos; + VALID_ARCHS = "armv7 x86_64 arm64"; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../libphysfs\"", @@ -207,25 +255,7 @@ OTHER_LDFLAGS = "-ObjC"; PREBINDING = NO; SDKROOT = iphoneos; - }; - name = Debug; - }; - 1DEB922408733DC00010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../libphysfs\"", - "\"$(SRCROOT)/../../liblua\"", - "\"$(SRCROOT)/../../../../Library/SDL/include\"", - ); - OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; - SDKROOT = iphoneos; + VALID_ARCHS = "armv7 x86_64 arm64"; }; name = Release; }; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/AboutViewController.m --- a/project_files/HedgewarsMobile/Classes/AboutViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -53,7 +53,7 @@ -(IBAction) buttonPressed:(id) sender { [[AudioManagerController mainManager] playBackSound]; - [[self parentViewController] dismissModalViewControllerAnimated:YES]; + [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; } -(IBAction) segmentedControlChanged:(id) sender { @@ -83,7 +83,8 @@ cell.textLabel.text = [[self.people objectAtIndex:self.segmentedControl.selectedSegmentIndex] objectAtIndex:[indexPath row]]; cell.textLabel.adjustsFontSizeToFitWidth = YES; cell.textLabel.minimumFontSize = 8; - cell.detailTextLabel.text = [[self.people objectAtIndex:(self.segmentedControl.selectedSegmentIndex + 5)] objectAtIndex:[indexPath row]]; + NSString *detailsKey = [[self.people objectAtIndex:(self.segmentedControl.selectedSegmentIndex + 5)] objectAtIndex:[indexPath row]]; + cell.detailTextLabel.text = NSLocalizedStringFromTable(detailsKey, @"About", nil); return cell; } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/Appirater.m --- a/project_files/HedgewarsMobile/Classes/Appirater.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/Appirater.m Thu Sep 10 18:22:52 2015 +0200 @@ -47,7 +47,7 @@ } -(void) appLaunchedHandler { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { if (APPIRATER_DEBUG) { [self performSelectorOnMainThread:@selector(showPrompt) withObject:nil waitUntilDone:NO]; @@ -82,11 +82,11 @@ double secondsUntilPrompt = 60 * 60 * 24 * DAYS_UNTIL_PROMPT; // get the launch count - int launchCount = [userDefaults integerForKey:kAppiraterLaunchCount]; + NSInteger launchCount = [userDefaults integerForKey:kAppiraterLaunchCount]; launchCount++; [userDefaults setInteger:launchCount forKey:kAppiraterLaunchCount]; if (APPIRATER_DEBUG) - NSLog(@"APPIRATER Launch count: %d", launchCount); + NSLog(@"APPIRATER Launch count: %ld", (long)launchCount); // have they previously declined to rate this version of the app? BOOL declinedToRate = [userDefaults boolForKey:kAppiraterDeclinedToRate]; @@ -116,7 +116,7 @@ if (!willShowPrompt) [self autorelease]; - [pool release]; + } } -(void) showPrompt { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m --- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Thu Sep 10 18:22:52 2015 +0200 @@ -96,8 +96,8 @@ for (int i = 0; i < numberOfPlayingHogs; i++) { NSDictionary *hog = [hogs objectAtIndex:i]; - NSString *hogLevelHealthAndName = [[NSString alloc] initWithFormat:@"eaddhh %@ %d %@", - [hog objectForKey:@"level"], initialHealth, [hog objectForKey:@"hogname"]]; + NSString *hogLevelHealthAndName = [[NSString alloc] initWithFormat:@"eaddhh %@ %ld %@", + [hog objectForKey:@"level"], (long)initialHealth, [hog objectForKey:@"hogname"]]; [self sendToEngine: hogLevelHealthAndName]; [hogLevelHealthAndName release]; @@ -214,7 +214,8 @@ // this is launched as thread and handles all IPC with engine -(void) engineProtocol:(id) object { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + NSDictionary *gameConfig = (NSDictionary *)object; NSMutableArray *statsArray = nil; TCPsocket sd; @@ -240,7 +241,7 @@ // Open a connection with the IP provided (listen on the host's port) if (!(sd = SDLNet_TCP_Open(&ip)) && !clientQuit) { - DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), self.enginePort); + DLog(@"SDLNet_TCP_Open: %s %d\n", SDLNet_GetError(), self.enginePort); clientQuit = YES; } @@ -403,8 +404,9 @@ [HWUtils freePort:self.enginePort]; SDLNet_TCP_Close(csd); SDLNet_Quit(); + + } - [pool release]; // Invoking this method should be avoided as it does not give your thread a chance // to clean up any resources it allocated during its execution. //[NSThread exit]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/ExtraCategories.h --- a/project_files/HedgewarsMobile/Classes/ExtraCategories.h Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.h Thu Sep 10 18:22:52 2015 +0200 @@ -50,6 +50,9 @@ -(id) initWithFrame:(CGRect) frame andTitle:(NSString *)title; +- (void)applyBlackQuickStyle; +- (void)applyDarkBlueQuickStyle; + @end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/ExtraCategories.m --- a/project_files/HedgewarsMobile/Classes/ExtraCategories.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.m Thu Sep 10 18:22:52 2015 +0200 @@ -27,17 +27,18 @@ -(CGFloat) safeScale { CGFloat theScale = 1.0f; - if ([self respondsToSelector:@selector(scale)]) - theScale = [self scale]; +// if ([self respondsToSelector:@selector(scale)]) +// theScale = [self scale]; return theScale; } -(CGRect) safeBounds { - CGRect original = [self bounds]; - if (IS_ON_PORTRAIT()) - return original; - else - return CGRectMake(original.origin.x, original.origin.y, original.size.height, original.size.width); + return [self bounds]; +// CGRect original = [self bounds]; +// if (IS_ON_PORTRAIT()) +// return original; +// else +// return CGRectMake(original.origin.x, original.origin.y, original.size.height, original.size.width); } @end @@ -99,17 +100,35 @@ -(id) initWithFrame:(CGRect) frame andTitle:(NSString *)title { [self initWithFrame:frame]; [self setTitle:title forState:UIControlStateNormal]; + [self applyBlackQuickStyle]; + + return self; +} + +- (void)applyBlackQuickStyle +{ [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; self.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]]; self.backgroundColor = [UIColor blackColorTransparent]; - - [self.layer setBorderWidth:1]; + + [self.layer setBorderWidth:1.0f]; [self.layer setBorderColor:[[UIColor darkYellowColor] CGColor]]; [self.layer setCornerRadius:9.0f]; [self.layer setMasksToBounds:YES]; +} - return self; +- (void)applyDarkBlueQuickStyle +{ + [self setTitleColor:[UIColor darkYellowColor] forState:UIControlStateNormal]; + [self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; + self.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]]; + self.backgroundColor = [UIColor darkBlueColorTransparent]; + + [self.layer setBorderWidth:2.0f]; + [self.layer setBorderColor:[[UIColor darkYellowColor] CGColor]]; + [self.layer setCornerRadius:9.0f]; + [self.layer setMasksToBounds:YES]; } @end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/FlagsViewController.m --- a/project_files/HedgewarsMobile/Classes/FlagsViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/FlagsViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -131,10 +131,10 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; - int newSection = [indexPath section]; - int oldSection = (lastIndexPath != nil) ? [lastIndexPath section] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newSection = [indexPath section]; + NSInteger oldSection = (lastIndexPath != nil) ? [lastIndexPath section] : -1; if (newRow != oldRow || newSection != oldSection) { NSString *flag = nil; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/FortsViewController.m --- a/project_files/HedgewarsMobile/Classes/FortsViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/FortsViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -106,8 +106,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; if (newRow != oldRow) { // if the two selected rows differ update data on the hog dictionary and reload table content diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/GameConfigViewController-iPad.xib --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPad.xib Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPad.xib Thu Sep 10 18:22:52 2015 +0200 @@ -1,34 +1,28 @@ - + - 1056 - 10K549 - 823 - 1038.36 - 461.00 + 1792 + 14E46 + 7706 + 1348.17 + 758.70 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 - - YES - - YES - - - YES - - - - YES + + IBProxyObject + IBUIButton + IBUIImageView + IBUISlider + IBUIView + IBUIViewController + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + IBFilesOwner IBIPadFramework @@ -38,10 +32,9 @@ IBIPadFramework - - 292 - - YES + + 256 + 274 @@ -66,7 +59,7 @@ IBIPadFramework NSImage - title~iphone.png + title.png @@ -79,19 +72,14 @@ IBIPadFramework 0 0 - - Helvetica-Bold - 15 - 16 + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 3 MQA - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - 3 MC41AA @@ -100,6 +88,17 @@ NSImage startGameButton.png + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + @@ -110,17 +109,18 @@ IBIPadFramework 0 0 - - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage backButton.png + + @@ -132,17 +132,18 @@ IBIPadFramework 0 0 - - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage helpButton.png + + @@ -179,27 +180,47 @@ 0.05000000074505806 0.05000000074505806 - + {1024, 768} - YES + 3 3 + + IBUIScreenMetrics + IBIPadFramework + iPad Full Screen + + YES + + + + + + {768, 1024} + {1024, 768} + + + 1 + IBIPadFramework NO + 3 3 + IBIPadFramework YES NO + IBIPadFramework YES @@ -207,13 +228,13 @@ NO MapConfigViewController-iPad + IBIPadFramework YES - + - - YES + view @@ -223,6 +244,47 @@ 3 + + teamConfigViewController + + + + 45 + + + + schemeWeaponConfigViewController + + + + 51 + + + + mapConfigViewController + + + + 57 + + + + titleImage + + + + 68 + + + + buttonPressed: + + + 7 + + 36 + + buttonPressed: @@ -234,15 +296,6 @@ buttonPressed: - - - 7 - - 36 - - - - buttonPressed: 7 @@ -251,14 +304,6 @@ - teamConfigViewController - - - - 45 - - - view @@ -275,19 +320,11 @@ - schemeWeaponConfigViewController - - + slider + + - 51 - - - - mapConfigViewController - - - - 57 + 69 @@ -307,29 +344,12 @@ 67 - - - titleImage - - - - 68 - - - - slider - - - - 69 - - + - - YES + 0 - + @@ -347,8 +367,7 @@ 2 - - YES + @@ -357,7 +376,7 @@ - + @@ -393,17 +412,13 @@ 44 - - YES - + 46 - - YES - + TeamConfigViewController View @@ -429,650 +444,52 @@ Filter Slider - + - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 30.IBPluginDependency - 30.IBViewBoundsToFrameTransform - 31.IBPluginDependency - 31.IBViewBoundsToFrameTransform - 32.IBPluginDependency - 32.IBViewBoundsToFrameTransform - 33.IBPluginDependency - 33.IBViewBoundsToFrameTransform - 34.IBPluginDependency - 34.IBViewBoundsToFrameTransform - 44.CustomClassName - 44.IBEditorWindowLastContentRect - 44.IBPluginDependency - 46.IBPluginDependency - 46.IBViewBoundsToFrameTransform - 48.CustomClassName - 48.IBEditorWindowLastContentRect - 48.IBPluginDependency - 49.IBPluginDependency - 49.IBViewBoundsToFrameTransform - 55.CustomClassName - 55.IBEditorWindowLastContentRect - 55.IBPluginDependency - 60.CustomClassName - 60.IBPluginDependency - 60.IBViewBoundsToFrameTransform - - - YES - GameConfigViewController - UIResponder - {{252, 239}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABAoAAAxLrgAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDtQAAxGNAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABD3wAAxLqgAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABByAAAxLmAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABEbEAAxLmAAA - - TeamConfigViewController - {{63, 355}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AUOogABDOwAAA - - SchemeWeaponConfigViewController - {{84, 388}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAxHqAAA - - MapConfigViewController - {{126, 377}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MNEValueTrackingSlider - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AUNRAABEMoAAA - - - - - YES - - - YES - - + + GameConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + TeamConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + SchemeWeaponConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MapConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MNEValueTrackingSlider + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - YES - - + 69 - - - YES - - GameConfigViewController - UIViewController - - YES - - YES - buttonPressed: - segmentPressed: - - - YES - id - id - - - - YES - - YES - buttonPressed: - segmentPressed: - - - YES - - buttonPressed: - id - - - segmentPressed: - id - - - - - YES - - YES - mapConfigViewController - schemeWeaponConfigViewController - teamConfigViewController - titleImage - - - YES - MapConfigViewController - SchemeWeaponConfigViewController - TeamConfigViewController - UIImageView - - - - YES - - YES - mapConfigViewController - schemeWeaponConfigViewController - teamConfigViewController - titleImage - - - YES - - mapConfigViewController - MapConfigViewController - - - schemeWeaponConfigViewController - SchemeWeaponConfigViewController - - - teamConfigViewController - TeamConfigViewController - - - titleImage - UIImageView - - - - - IBProjectSource - Classes/GameConfigViewController.h - - - - MNEValueTrackingSlider - UISlider - - IBProjectSource - Classes/MNEValueTrackingSlider.h - - - - MapConfigViewController - UIViewController - - YES - - YES - mapButtonPressed: - segmentedControlChanged: - sliderChanged: - sliderEndedChanging: - - - YES - id - id - id - id - - - - YES - - YES - mapButtonPressed: - segmentedControlChanged: - sliderChanged: - sliderEndedChanging: - - - YES - - mapButtonPressed: - id - - - segmentedControlChanged: - id - - - sliderChanged: - id - - - sliderEndedChanging: - id - - - - - YES - - YES - maxLabel - previewButton - segmentedControl - slider - tableView - - - YES - UILabel - MapPreviewButtonView - UISegmentedControl - MNEValueTrackingSlider - UITableView - - - - YES - - YES - maxLabel - previewButton - segmentedControl - slider - tableView - - - YES - - maxLabel - UILabel - - - previewButton - MapPreviewButtonView - - - segmentedControl - UISegmentedControl - - - slider - MNEValueTrackingSlider - - - tableView - UITableView - - - - - IBProjectSource - Classes/MapConfigViewController.h - - - - MapPreviewButtonView - UIButton - - delegate - id - - - delegate - - delegate - id - - - - IBProjectSource - Classes/MapPreviewButtonView.h - - - - SchemeWeaponConfigViewController - UIViewController - - IBProjectSource - Classes/SchemeWeaponConfigViewController.h - - - - TeamConfigViewController - UIViewController - - IBProjectSource - Classes/TeamConfigViewController.h - - - - UIButton - - IBProjectSource - Classes/ExtraCategories.h - - - - UILabel - - - - UITableView - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIImageView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIImageView.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UISegmentedControl - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISegmentedControl.h - - - - UISlider - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISlider.h - - - - UITableView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITableView.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - + 0 IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES - ../Hedgewars.xcodeproj 3 - - YES - - YES - backButton.png - background.png - helpButton.png - startGameButton.png - title~iphone.png - - - YES - {64, 64} - {1024, 768} - {64, 64} - {142, 64} - {270, 150} - - - 132 + + {64, 64} + {1024, 768} + {64, 64} + {142, 64} + {540, 300} + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib Thu Sep 10 18:22:52 2015 +0200 @@ -1,35 +1,28 @@ - + - 1056 - 10K549 - 823 - 1038.36 - 461.00 + 1792 + 14E46 + 7706 + 1348.17 + 758.70 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 - - YES - - YES - - - YES - - - - YES + + IBProxyObject + IBUIBarButtonItem + IBUISegmentedControl + IBUIToolbar + IBUIView + IBUIViewController + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + IBFilesOwner IBCocoaTouchFramework @@ -39,19 +32,17 @@ IBCocoaTouchFramework - - 292 - - YES + + 274 + 266 - - YES + 292 - {{96, 8}, {270, 30}} + {{105, 8}, {270, 30}} NO 12345 @@ -59,55 +50,50 @@ 2 4 0 - - YES + Map Teams Details Help - - - YES + + - - - YES + + - - - YES + + {0, 0} {0, 0} {0, 0} {0, 0} - - - YES + + - + 1 MC42IDAuNiAwLjYAA - + {{0, 276}, {480, 44}} + NO NO IBCocoaTouchFramework 1 - - YES + Back IBCocoaTouchFramework @@ -137,13 +123,14 @@ 2 - + 274 {480, 276} + 3 MQA @@ -159,6 +146,7 @@ 274 {480, 276} + 3 MQA @@ -167,25 +155,48 @@ YES IBCocoaTouchFramework - + {480, 320} - + 3 MQA NO + 3 3 + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + IBCocoaTouchFramework MapConfigViewController-iPhone + 3 3 + + IBUIScreenMetrics + IBCocoaTouchFramework + iPhone 4-inch + + YES + + + + + + {320, 568} + {568, 320} + + + 2 + IBCocoaTouchFramework YES @@ -194,19 +205,20 @@ 1 + IBCocoaTouchFramework YES + IBCocoaTouchFramework YES - + - - YES + view @@ -216,6 +228,30 @@ 3 + + mapConfigViewController + + + + 33 + + + + teamConfigViewController + + + + 34 + + + + schemeWeaponConfigViewController + + + + 35 + + buttonPressed: @@ -242,30 +278,6 @@ - mapConfigViewController - - - - 33 - - - - teamConfigViewController - - - - 34 - - - - schemeWeaponConfigViewController - - - - 35 - - - view @@ -280,13 +292,12 @@ 43 - + - - YES + 0 - + @@ -304,25 +315,23 @@ 2 - - YES + - + 15 - - YES + - + @@ -343,10 +352,9 @@ 21 - - YES + - + @@ -386,629 +394,45 @@ SchemeWeaponConfigViewController View - + - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 15.IBPluginDependency - 15.IBViewBoundsToFrameTransform - 16.IBPluginDependency - 18.IBPluginDependency - 19.IBPluginDependency - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 20.IBPluginDependency - 22.IBPluginDependency - 30.CustomClassName - 30.IBEditorWindowLastContentRect - 30.IBPluginDependency - 31.CustomClassName - 31.IBEditorWindowLastContentRect - 31.IBPluginDependency - 32.CustomClassName - 32.IBEditorWindowLastContentRect - 32.IBPluginDependency - 40.IBPluginDependency - 40.IBViewBoundsToFrameTransform - 41.IBPluginDependency - 41.IBViewBoundsToFrameTransform - - - YES - GameConfigViewController - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAw58AAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{40, 217}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MapConfigViewController - {{0, 825}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TeamConfigViewController - {{21, 802}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - SchemeWeaponConfigViewController - {{42, 779}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAw5QAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAw5QAAA - - - - - YES - - - YES - - + + GameConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MapConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + TeamConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + SchemeWeaponConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - YES - - + 45 - - - YES - - GameConfigViewController - UIViewController - - YES - - YES - buttonPressed: - segmentPressed: - - - YES - id - id - - - - YES - - YES - buttonPressed: - segmentPressed: - - - YES - - buttonPressed: - id - - - segmentPressed: - id - - - - - YES - - YES - mapConfigViewController - schemeWeaponConfigViewController - teamConfigViewController - titleImage - - - YES - MapConfigViewController - SchemeWeaponConfigViewController - TeamConfigViewController - UIImageView - - - - YES - - YES - mapConfigViewController - schemeWeaponConfigViewController - teamConfigViewController - titleImage - - - YES - - mapConfigViewController - MapConfigViewController - - - schemeWeaponConfigViewController - SchemeWeaponConfigViewController - - - teamConfigViewController - TeamConfigViewController - - - titleImage - UIImageView - - - - - IBProjectSource - Classes/GameConfigViewController.h - - - - MapConfigViewController - UIViewController - - YES - - YES - mapButtonPressed: - segmentedControlChanged: - sliderChanged: - sliderEndedChanging: - - - YES - id - id - id - id - - - - YES - - YES - mapButtonPressed: - segmentedControlChanged: - sliderChanged: - sliderEndedChanging: - - - YES - - mapButtonPressed: - id - - - segmentedControlChanged: - id - - - sliderChanged: - id - - - sliderEndedChanging: - id - - - - - YES - - YES - maxLabel - previewButton - segmentedControl - slider - tableView - - - YES - UILabel - MapPreviewButtonView - UISegmentedControl - ValueTrackingSliderView - UITableView - - - - YES - - YES - maxLabel - previewButton - segmentedControl - slider - tableView - - - YES - - maxLabel - UILabel - - - previewButton - MapPreviewButtonView - - - segmentedControl - UISegmentedControl - - - slider - ValueTrackingSliderView - - - tableView - UITableView - - - - - IBProjectSource - Classes/MapConfigViewController.h - - - - MapPreviewButtonView - UIButton - - delegate - id - - - delegate - - delegate - id - - - - IBProjectSource - Classes/MapPreviewButtonView.h - - - - SchemeWeaponConfigViewController - UIViewController - - IBProjectSource - Classes/SchemeWeaponConfigViewController.h - - - - TeamConfigViewController - UIViewController - - IBProjectSource - Classes/TeamConfigViewController.h - - - - UILabel - - IBProjectSource - Classes/ExtraCategories.h - - - - UITableView - - - - ValueTrackingSliderView - UISlider - - IBProjectSource - Classes/MNEValueTrackingSlider.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIBarButtonItem - UIBarItem - - IBFrameworkSource - UIKit.framework/Headers/UIBarButtonItem.h - - - - UIBarItem - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIBarItem.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIImageView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIImageView.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UISegmentedControl - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISegmentedControl.h - - - - UISlider - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISlider.h - - - - UITableView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITableView.h - - - - UIToolbar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIToolbar.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - + 0 IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES - ../Hedgewars.xcodeproj 3 - 132 diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/GameConfigViewController.h --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Thu Sep 10 18:22:52 2015 +0200 @@ -23,7 +23,7 @@ @class SchemeWeaponConfigViewController; @class TeamConfigViewController; @class MapConfigViewController; -//@class HelpPageLobbyViewController; +@class HelpPageLobbyViewController; @interface GameConfigViewController : UIViewController { UIView *imgContainer; @@ -33,7 +33,7 @@ SchemeWeaponConfigViewController *schemeWeaponConfigViewController; TeamConfigViewController *teamConfigViewController; MapConfigViewController *mapConfigViewController; - //HelpPageLobbyViewController *helpPage; + HelpPageLobbyViewController *helpPage; } @property (retain) UIView *imgContainer; @@ -42,7 +42,7 @@ @property (nonatomic,retain) IBOutlet SchemeWeaponConfigViewController *schemeWeaponConfigViewController; @property (nonatomic,retain) IBOutlet TeamConfigViewController *teamConfigViewController; @property (nonatomic,retain) IBOutlet MapConfigViewController *mapConfigViewController; -//@property (nonatomic,retain) HelpPageLobbyViewController *helpPage; +@property (nonatomic,retain) HelpPageLobbyViewController *helpPage; -(IBAction) buttonPressed:(id) sender; -(IBAction) segmentPressed:(id) sender; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -22,10 +22,10 @@ #import "TeamConfigViewController.h" #import "SchemeWeaponConfigViewController.h" #import "GameInterfaceBridge.h" - +#import "HelpPageLobbyViewController.h" @implementation GameConfigViewController -@synthesize imgContainer, titleImage, sliderBackground, //helpPage, +@synthesize imgContainer, titleImage, sliderBackground, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -47,7 +47,7 @@ [alert release]; } else { [[AudioManagerController mainManager] playBackSound]; - [[self parentViewController] dismissModalViewControllerAnimated:YES]; + [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; } break; case 1: @@ -66,15 +66,14 @@ break; case 2: [[AudioManagerController mainManager] playClickSound]; - /* if (self.helpPage == nil) self.helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil]; self.helpPage.view.alpha = 0; + self.helpPage.view.frame = self.view.frame; [self.view addSubview:self.helpPage.view]; - [UIView beginAnimations:@"helplobby" context:NULL]; - self.helpPage.view.alpha = 1; - [UIView commitAnimations]; - */ + [UIView animateWithDuration:0.5 animations:^{ + self.helpPage.view.alpha = 1; + }]; break; default: DLog(@"Nope"); @@ -104,15 +103,16 @@ [self.view bringSubviewToFront:schemeWeaponConfigViewController.view]; break; case 3: - /* if (helpPage == nil) { helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPhone" bundle:nil]; + CGRect helpPageFrame = self.view.frame; + helpPageFrame.size.height -= 44; //toolbar height + self.helpPage.view.frame = helpPageFrame; [self.view addSubview:helpPage.view]; } // this message is compulsory otherwise the table won't be loaded at all [helpPage viewWillAppear:NO]; [self.view bringSubviewToFront:helpPage.view]; - */ break; default: DLog(@"Nope"); @@ -230,14 +230,15 @@ } -(void) loadNiceHogs { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + srand(time(NULL)); NSString *filePath = [[NSString alloc] initWithFormat:@"%@/Hedgehog/Idle.png",GRAPHICS_DIRECTORY()]; UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:filePath]; [filePath release]; NSArray *hatArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:HATS_DIRECTORY() error:NULL]; - int numberOfHats = [hatArray count]; + NSUInteger numberOfHats = [hatArray count]; int animationFrames = IS_VERY_POWERFUL([HWUtils modelType]) ? 18 : 1; if (self.imgContainer != nil) @@ -245,7 +246,7 @@ self.imgContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 40)]; NSInteger numberOfHogs = 1 + random() % 20; - DLog(@"Drawing %d nice hedgehogs", numberOfHogs); + DLog(@"Drawing %ld nice hedgehogs", (long)numberOfHogs); for (int i = 0; i < numberOfHogs; i++) { NSString *hat = [hatArray objectAtIndex:random()%numberOfHats]; @@ -284,7 +285,8 @@ [self.view addSubview:self.imgContainer]; [hogSprite release]; - [pool drain]; + + } } -(void) viewDidLoad { @@ -325,8 +327,20 @@ if (IS_IPAD() == NO) return; - if ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || - toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)) { + [self updateiPadUIForInterfaceOrientation:toInterfaceOrientation]; + + [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation + duration:duration]; + if (self.helpPage) + { + self.helpPage.view.frame = self.view.frame; + } +} + +- (void)updateiPadUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft || + interfaceOrientation == UIInterfaceOrientationLandscapeRight)) { self.imgContainer.alpha = 1; self.titleImage.frame = CGRectMake(357, 17, 309, 165); self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620); @@ -345,15 +359,19 @@ self.sliderBackground.frame = CGRectMake(465, 975, 200, 40); self.mapConfigViewController.slider.frame = CGRectMake(475, 983, 180, 23); } - - [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation - duration:duration]; } -(void) viewWillAppear:(BOOL)animated { +// if (IS_IPAD()) +// [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil]; + if (IS_IPAD()) - [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil]; - + { + // we assume here what 'statusBarOrientation' will never be changed manually! + UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation]; + [self updateiPadUIForInterfaceOrientation:currentOrientation]; + } + [self.mapConfigViewController viewWillAppear:animated]; [self.teamConfigViewController viewWillAppear:animated]; [self.schemeWeaponConfigViewController viewWillAppear:animated]; @@ -397,8 +415,8 @@ self.teamConfigViewController = nil; if (self.schemeWeaponConfigViewController.view.superview == nil) self.schemeWeaponConfigViewController = nil; - //if (self.helpPage.view.superview == nil) - // self.helpPage = nil; + if (self.helpPage.view.superview == nil) + self.helpPage = nil; MSG_MEMCLEAN(); [super didReceiveMemoryWarning]; } @@ -410,7 +428,7 @@ self.schemeWeaponConfigViewController = nil; self.teamConfigViewController = nil; self.mapConfigViewController = nil; - //self.helpPage = nil; + self.helpPage = nil; MSG_DIDUNLOAD(); [super viewDidUnload]; } @@ -422,7 +440,7 @@ releaseAndNil(schemeWeaponConfigViewController); releaseAndNil(teamConfigViewController); releaseAndNil(mapConfigViewController); - //releaseAndNil(helpPage); + releaseAndNil(helpPage); [super dealloc]; } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Thu Sep 10 18:22:52 2015 +0200 @@ -176,7 +176,7 @@ [gameParameters release]; // this is the pascal function that starts the game - Game(argc, argv); + RunEngine(argc, argv); // cleanup for (int i = 0; i < argc; i++) @@ -201,7 +201,7 @@ statsPage.statsArray = stats; statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical; - [callingController presentModalViewController:statsPage animated:YES]; + [callingController presentViewController:statsPage animated:YES completion:nil]; [statsPage release]; } } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/GravesViewController.m --- a/project_files/HedgewarsMobile/Classes/GravesViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GravesViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -88,8 +88,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; if (newRow != oldRow) { [teamDictionary setObject:[[graveArray objectAtIndex:newRow] stringByDeletingPathExtension] forKey:@"grave"]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HWUtils.m --- a/project_files/HedgewarsMobile/Classes/HWUtils.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/HWUtils.m Thu Sep 10 18:22:52 2015 +0200 @@ -111,15 +111,15 @@ NSInteger res = 0; do { res = (random() % 64511) + 1024; - } while ([activePorts containsObject:[NSNumber numberWithInt:res]]); + } while ([activePorts containsObject:[NSNumber numberWithInteger:res]]); // add this number to the forbdding list - [activePorts addObject:[NSNumber numberWithInt:res]]; + [activePorts addObject:[NSNumber numberWithInteger:res]]; return res; } +(void) freePort:(NSInteger) port { - [activePorts removeObject:[NSNumber numberWithInt:port]]; + [activePorts removeObject:[NSNumber numberWithInteger:port]]; } +(BOOL) isNetworkReachable { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m --- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Thu Sep 10 18:22:52 2015 +0200 @@ -51,6 +51,8 @@ // override the direct execution of SDL_main to allow us to implement our own frontend -(void) postFinishLaunch { + [self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0]; + [[UIApplication sharedApplication] setStatusBarHidden:YES]; self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; @@ -58,7 +60,7 @@ NSString *controllerName = (IS_IPAD() ? @"MainMenuViewController-iPad" : @"MainMenuViewController-iPhone"); self.mainViewController = [[MainMenuViewController alloc] initWithNibName:controllerName bundle:nil]; - [self.uiwindow addSubview:self.mainViewController.view]; + self.uiwindow.rootViewController = self.mainViewController; [self.mainViewController release]; [self.uiwindow makeKeyAndVisible]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPad.xib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPad.xib Thu Sep 10 18:22:52 2015 +0200 @@ -0,0 +1,1126 @@ + + + + 1792 + 14E46 + 7706 + 1348.17 + 758.70 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 + + + IBProxyObject + IBUIImageView + IBUILabel + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 256 + + + + 292 + + + + 274 + {{0, 1}, {278, 50}} + + + NO + NO + IBIPadFramework + + NSImage + helpleft.png + + + + + 274 + {{22, -2}, {248, 54}} + + + NO + YES + 7 + NO + IBIPadFramework + Did you know you can customize almost everything in the settings page? + + 1 + MCAwIDAAA + darkTextColor + + + 1 + 10 + 0 + + Helvetica-Oblique + Helvetica + 1 + 14 + + + Helvetica-Oblique + 14 + 16 + + YES + 248 + + + {{10, 8}, {278, 52}} + + + + 3 + MCAwAA + + IBIPadFramework + + + + 297 + + + + 274 + {240, 102} + + + NO + NO + IBIPadFramework + + NSImage + helpabove.png + + + + + 292 + {{12, 19}, {109, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Map theme + + + 1 + 10 + + Helvetica-Bold + Helvetica + 2 + 18 + + + Helvetica-Bold + 18 + 16 + + YES + + + + 274 + {{11, 36}, {218, 66}} + + + NO + YES + 7 + NO + IBIPadFramework + Here you can choose how your map will appear in game. + + + 1 + 10 + 0 + + Helvetica + Helvetica + 0 + 16 + + + Helvetica + 16 + 16 + + YES + 218 + + + {{742, 360}, {240, 102}} + + + + IBIPadFramework + + + + 289 + + + + 274 + {240, 146} + + + NO + NO + IBIPadFramework + + + + + 292 + {{11, 22}, {109, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Map type + + + 1 + 10 + + + YES + + + + 274 + {{11, 41}, {218, 99}} + + + NO + YES + 7 + NO + IBIPadFramework + Choose between a static map or a randomly generated one (might require more time). In a mission you need to perfom some action to win. + + + 1 + 10 + 0 + + + YES + 218 + + + {{653, 202}, {240, 146}} + + + + IBIPadFramework + + + + 289 + + + + 274 + {240, 101} + + + NO + NO + IBIPadFramework + + NSImage + helpright.png + + + + + 292 + {{9, 7}, {109, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Map preview + + + 1 + 10 + + + YES + + + + 274 + {{8, 25}, {218, 65}} + + + NO + YES + 7 + NO + IBIPadFramework + This is a small preview of your next map. Tap to select / generate a new map. + + + 1 + 10 + 0 + + + YES + 218 + + + {{494, 20}, {240, 101}} + + + + IBIPadFramework + + + + 269 + + + + 274 + {242, 171} + + + NO + NO + IBIPadFramework + + + + + 292 + {{8, 25}, {109, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Teams + + + 1 + 10 + + + YES + + + + 274 + {{10, 45}, {232, 120}} + + + NO + YES + 7 + NO + IBIPadFramework + Select which teams are playing! Add hogs by tapping on them and set their color to figure friend and foe teams out. AI teams will appear with a small robot badge next their name. + + + 1 + 10 + 0 + + + YES + 232 + + + {{358, 389}, {242, 171}} + + + + IBIPadFramework + + + + 292 + + + + 274 + {240, 104} + + + NO + NO + IBIPadFramework + + + + + 292 + {{23, 8}, {204, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Schemes and Weapons + + + 1 + 10 + + + YES + + + + 274 + {{23, 27}, {210, 71}} + + + NO + YES + 7 + NO + IBIPadFramework + Here you can choose which rules and which weapon set will be applied in game. + + + 1 + 10 + 0 + + + YES + 210 + + + {{142, 160}, {240, 104}} + + + + IBIPadFramework + + + + 268 + + + + 274 + {240, 117} + + + NO + NO + IBIPadFramework + + NSImage + helpbottom.png + + + + + 292 + {{10, 8}, {138, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Max hedgehogs + + + 1 + 10 + + + YES + + + + 274 + {{11, 26}, {218, 73}} + + + NO + YES + 7 + NO + IBIPadFramework + This number is the maximum size for all the hogs playing (in every team). + + + 1 + 10 + 0 + + + YES + 218 + + + {{35, 590}, {240, 117}} + + + + IBIPadFramework + + + + 265 + + + + 274 + {240, 109} + + + NO + NO + IBIPadFramework + + + + + 292 + {{8, 6}, {138, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Size slider + + + 1 + 10 + + + YES + + + + 292 + {{11, 22}, {218, 73}} + + + NO + YES + 7 + NO + IBIPadFramework + For Random and Maze maps you can decide to generate only maps of a certain size. + + + 1 + 10 + 0 + + + YES + 218 + + + {{695, 598}, {240, 109}} + + + + IBIPadFramework + + + + 292 + + + + 274 + {240, 128} + + + NO + NO + IBIPadFramework + + NSImage + helpplain.png + + + + + 288 + {{6, 8}, {229, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Tap anywhere to dismiss + + + 1 + 10 + 1 + + + YES + + + + 274 + {{8, 32}, {224, 87}} + + + NO + YES + 7 + NO + IBIPadFramework + Still confused? Don't worry, it's really simple! Try a couple of games and everything will become clear to you. + + + 1 + 10 + 0 + + + YES + 224 + + + {{45, 360}, {240, 128}} + + + + IBIPadFramework + + + + 269 + + + + 274 + {240, 61} + + + NO + NO + IBIPadFramework + + + + + 292 + {{8, 3}, {138, 22}} + + + NO + YES + 7 + NO + IBIPadFramework + Start button + + + 1 + 10 + + + YES + + + + 274 + {{11, 14}, {218, 46}} + + + NO + YES + 7 + NO + IBIPadFramework + This button starts the game. + + + 1 + 10 + 0 + + + YES + 218 + + + {{344, 646}, {240, 61}} + + + + IBIPadFramework + + + {1024, 768} + + + 3 + MCAwLjQAA + + NO + NO + + 3 + 3 + + + IBUIScreenMetrics + IBIPadFramework + iPad Full Screen + + YES + + + + + + {768, 1024} + {1024, 768} + + + 1 + + IBIPadFramework + + + + + + + view + + + + 3 + + + + dismiss + + + 7 + + 16 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + + + + + + + + + + + 60 + + + + + + + + Teams Bubble + + + 43 + + + + + 44 + + + + + 45 + + + + + 61 + + + + + + + + Tap anywere Bubble + + + 25 + + + + + 26 + + + + + 27 + + + + + 62 + + + + + + + + Start button Bubble + + + 49 + + + + + 50 + + + + + 51 + + + + + 63 + + + + + + + + Size slider Bubble + + + 37 + + + + + 38 + + + + + 39 + + + + + 64 + + + + + + + + Max hogs Bubble + + + 34 + + + + + 35 + + + + + 36 + + + + + 65 + + + + + + + + Map theme Bubble + + + 28 + + + + + 29 + + + + + 30 + + + + + 66 + + + + + + + + Map type Bubble + + + 52 + + + + + 53 + + + + + 54 + + + + + 67 + + + + + + + + Map preview Bubble + + + 6 + + + + + 7 + + + + + 8 + + + + + 68 + + + + + + + + Schemes & Weapons Bubble + + + 40 + + + + + 41 + + + + + 42 + + + + + 69 + + + + + + + Customize Bubble + + + 58 + + + + + 59 + + + + + + + HelpPageLobbyViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIControl + + {581, 369} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 70 + + + 0 + IBIPadFramework + NO + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + 3 + + {295, 156} + {295, 156} + {308, 144} + {296, 138} + {308, 144} + + + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPhone.xib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController-iPhone.xib Thu Sep 10 18:22:52 2015 +0200 @@ -0,0 +1,614 @@ + + + + 1792 + 14E46 + 7706 + 1348.17 + 758.70 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 + + + IBProxyObject + IBUILabel + IBUIScrollView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + + + + 290 + {{20, 587}, {440, 52}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Still confused? Don't worry, it's really simple! Try a couple of games and everything will become clear to you. + + 1 + MCAwIDAAA + + + 1 + 10 + 0 + 1 + + Helvetica + Helvetica + 0 + 16 + + + Helvetica + 16 + 16 + + YES + 440 + + + + 292 + {{20, 279}, {138, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Size slider + + + 1 + 10 + + Helvetica-Bold + Helvetica + 2 + 18 + + + Helvetica-Bold + 18 + 16 + + YES + + + + 290 + {{20, 298}, {440, 44}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + For Random and Maze maps you can decide to generate only maps of a certain size. + + + 1 + 10 + 0 + + + YES + 440 + + + + 292 + {{20, 511}, {204, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Schemes and Weapons + + + 1 + 10 + + + YES + + + + 290 + {{20, 530}, {433, 45}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Here you can choose which rules and which weapon set will be applied in game. + + + 1 + 10 + 0 + + + YES + 433 + + + + 292 + {{20, 68}, {109, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Map preview + + + 1 + 10 + + + YES + + + + 290 + {{20, 88}, {440, 44}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + This is a small preview of your next map. Tap to select / generate a new map. + + + 1 + 10 + 0 + + + YES + 440 + + + + 292 + {{20, 140}, {109, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Map type + + + 1 + 10 + + + YES + + + + 290 + {{20, 164}, {440, 58}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Choose between a static map or a randomly generated one (might require more time). In a mission you need to perfom some action to win. + + + 1 + 10 + 0 + + + YES + 440 + + + + 292 + {{20, 229}, {109, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Map theme + + + 1 + 10 + + + YES + + + + 290 + {{20, 244}, {440, 33}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Here you can choose how your map will appear in game. + + + 1 + 10 + 0 + + + YES + 440 + + + + 292 + {{20, 347}, {138, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Max hedgehogs + + + 1 + 10 + + + YES + + + + 290 + {{20, 367}, {440, 41}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + This number is the maximum size for all the hogs playing (in every team). + + + 1 + 10 + 0 + + + YES + 440 + + + + 292 + {{20, 418}, {109, 22}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Teams + + + 1 + 10 + + + YES + + + + 290 + {{20, 436}, {433, 66}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Select which teams are playing! Add hogs by tapping on them and set their color to figure friend and foe teams out. AI teams will appear with a small robot badge next their name. + + + 1 + 10 + 0 + + + YES + 433 + + + + 290 + {{20, 3}, {440, 60}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Here you can find help for the game configuration options. You can customize almost everything in the settings page. + + + 1 + 10 + 0 + 1 + + Helvetica-Oblique + Helvetica + 1 + 16 + + + Helvetica-Oblique + 16 + 16 + + YES + 440 + + + {480, 276} + + YES + YES + IBCocoaTouchFramework + + + {480, 276} + + 2 + MC45OTYwNzg0OTEyIDAuOTg4MjM1MzU0NCAxAA + + NO + NO + + + 3 + 3 + + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + scrollView + + + + 95 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + + 60 + + + + + + + + + + + + + + + + + + + + + + + 61 + + + + + 62 + + + + + 63 + + + + + 64 + + + + + 65 + + + + + 66 + + + + + 67 + + + + + 68 + + + + + 69 + + + + + 70 + + + + + 71 + + + + + 72 + + + + + 73 + + + + + 74 + + + + + 75 + + + + + 76 + + + + + + + HelpPageLobbyViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {505, 338} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 95 + + + 0 + IBCocoaTouchFramework + NO + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + 3 + + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.h Thu Sep 10 18:22:52 2015 +0200 @@ -0,0 +1,31 @@ +/* + * Hedgewars-iOS, a Hedgewars port for iOS devices + * Copyright (c) 2009-2012 Vittorio Giovara + * + * 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. + */ + + +#import + + +@interface HelpPageLobbyViewController : UIViewController { + UIScrollView *scrollView; +} + +@property (nonatomic, retain) IBOutlet UIScrollView *scrollView; + +-(IBAction) dismiss; + +@end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -0,0 +1,65 @@ +/* + * Hedgewars-iOS, a Hedgewars port for iOS devices + * Copyright (c) 2009-2012 Vittorio Giovara + * + * 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. + */ + + +#import "HelpPageLobbyViewController.h" + + +@implementation HelpPageLobbyViewController +@synthesize scrollView; + +-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { + return rotationManager(interfaceOrientation); +} + +-(void) didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + self.scrollView = nil; +} + +// on iPhone the XIBs contain UIScrollView +-(void) viewDidLoad { + if (IS_IPAD() == NO){ + scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 650); + scrollView.maximumZoomScale = 4.0; + scrollView.minimumZoomScale = 0.75; + scrollView.clipsToBounds = YES; + scrollView.delegate = self; + } + [super viewDidLoad]; +} + +-(void) viewDidUnload { + [super viewDidUnload]; + self.scrollView = nil; +} + +-(void) dealloc { + releaseAndNil(scrollView); + [super dealloc]; +} + +-(IBAction) dismiss { + [UIView animateWithDuration:0.5 animations:^{ + self.view.alpha = 0; + } completion:^(BOOL finished){ + [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0]; + }]; +} + +@end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HogHatViewController.m --- a/project_files/HedgewarsMobile/Classes/HogHatViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/HogHatViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -101,8 +101,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; if (newRow != oldRow) { // if the two selected rows differ update data on the hog dictionary and reload table content diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/HoldTableViewCell.m --- a/project_files/HedgewarsMobile/Classes/HoldTableViewCell.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/HoldTableViewCell.m Thu Sep 10 18:22:52 2015 +0200 @@ -57,7 +57,29 @@ -(void) holdAction { if (self.delegate != nil && [self.delegate respondsToSelector:@selector(holdAction:onTable:)]) - [self.delegate holdAction:self.textLabel.text onTable:(UITableView *)self.superview]; + { + UITableView *tableView = [self findTable]; + if (tableView) + { + [self.delegate holdAction:self.textLabel.text onTable:tableView]; + } + } +} + +- (UITableView *)findTable +{ + UIView *tableView = self.superview; + while (![tableView isKindOfClass:[UITableView class]] || (tableView == nil)) + { + tableView = tableView.superview; + + if ([tableView isEqual:self.window]) + { + tableView = nil; + } + } + + return (UITableView *)tableView; } -(void) dealloc { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/LevelViewController.m --- a/project_files/HedgewarsMobile/Classes/LevelViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/LevelViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -141,9 +141,9 @@ } [sections release]; - DLog(@"New level is %d",level); + DLog(@"New level is %ld", (long)level); for (NSMutableDictionary *hog in hogs) - [hog setObject:[NSNumber numberWithInt:level] forKey:@"level"]; + [hog setObject:[NSNumber numberWithInteger:level] forKey:@"level"]; [self.tableView reloadData]; [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil]; @@ -153,8 +153,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (self.lastIndexPath != nil) ? [self.lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (self.lastIndexPath != nil) ? [self.lastIndexPath row] : -1; if ([indexPath section] != 0) { if (newRow != oldRow) { @@ -162,8 +162,8 @@ NSInteger level = newRow + 1; for (NSMutableDictionary *hog in hogs) - [hog setObject:[NSNumber numberWithInt:level] forKey:@"level"]; - DLog(@"New level is %d",level); + [hog setObject:[NSNumber numberWithInteger:level] forKey:@"level"]; + DLog(@"New level is %ld", (long)level); // tell our boss to write this new stuff on disk [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.h --- a/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.h Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.h Thu Sep 10 18:22:52 2015 +0200 @@ -9,23 +9,23 @@ #import typedef enum _MGCornersPosition { - MGCornersPositionLeadingVertical = 0, // top of screen for a left/right split. - MGCornersPositionTrailingVertical = 1, // bottom of screen for a left/right split. - MGCornersPositionLeadingHorizontal = 2, // left of screen for a top/bottom split. - MGCornersPositionTrailingHorizontal = 3 // right of screen for a top/bottom split. + MGCornersPositionLeadingVertical = 0, // top of screen for a left/right split. + MGCornersPositionTrailingVertical = 1, // bottom of screen for a left/right split. + MGCornersPositionLeadingHorizontal = 2, // left of screen for a top/bottom split. + MGCornersPositionTrailingHorizontal = 3 // right of screen for a top/bottom split. } MGCornersPosition; @class MGSplitViewController; @interface MGSplitCornersView : UIView { - float cornerRadius; - MGSplitViewController *splitViewController; - MGCornersPosition cornersPosition; - UIColor *cornerBackgroundColor; + float cornerRadius; + MGSplitViewController *__unsafe_unretained splitViewController; + MGCornersPosition cornersPosition; + UIColor *cornerBackgroundColor; } @property (nonatomic, assign) float cornerRadius; -@property (nonatomic, assign) MGSplitViewController *splitViewController; // weak ref. +@property (nonatomic, unsafe_unretained) MGSplitViewController *splitViewController; // weak ref. @property (nonatomic, assign) MGCornersPosition cornersPosition; // don't change this manually; let the splitViewController manage it. -@property (nonatomic, retain) UIColor *cornerBackgroundColor; +@property (nonatomic, strong) UIColor *cornerBackgroundColor; @end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.m --- a/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitCornersView.m Thu Sep 10 18:22:52 2015 +0200 @@ -7,7 +7,7 @@ // #import "MGSplitCornersView.h" -#import "CGPointUtils.h" + @implementation MGSplitCornersView @@ -19,23 +19,34 @@ - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { - self.contentMode = UIViewContentModeRedraw; - self.userInteractionEnabled = NO; - self.opaque = NO; - self.backgroundColor = [UIColor clearColor]; - cornerRadius = 0.0; // actual value is set by the splitViewController. - cornersPosition = MGCornersPositionLeadingVertical; + self.contentMode = UIViewContentModeRedraw; + self.userInteractionEnabled = NO; + self.opaque = NO; + self.backgroundColor = [UIColor clearColor]; + cornerRadius = 0.0; // actual value is set by the splitViewController. + cornersPosition = MGCornersPositionLeadingVertical; } - + return self; } - (void)dealloc { - self.cornerBackgroundColor = nil; + self.cornerBackgroundColor = nil; + + [super dealloc]; +} + - [super dealloc]; +#pragma mark - +#pragma mark Geometry helpers + + +static double deg2Rad(double degrees) +{ + // Converts degrees to radians. + return degrees * (M_PI / 180.0); } @@ -45,131 +56,127 @@ - (void)drawRect:(CGRect)rect { - // Draw two appropriate corners, with cornerBackgroundColor behind them. - if (cornerRadius > 0) { - if (NO) { // just for debugging. - [[UIColor redColor] set]; - UIRectFill(self.bounds); - } - - float maxX = CGRectGetMaxX(self.bounds); - float maxY = CGRectGetMaxY(self.bounds); - UIBezierPath *path = [UIBezierPath bezierPath]; - CGPoint pt = CGPointZero; - switch (cornersPosition) { - case MGCornersPositionLeadingVertical: // top of screen for a left/right split - [path moveToPoint:pt]; - pt.y += cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(90) endAngle:0 clockwise:YES]]; - pt.x += cornerRadius; - pt.y -= cornerRadius; - [path addLineToPoint:pt]; - [path addLineToPoint:CGPointZero]; - [path closePath]; - - pt.x = maxX - cornerRadius; - pt.y = 0; - [path moveToPoint:pt]; - pt.y = maxY; - [path addLineToPoint:pt]; - pt.x += cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(90) clockwise:YES]]; - pt.y -= cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - break; - - case MGCornersPositionTrailingVertical: // bottom of screen for a left/right split - pt.y = maxY; - [path moveToPoint:pt]; - pt.y -= cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(270) endAngle:degreesToRadians(360) clockwise:NO]]; - pt.x += cornerRadius; - pt.y += cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - pt.x = maxX - cornerRadius; - pt.y = maxY; - [path moveToPoint:pt]; - pt.y -= cornerRadius; - [path addLineToPoint:pt]; - pt.x += cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(270) clockwise:NO]]; - pt.y += cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - break; - - case MGCornersPositionLeadingHorizontal: // left of screen for a top/bottom split - pt.x = 0; - pt.y = cornerRadius; - [path moveToPoint:pt]; - pt.y -= cornerRadius; - [path addLineToPoint:pt]; - pt.x += cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(270) clockwise:NO]]; - pt.y += cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - pt.x = 0; - pt.y = maxY - cornerRadius; - [path moveToPoint:pt]; - pt.y = maxY; - [path addLineToPoint:pt]; - pt.x += cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(180) endAngle:degreesToRadians(90) clockwise:YES]]; - pt.y -= cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - break; - - case MGCornersPositionTrailingHorizontal: // right of screen for a top/bottom split - pt.y = cornerRadius; - [path moveToPoint:pt]; - pt.y -= cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(270) endAngle:degreesToRadians(360) clockwise:NO]]; - pt.x += cornerRadius; - pt.y += cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - pt.y = maxY - cornerRadius; - [path moveToPoint:pt]; - pt.y += cornerRadius; - [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:degreesToRadians(90) endAngle:0 clockwise:YES]]; - pt.x += cornerRadius; - pt.y -= cornerRadius; - [path addLineToPoint:pt]; - pt.x -= cornerRadius; - [path addLineToPoint:pt]; - [path closePath]; - - break; - - default: - break; - } - - [self.cornerBackgroundColor set]; - [path fill]; - } + // Draw two appropriate corners, with cornerBackgroundColor behind them. + if (cornerRadius > 0) { + + float maxX = CGRectGetMaxX(self.bounds); + float maxY = CGRectGetMaxY(self.bounds); + UIBezierPath *path = [UIBezierPath bezierPath]; + CGPoint pt = CGPointZero; + switch (cornersPosition) { + case MGCornersPositionLeadingVertical: // top of screen for a left/right split + [path moveToPoint:pt]; + pt.y += cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(90) endAngle:0 clockwise:YES]]; + pt.x += cornerRadius; + pt.y -= cornerRadius; + [path addLineToPoint:pt]; + [path addLineToPoint:CGPointZero]; + [path closePath]; + + pt.x = maxX - cornerRadius; + pt.y = 0; + [path moveToPoint:pt]; + pt.y = maxY; + [path addLineToPoint:pt]; + pt.x += cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(180) endAngle:(float)deg2Rad(90) clockwise:YES]]; + pt.y -= cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + break; + + case MGCornersPositionTrailingVertical: // bottom of screen for a left/right split + pt.y = maxY; + [path moveToPoint:pt]; + pt.y -= cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(270) endAngle:(float)deg2Rad(360) clockwise:NO]]; + pt.x += cornerRadius; + pt.y += cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + pt.x = maxX - cornerRadius; + pt.y = maxY; + [path moveToPoint:pt]; + pt.y -= cornerRadius; + [path addLineToPoint:pt]; + pt.x += cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(180) endAngle:(float)deg2Rad(270) clockwise:NO]]; + pt.y += cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + break; + + case MGCornersPositionLeadingHorizontal: // left of screen for a top/bottom split + pt.x = 0; + pt.y = cornerRadius; + [path moveToPoint:pt]; + pt.y -= cornerRadius; + [path addLineToPoint:pt]; + pt.x += cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(180) endAngle:(float)deg2Rad(270) clockwise:NO]]; + pt.y += cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + pt.x = 0; + pt.y = maxY - cornerRadius; + [path moveToPoint:pt]; + pt.y = maxY; + [path addLineToPoint:pt]; + pt.x += cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(180) endAngle:(float)deg2Rad(90) clockwise:YES]]; + pt.y -= cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + break; + + case MGCornersPositionTrailingHorizontal: // right of screen for a top/bottom split + pt.y = cornerRadius; + [path moveToPoint:pt]; + pt.y -= cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(270) endAngle:(float)deg2Rad(360) clockwise:NO]]; + pt.x += cornerRadius; + pt.y += cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + pt.y = maxY - cornerRadius; + [path moveToPoint:pt]; + pt.y += cornerRadius; + [path appendPath:[UIBezierPath bezierPathWithArcCenter:pt radius:cornerRadius startAngle:(float)deg2Rad(90) endAngle:0 clockwise:YES]]; + pt.x += cornerRadius; + pt.y -= cornerRadius; + [path addLineToPoint:pt]; + pt.x -= cornerRadius; + [path addLineToPoint:pt]; + [path closePath]; + + break; + + default: + break; + } + + [self.cornerBackgroundColor set]; + [path fill]; + } } @@ -179,38 +186,37 @@ - (void)setCornerRadius:(float)newRadius { - if (newRadius != cornerRadius) { - cornerRadius = newRadius; - [self setNeedsDisplay]; - } + if (newRadius != cornerRadius) { + cornerRadius = newRadius; + [self setNeedsDisplay]; + } } - (void)setSplitViewController:(MGSplitViewController *)theController { - if (theController != splitViewController) { - splitViewController = theController; - [self setNeedsDisplay]; - } + if (theController != splitViewController) { + splitViewController = theController; + [self setNeedsDisplay]; + } } - (void)setCornersPosition:(MGCornersPosition)posn { - if (cornersPosition != posn) { - cornersPosition = posn; - [self setNeedsDisplay]; - } + if (cornersPosition != posn) { + cornersPosition = posn; + [self setNeedsDisplay]; + } } - (void)setCornerBackgroundColor:(UIColor *)color { - if (color != cornerBackgroundColor) { - [cornerBackgroundColor release]; - cornerBackgroundColor = [color retain]; - [self setNeedsDisplay]; - } + if (color != cornerBackgroundColor) { + cornerBackgroundColor = color; + [self setNeedsDisplay]; + } } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.h --- a/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.h Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.h Thu Sep 10 18:22:52 2015 +0200 @@ -10,11 +10,11 @@ @class MGSplitViewController; @interface MGSplitDividerView : UIView { - MGSplitViewController *splitViewController; - BOOL allowsDragging; + MGSplitViewController *__unsafe_unretained splitViewController; + BOOL allowsDragging; } -@property (nonatomic, assign) MGSplitViewController *splitViewController; // weak ref. +@property (nonatomic, unsafe_unretained) MGSplitViewController *splitViewController; // weak ref. @property (nonatomic, assign) BOOL allowsDragging; - (void)drawGripThumbInRect:(CGRect)rect; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.m --- a/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitDividerView.m Thu Sep 10 18:22:52 2015 +0200 @@ -19,18 +19,19 @@ - (id)initWithFrame:(CGRect)frame { - if ((self = [super initWithFrame:frame])) { - self.userInteractionEnabled = NO; - self.allowsDragging = NO; - self.contentMode = UIViewContentModeRedraw; - } - return self; + if ((self = [super initWithFrame:frame])) { + self.userInteractionEnabled = NO; + self.allowsDragging = NO; + self.contentMode = UIViewContentModeRedraw; + } + return self; } - (void)dealloc { - self.splitViewController = nil; + self.splitViewController = nil; + [super dealloc]; } @@ -41,139 +42,139 @@ - (void)drawRect:(CGRect)rect { - if (splitViewController.dividerStyle == MGSplitViewDividerStyleThin) { - [super drawRect:rect]; - - } else if (splitViewController.dividerStyle == MGSplitViewDividerStylePaneSplitter) { - // Draw gradient background. - CGRect bounds = self.bounds; - CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); - CGFloat locations[2] = {0, 1}; - CGFloat components[8] = { 0.988, 0.988, 0.988, 1.0, // light - 0.875, 0.875, 0.875, 1.0 };// dark - CGGradientRef gradient = CGGradientCreateWithColorComponents (rgb, components, locations, 2); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGPoint start, end; - if (splitViewController.vertical) { - // Light left to dark right. - start = CGPointMake(CGRectGetMinX(bounds), CGRectGetMidY(bounds)); - end = CGPointMake(CGRectGetMaxX(bounds), CGRectGetMidY(bounds)); - } else { - // Light top to dark bottom. - start = CGPointMake(CGRectGetMidX(bounds), CGRectGetMinY(bounds)); - end = CGPointMake(CGRectGetMidX(bounds), CGRectGetMaxY(bounds)); - } - CGContextDrawLinearGradient(context, gradient, start, end, 0); - CGColorSpaceRelease(rgb); - CGGradientRelease(gradient); - - // Draw borders. - float borderThickness = 1.0; - [[UIColor colorWithWhite:0.7 alpha:1.0] set]; - CGRect borderRect = bounds; - if (splitViewController.vertical) { - borderRect.size.width = borderThickness; - UIRectFill(borderRect); - borderRect.origin.x = CGRectGetMaxX(bounds) - borderThickness; - UIRectFill(borderRect); - - } else { - borderRect.size.height = borderThickness; - UIRectFill(borderRect); - borderRect.origin.y = CGRectGetMaxY(bounds) - borderThickness; - UIRectFill(borderRect); - } - - // Draw grip. - [self drawGripThumbInRect:bounds]; - } + if (splitViewController.dividerStyle == MGSplitViewDividerStyleThin) { + [super drawRect:rect]; + + } else if (splitViewController.dividerStyle == MGSplitViewDividerStylePaneSplitter) { + // Draw gradient background. + CGRect bounds = self.bounds; + CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); + CGFloat locations[2] = {0, 1}; + CGFloat components[8] = { 0.988f, 0.988f, 0.988f, 1.0, // light + 0.875, 0.875, 0.875, 1.0 };// dark + CGGradientRef gradient = CGGradientCreateWithColorComponents (rgb, components, locations, 2); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGPoint start, end; + if (splitViewController.vertical) { + // Light left to dark right. + start = CGPointMake(CGRectGetMinX(bounds), CGRectGetMidY(bounds)); + end = CGPointMake(CGRectGetMaxX(bounds), CGRectGetMidY(bounds)); + } else { + // Light top to dark bottom. + start = CGPointMake(CGRectGetMidX(bounds), CGRectGetMinY(bounds)); + end = CGPointMake(CGRectGetMidX(bounds), CGRectGetMaxY(bounds)); + } + CGContextDrawLinearGradient(context, gradient, start, end, 0); + CGColorSpaceRelease(rgb); + CGGradientRelease(gradient); + + // Draw borders. + float borderThickness = 1.0; + [[UIColor colorWithWhite:0.7f alpha:1.0] set]; + CGRect borderRect = bounds; + if (splitViewController.vertical) { + borderRect.size.width = borderThickness; + UIRectFill(borderRect); + borderRect.origin.x = CGRectGetMaxX(bounds) - borderThickness; + UIRectFill(borderRect); + + } else { + borderRect.size.height = borderThickness; + UIRectFill(borderRect); + borderRect.origin.y = CGRectGetMaxY(bounds) - borderThickness; + UIRectFill(borderRect); + } + + // Draw grip. + [self drawGripThumbInRect:bounds]; + } } - (void)drawGripThumbInRect:(CGRect)rect { - float width = 9.0; - float height; - if (splitViewController.vertical) { - height = 30.0; - } else { - height = width; - width = 30.0; - } - - // Draw grip in centred in rect. - CGRect gripRect = CGRectMake(0, 0, width, height); - gripRect.origin.x = ((rect.size.width - gripRect.size.width) / 2.0); - gripRect.origin.y = ((rect.size.height - gripRect.size.height) / 2.0); - - float stripThickness = 1.0; - UIColor *stripColor = [UIColor colorWithWhite:0.35 alpha:1.0]; - UIColor *lightColor = [UIColor colorWithWhite:1.0 alpha:1.0]; - float space = 3.0; - if (splitViewController.vertical) { - gripRect.size.width = stripThickness; - [stripColor set]; - UIRectFill(gripRect); - - gripRect.origin.x += stripThickness; - gripRect.origin.y += 1; - [lightColor set]; - UIRectFill(gripRect); - gripRect.origin.x -= stripThickness; - gripRect.origin.y -= 1; - - gripRect.origin.x += space + stripThickness; - [stripColor set]; - UIRectFill(gripRect); - - gripRect.origin.x += stripThickness; - gripRect.origin.y += 1; - [lightColor set]; - UIRectFill(gripRect); - gripRect.origin.x -= stripThickness; - gripRect.origin.y -= 1; - - gripRect.origin.x += space + stripThickness; - [stripColor set]; - UIRectFill(gripRect); - - gripRect.origin.x += stripThickness; - gripRect.origin.y += 1; - [lightColor set]; - UIRectFill(gripRect); - - } else { - gripRect.size.height = stripThickness; - [stripColor set]; - UIRectFill(gripRect); - - gripRect.origin.y += stripThickness; - gripRect.origin.x -= 1; - [lightColor set]; - UIRectFill(gripRect); - gripRect.origin.y -= stripThickness; - gripRect.origin.x += 1; - - gripRect.origin.y += space + stripThickness; - [stripColor set]; - UIRectFill(gripRect); - - gripRect.origin.y += stripThickness; - gripRect.origin.x -= 1; - [lightColor set]; - UIRectFill(gripRect); - gripRect.origin.y -= stripThickness; - gripRect.origin.x += 1; - - gripRect.origin.y += space + stripThickness; - [stripColor set]; - UIRectFill(gripRect); - - gripRect.origin.y += stripThickness; - gripRect.origin.x -= 1; - [lightColor set]; - UIRectFill(gripRect); - } + float width = 9.0; + float height; + if (splitViewController.vertical) { + height = 30.0; + } else { + height = width; + width = 30.0; + } + + // Draw grip in centred in rect. + CGRect gripRect = CGRectMake(0, 0, width, height); + gripRect.origin.x = ((rect.size.width - gripRect.size.width) / 2.f); + gripRect.origin.y = ((rect.size.height - gripRect.size.height) / 2.f); + + float stripThickness = 1.0; + UIColor *stripColor = [UIColor colorWithWhite:0.35f alpha:1.0]; + UIColor *lightColor = [UIColor colorWithWhite:1.0 alpha:1.0]; + float space = 3.0; + if (splitViewController.vertical) { + gripRect.size.width = stripThickness; + [stripColor set]; + UIRectFill(gripRect); + + gripRect.origin.x += stripThickness; + gripRect.origin.y += 1; + [lightColor set]; + UIRectFill(gripRect); + gripRect.origin.x -= stripThickness; + gripRect.origin.y -= 1; + + gripRect.origin.x += space + stripThickness; + [stripColor set]; + UIRectFill(gripRect); + + gripRect.origin.x += stripThickness; + gripRect.origin.y += 1; + [lightColor set]; + UIRectFill(gripRect); + gripRect.origin.x -= stripThickness; + gripRect.origin.y -= 1; + + gripRect.origin.x += space + stripThickness; + [stripColor set]; + UIRectFill(gripRect); + + gripRect.origin.x += stripThickness; + gripRect.origin.y += 1; + [lightColor set]; + UIRectFill(gripRect); + + } else { + gripRect.size.height = stripThickness; + [stripColor set]; + UIRectFill(gripRect); + + gripRect.origin.y += stripThickness; + gripRect.origin.x -= 1; + [lightColor set]; + UIRectFill(gripRect); + gripRect.origin.y -= stripThickness; + gripRect.origin.x += 1; + + gripRect.origin.y += space + stripThickness; + [stripColor set]; + UIRectFill(gripRect); + + gripRect.origin.y += stripThickness; + gripRect.origin.x -= 1; + [lightColor set]; + UIRectFill(gripRect); + gripRect.origin.y -= stripThickness; + gripRect.origin.x += 1; + + gripRect.origin.y += space + stripThickness; + [stripColor set]; + UIRectFill(gripRect); + + gripRect.origin.y += stripThickness; + gripRect.origin.x -= 1; + [lightColor set]; + UIRectFill(gripRect); + } } @@ -183,16 +184,16 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - UITouch *touch = [touches anyObject]; - if (touch) { - CGPoint lastPt = [touch previousLocationInView:self]; - CGPoint pt = [touch locationInView:self]; - float offset = (splitViewController.vertical) ? pt.x - lastPt.x : pt.y - lastPt.y; - if (!splitViewController.masterBeforeDetail) { - offset = -offset; - } - splitViewController.splitPosition = splitViewController.splitPosition + offset; - } + UITouch *touch = [touches anyObject]; + if (touch) { + CGPoint lastPt = [touch previousLocationInView:self]; + CGPoint pt = [touch locationInView:self]; + float offset = (splitViewController.vertical) ? pt.x - lastPt.x : pt.y - lastPt.y; + if (!splitViewController.masterBeforeDetail) { + offset = -offset; + } + splitViewController.splitPosition = splitViewController.splitPosition + offset; + } } @@ -202,10 +203,10 @@ - (void)setAllowsDragging:(BOOL)flag { - if (flag != allowsDragging) { - allowsDragging = flag; - self.userInteractionEnabled = allowsDragging; - } + if (flag != allowsDragging) { + allowsDragging = flag; + self.userInteractionEnabled = allowsDragging; + } } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.h --- a/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.h Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.h Thu Sep 10 18:22:52 2015 +0200 @@ -9,31 +9,32 @@ #import typedef enum _MGSplitViewDividerStyle { - // These names have been chosen to be conceptually similar to those of NSSplitView on Mac OS X. - MGSplitViewDividerStyleThin = 0, // Thin divider, like UISplitViewController (default). - MGSplitViewDividerStylePaneSplitter = 1 // Thick divider, drawn with a grey gradient and a grab-strip. + // These names have been chosen to be conceptually similar to those of NSSplitView on Mac OS X. + MGSplitViewDividerStyleThin = 0, // Thin divider, like UISplitViewController (default). + MGSplitViewDividerStylePaneSplitter = 1 // Thick divider, drawn with a grey gradient and a grab-strip. } MGSplitViewDividerStyle; @class MGSplitDividerView; @protocol MGSplitViewControllerDelegate; @interface MGSplitViewController : UIViewController { - BOOL _showsMasterInPortrait; - BOOL _showsMasterInLandscape; - float _splitWidth; - id _delegate; - BOOL _vertical; - BOOL _masterBeforeDetail; - NSMutableArray *_viewControllers; - UIBarButtonItem *_barButtonItem; // To be compliant with wacky UISplitViewController behaviour. + BOOL _showsMasterInPortrait; + BOOL _showsMasterInLandscape; + float _splitWidth; + id _delegate; + BOOL _vertical; + BOOL _masterBeforeDetail; + NSMutableArray *_viewControllers; + UIBarButtonItem *_barButtonItem; // To be compliant with wacky UISplitViewController behaviour. UIPopoverController *_hiddenPopoverController; // Popover used to hold the master view if it's not always visible. - MGSplitDividerView *_dividerView; // View that draws the divider between the master and detail views. - NSArray *_cornerViews; // Views to draw the inner rounded corners between master and detail views. - float _splitPosition; - BOOL _reconfigurePopup; - MGSplitViewDividerStyle _dividerStyle; // Meta-setting which configures several aspects of appearance and behaviour. + MGSplitDividerView *_dividerView; // View that draws the divider between the master and detail views. + NSArray *_cornerViews; // Views to draw the inner rounded corners between master and detail views. + float _splitPosition; + BOOL _reconfigurePopup; + MGSplitViewDividerStyle _dividerStyle; // Meta-setting which configures several aspects of appearance and behaviour. + BOOL togglesMasterPopover; } -@property (nonatomic, assign) IBOutlet id delegate; +@property (nonatomic, unsafe_unretained) IBOutlet id delegate; @property (nonatomic, assign) BOOL showsMasterInPortrait; // applies to both portrait orientations (default NO) @property (nonatomic, assign) BOOL showsMasterInLandscape; // applies to both landscape orientations (default YES) @property (nonatomic, assign, getter=isVertical) BOOL vertical; // if NO, split is horizontal, i.e. master above detail (default YES) @@ -43,31 +44,34 @@ @property (nonatomic, assign) BOOL allowsDraggingDivider; // whether to let the user drag the divider to alter the split position (default NO). @property (nonatomic, copy) NSArray *viewControllers; // array of UIViewControllers; master is at index 0, detail is at index 1. -@property (nonatomic, retain) IBOutlet UIViewController *masterViewController; // convenience. -@property (nonatomic, retain) IBOutlet UIViewController *detailViewController; // convenience. -@property (nonatomic, retain) MGSplitDividerView *dividerView; // the view which draws the divider/split between master and detail. +@property (nonatomic, strong) IBOutlet UIViewController *masterViewController; // convenience. +@property (nonatomic, strong) IBOutlet UIViewController *detailViewController; // convenience. +@property (nonatomic, strong) MGSplitDividerView *dividerView; // the view which draws the divider/split between master and detail. @property (nonatomic, assign) MGSplitViewDividerStyle dividerStyle; // style (and behaviour) of the divider between master and detail. @property (nonatomic, readonly, getter=isLandscape) BOOL landscape; // returns YES if this view controller is in either of the two Landscape orientations, else NO. +@property (nonatomic, readwrite) BOOL togglesMasterPopover; // default is NO. + // Actions - (IBAction)toggleSplitOrientation:(id)sender; // toggles split axis between vertical (left/right; default) and horizontal (top/bottom). - (IBAction)toggleMasterBeforeDetail:(id)sender; // toggles position of master view relative to detail view. - (IBAction)toggleMasterView:(id)sender; // toggles display of the master view in the current orientation. - (IBAction)showMasterPopover:(id)sender; // shows the master view in a popover spawned from the provided barButtonItem, if it's currently hidden. +- (IBAction)hideMasterPopover:(id)sender; // hides the master view in a popover spawned from the provided barButtonItem, if it's currently shown. - (void)notePopoverDismissed; // should rarely be needed, because you should not change the popover's delegate. If you must, then call this when it's dismissed. // Conveniences for you, because I care. - (BOOL)isShowingMaster; - (void)setSplitPosition:(float)posn animated:(BOOL)animate; // Allows for animation of splitPosition changes. The property's regular setter is not animated. -/* Note: splitPosition is the width (in a left/right split, or height in a top/bottom split) of the master view. - It is relative to the appropriate side of the splitView, which can be any of the four sides depending on the values in isMasterBeforeDetail and isVertical: - isVertical = YES, isMasterBeforeDetail = YES: splitPosition is relative to the LEFT edge. (Default) - isVertical = YES, isMasterBeforeDetail = NO: splitPosition is relative to the RIGHT edge. - isVertical = NO, isMasterBeforeDetail = YES: splitPosition is relative to the TOP edge. - isVertical = NO, isMasterBeforeDetail = NO: splitPosition is relative to the BOTTOM edge. +/* Note: splitPosition is the width (in a left/right split, or height in a top/bottom split) of the master view. + It is relative to the appropriate side of the splitView, which can be any of the four sides depending on the values in isMasterBeforeDetail and isVertical: + isVertical = YES, isMasterBeforeDetail = YES: splitPosition is relative to the LEFT edge. (Default) + isVertical = YES, isMasterBeforeDetail = NO: splitPosition is relative to the RIGHT edge. + isVertical = NO, isMasterBeforeDetail = YES: splitPosition is relative to the TOP edge. + isVertical = NO, isMasterBeforeDetail = NO: splitPosition is relative to the BOTTOM edge. - This implementation was chosen so you don't need to recalculate equivalent splitPositions if the user toggles masterBeforeDetail themselves. + This implementation was chosen so you don't need to recalculate equivalent splitPositions if the user toggles masterBeforeDetail themselves. */ - (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle animated:(BOOL)animate; // Allows for animation of dividerStyle changes. The property's regular setter is not animated. - (NSArray *)cornerViews; @@ -76,8 +80,8 @@ The first view is the "leading" corners (top edge of screen for left/right split, left edge of screen for top/bottom split). The second view is the "trailing" corners (bottom edge of screen for left/right split, right edge of screen for top/bottom split). Do NOT modify them, except to: - 1. Change their .cornerBackgroundColor - 2. Change their .cornerRadius + 1. Change their .cornerBackgroundColor + 2. Change their .cornerRadius */ @end @@ -88,21 +92,26 @@ @optional // Called when a button should be added to a toolbar for a hidden view controller. -- (void)splitViewController:(MGSplitViewController*)svc - willHideViewController:(UIViewController *)aViewController - withBarButtonItem:(UIBarButtonItem*)barButtonItem - forPopoverController: (UIPopoverController*)pc; +- (void)splitViewController:(MGSplitViewController*)svc + willHideViewController:(UIViewController *)aViewController + withBarButtonItem:(UIBarButtonItem*)barButtonItem + forPopoverController: (UIPopoverController*)pc; // Called when the master view is shown again in the split view, invalidating the button and popover controller. -- (void)splitViewController:(MGSplitViewController*)svc - willShowViewController:(UIViewController *)aViewController +- (void)splitViewController:(MGSplitViewController*)svc + willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem; // Called when the master view is shown in a popover, so the delegate can take action like hiding other popovers. -- (void)splitViewController:(MGSplitViewController*)svc - popoverController:(UIPopoverController*)pc +- (void)splitViewController:(MGSplitViewController*)svc + popoverController:(UIPopoverController*)pc willPresentViewController:(UIViewController *)aViewController; +// Called when a popover containing the master view is going to be hidden so the delegate can take action like showing other popovers. This only happens if togglesMasterPopover is set to YES. +- (void)splitViewController:(MGSplitViewController*)svc + popoverController:(UIPopoverController*)pc + willDismissViewController:(UIViewController *)aViewController; + // Called when the split orientation will change (from vertical to horizontal, or vice versa). - (void)splitViewController:(MGSplitViewController*)svc willChangeSplitOrientationToVertical:(BOOL)isVertical; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.m --- a/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MGSplitViewController/MGSplitViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -10,19 +10,18 @@ #import "MGSplitDividerView.h" #import "MGSplitCornersView.h" -#define MG_DEFAULT_SPLIT_POSITION 320.0 // default width of master view in UISplitViewController. -#define MG_DEFAULT_SPLIT_WIDTH 1.0 // default width of split-gutter in UISplitViewController. -#define MG_DEFAULT_CORNER_RADIUS 5.0 // default corner-radius of overlapping split-inner corners on the master and detail views. -#define MG_DEFAULT_CORNER_COLOR [UIColor blackColor] // default color of intruding inner corners (and divider background). +#define MG_DEFAULT_SPLIT_POSITION 320.0 // default width of master view in UISplitViewController. +#define MG_DEFAULT_SPLIT_WIDTH 1.0 // default width of split-gutter in UISplitViewController. +#define MG_DEFAULT_CORNER_RADIUS 5.0 // default corner-radius of overlapping split-inner corners on the master and detail views. +#define MG_DEFAULT_CORNER_COLOR [UIColor blackColor] // default color of intruding inner corners (and divider background). -#define MG_PANESPLITTER_CORNER_RADIUS 0.0 // corner-radius of split-inner corners for MGSplitViewDividerStylePaneSplitter style. -#define MG_PANESPLITTER_SPLIT_WIDTH 25.0 // width of split-gutter for MGSplitViewDividerStylePaneSplitter style. +#define MG_PANESPLITTER_CORNER_RADIUS 0.0 // corner-radius of split-inner corners for MGSplitViewDividerStylePaneSplitter style. +#define MG_PANESPLITTER_SPLIT_WIDTH 25.0 // width of split-gutter for MGSplitViewDividerStylePaneSplitter style. -#define MG_MIN_VIEW_WIDTH 200.0 // minimum width a view is allowed to become as a result of changing the splitPosition. +#define MG_MIN_VIEW_WIDTH 200.0 // minimum width a view is allowed to become as a result of changing the splitPosition. -#define MG_ANIMATION_CHANGE_SPLIT_ORIENTATION @"ChangeSplitOrientation" // Animation ID for internal use. -#define MG_ANIMATION_CHANGE_SUBVIEWS_ORDER @"ChangeSubviewsOrder" // Animation ID for internal use. - +#define MG_ANIMATION_CHANGE_SPLIT_ORIENTATION @"ChangeSplitOrientation" // Animation ID for internal use. +#define MG_ANIMATION_CHANGE_SUBVIEWS_ORDER @"ChangeSubviewsOrder" // Animation ID for internal use. @interface MGSplitViewController (MGPrivateMethods) @@ -48,50 +47,50 @@ - (NSString *)nameOfInterfaceOrientation:(UIInterfaceOrientation)theOrientation { - NSString *orientationName = nil; - switch (theOrientation) { - case UIInterfaceOrientationPortrait: - orientationName = @"Portrait"; // Home button at bottom - break; - case UIInterfaceOrientationPortraitUpsideDown: - orientationName = @"Portrait (Upside Down)"; // Home button at top - break; - case UIInterfaceOrientationLandscapeLeft: - orientationName = @"Landscape (Left)"; // Home button on left - break; - case UIInterfaceOrientationLandscapeRight: - orientationName = @"Landscape (Right)"; // Home button on right - break; - default: - break; - } - - return orientationName; + NSString *orientationName = nil; + switch (theOrientation) { + case UIInterfaceOrientationPortrait: + orientationName = @"Portrait"; // Home button at bottom + break; + case UIInterfaceOrientationPortraitUpsideDown: + orientationName = @"Portrait (Upside Down)"; // Home button at top + break; + case UIInterfaceOrientationLandscapeLeft: + orientationName = @"Landscape (Left)"; // Home button on left + break; + case UIInterfaceOrientationLandscapeRight: + orientationName = @"Landscape (Right)"; // Home button on right + break; + default: + break; + } + + return orientationName; } - (BOOL)isLandscape { - return UIInterfaceOrientationIsLandscape(self.interfaceOrientation); + return UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]); } - (BOOL)shouldShowMasterForInterfaceOrientation:(UIInterfaceOrientation)theOrientation { - // Returns YES if master view should be shown directly embedded in the splitview, instead of hidden in a popover. - return ((UIInterfaceOrientationIsLandscape(theOrientation)) ? _showsMasterInLandscape : _showsMasterInPortrait); + // Returns YES if master view should be shown directly embedded in the splitview, instead of hidden in a popover. + return ((UIInterfaceOrientationIsLandscape(theOrientation)) ? _showsMasterInLandscape : _showsMasterInPortrait); } - (BOOL)shouldShowMaster { - return [self shouldShowMasterForInterfaceOrientation:self.interfaceOrientation]; + return [self shouldShowMasterForInterfaceOrientation:[[UIApplication sharedApplication] statusBarOrientation]]; } - (BOOL)isShowingMaster { - return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); + return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); } @@ -101,60 +100,59 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - [self setup]; - } - - return self; + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + [self setup]; + } + + return self; } - (id)initWithCoder:(NSCoder *)aDecoder { - if ((self = [super initWithCoder:aDecoder])) { - [self setup]; - } - - return self; + if ((self = [super initWithCoder:aDecoder])) { + [self setup]; + } + + return self; } - (void)setup { - // Configure default behaviour. - _viewControllers = [[NSMutableArray alloc] initWithObjects:[NSNull null], [NSNull null], nil]; - _splitWidth = MG_DEFAULT_SPLIT_WIDTH; - _showsMasterInPortrait = NO; - _showsMasterInLandscape = YES; - _reconfigurePopup = NO; - _vertical = YES; - _masterBeforeDetail = YES; - _splitPosition = MG_DEFAULT_SPLIT_POSITION; - CGRect divRect = self.view.bounds; - if ([self isVertical]) { - divRect.origin.y = _splitPosition; - divRect.size.height = _splitWidth; - } else { - divRect.origin.x = _splitPosition; - divRect.size.width = _splitWidth; - } - _dividerView = [[MGSplitDividerView alloc] initWithFrame:divRect]; - _dividerView.splitViewController = self; - _dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR; - _dividerStyle = MGSplitViewDividerStyleThin; + // Configure default behaviour. + _viewControllers = [[NSMutableArray alloc] initWithObjects:[NSNull null], [NSNull null], nil]; + _splitWidth = MG_DEFAULT_SPLIT_WIDTH; + _showsMasterInPortrait = NO; + _showsMasterInLandscape = YES; + _reconfigurePopup = NO; + _vertical = YES; + _masterBeforeDetail = YES; + _splitPosition = MG_DEFAULT_SPLIT_POSITION; + CGRect divRect = self.view.bounds; + if ([self isVertical]) { + divRect.origin.y = _splitPosition; + divRect.size.height = _splitWidth; + } else { + divRect.origin.x = _splitPosition; + divRect.size.width = _splitWidth; + } + _dividerView = [[MGSplitDividerView alloc] initWithFrame:divRect]; + _dividerView.splitViewController = self; + _dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR; + _dividerStyle = MGSplitViewDividerStyleThin; + + // fix for iOS 6 layout + self.view.autoresizesSubviews = NO; } - (void)dealloc { - _delegate = nil; - [self.view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - [_viewControllers release]; - [_barButtonItem release]; - [_hiddenPopoverController release]; - [_dividerView release]; - [_cornerViews release]; - + _delegate = nil; + _viewControllers = nil; + [self.view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + [super dealloc]; } @@ -165,377 +163,370 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if (self.detailViewController) + { + return [self.detailViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } + return YES; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - [self.masterViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; - [self.detailViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; + [self.masterViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; + [self.detailViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { - [self.masterViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; - [self.detailViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + [self.masterViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + [self.detailViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; } -- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - duration:(NSTimeInterval)duration +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation + duration:(NSTimeInterval)duration { - [self.masterViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; - [self.detailViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; - - // Hide popover. - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - // Re-tile views. - _reconfigurePopup = YES; - [self layoutSubviewsForInterfaceOrientation:toInterfaceOrientation withAnimation:YES]; -} - - -- (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - [self.masterViewController willAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; - [self.detailViewController willAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; -} - - -- (void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - [self.masterViewController didAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation]; - [self.detailViewController didAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation]; -} - - -- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration -{ - [self.masterViewController willAnimateSecondHalfOfRotationFromInterfaceOrientation:fromInterfaceOrientation duration:duration]; - [self.detailViewController willAnimateSecondHalfOfRotationFromInterfaceOrientation:fromInterfaceOrientation duration:duration]; + [self.masterViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; + [self.detailViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; + + // Hide popover. + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + // Re-tile views. + _reconfigurePopup = YES; + [self layoutSubviewsForInterfaceOrientation:toInterfaceOrientation withAnimation:YES]; } - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation { - UIScreen *screen = [UIScreen mainScreen]; - CGRect fullScreenRect = screen.bounds; // always implicitly in Portrait orientation. - CGRect appFrame = screen.applicationFrame; - - // Find status bar height by checking which dimension of the applicationFrame is narrower than screen bounds. - // Little bit ugly looking, but it'll still work even if they change the status bar height in future. - float statusBarHeight = MAX((fullScreenRect.size.width - appFrame.size.width), (fullScreenRect.size.height - appFrame.size.height)); - - // Initially assume portrait orientation. - float width = fullScreenRect.size.width; - float height = fullScreenRect.size.height; - - // Correct for orientation. - if (UIInterfaceOrientationIsLandscape(theOrientation)) { - width = height; - height = fullScreenRect.size.width; + UIScreen *screen = [UIScreen mainScreen]; + CGRect fullScreenRect = screen.bounds; // always implicitly in Portrait orientation. + CGRect appFrame = screen.applicationFrame; + + // Find status bar height by checking which dimension of the applicationFrame is narrower than screen bounds. + // Little bit ugly looking, but it'll still work even if they change the status bar height in future. + float statusBarHeight = MAX((fullScreenRect.size.width - appFrame.size.width), (fullScreenRect.size.height - appFrame.size.height)); + + // In iOS 7 the status bar is transparent, so don't adjust for it. + if (NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_7_0) { + statusBarHeight = 0; } - - // Account for status bar, which always subtracts from the height (since it's always at the top of the screen). - height -= statusBarHeight; - - return CGSizeMake(width, height); + + float navigationBarHeight = 0; + if ((self.navigationController)&&(!self.navigationController.navigationBarHidden)) { + navigationBarHeight = self.navigationController.navigationBar.frame.size.height; + } + + // Initially assume portrait orientation. + float width = fullScreenRect.size.width; + float height = fullScreenRect.size.height; + + // Correct for orientation (only for iOS7.1 and earlier, since iOS8 it will do it automatically). + if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1 && UIInterfaceOrientationIsLandscape(theOrientation)) { + width = height; + height = fullScreenRect.size.width; + } + + // Account for status bar, which always subtracts from the height (since it's always at the top of the screen). + height -= statusBarHeight; + height -= navigationBarHeight; + + return CGSizeMake(width, height); } - (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrientation withAnimation:(BOOL)animate { - if (_reconfigurePopup) { - [self reconfigureForMasterInPopover:![self shouldShowMasterForInterfaceOrientation:theOrientation]]; - } - - // Layout the master, detail and divider views appropriately, adding/removing subviews as needed. - // First obtain relevant geometry. - CGSize fullSize = [self splitViewSizeForOrientation:theOrientation]; - float width = fullSize.width; - float height = fullSize.height; - - if (NO) { // Just for debugging. - NSLog(@"Target orientation is %@, dimensions will be %.0f x %.0f", - [self nameOfInterfaceOrientation:theOrientation], width, height); - } - - // Layout the master, divider and detail views. - CGRect newFrame = CGRectMake(0, 0, width, height); - UIViewController *controller; - UIView *theView; - BOOL shouldShowMaster = [self shouldShowMasterForInterfaceOrientation:theOrientation]; - BOOL masterFirst = [self isMasterBeforeDetail]; - if ([self isVertical]) { - // Master on left, detail on right (or vice versa). - CGRect masterRect, dividerRect, detailRect; - if (masterFirst) { - if (!shouldShowMaster) { - // Move off-screen. - newFrame.origin.x -= (_splitPosition + _splitWidth); - } - - newFrame.size.width = _splitPosition; - masterRect = newFrame; - - newFrame.origin.x += newFrame.size.width; - newFrame.size.width = _splitWidth; - dividerRect = newFrame; - - newFrame.origin.x += newFrame.size.width; - newFrame.size.width = width - newFrame.origin.x; - detailRect = newFrame; - - } else { - if (!shouldShowMaster) { - // Move off-screen. - newFrame.size.width += (_splitPosition + _splitWidth); - } - - newFrame.size.width -= (_splitPosition + _splitWidth); - detailRect = newFrame; - - newFrame.origin.x += newFrame.size.width; - newFrame.size.width = _splitWidth; - dividerRect = newFrame; - - newFrame.origin.x += newFrame.size.width; - newFrame.size.width = _splitPosition; - masterRect = newFrame; - } - - // Position master. - controller = self.masterViewController; - if (controller && [controller isKindOfClass:[UIViewController class]]) { - theView = controller.view; - if (theView) { - theView.frame = masterRect; - if (!theView.superview) { - [controller viewWillAppear:NO]; - [self.view addSubview:theView]; - [controller viewDidAppear:NO]; - } - } - } - - // Position divider. - theView = _dividerView; - theView.frame = dividerRect; - if (!theView.superview) { - [self.view addSubview:theView]; - } - - // Position detail. - controller = self.detailViewController; - if (controller && [controller isKindOfClass:[UIViewController class]]) { - theView = controller.view; - if (theView) { - theView.frame = detailRect; - if (!theView.superview) { - [self.view insertSubview:theView aboveSubview:self.masterViewController.view]; - } else { - [self.view bringSubviewToFront:theView]; - } - } - } - - } else { - // Master above, detail below (or vice versa). - CGRect masterRect, dividerRect, detailRect; - if (masterFirst) { - if (!shouldShowMaster) { - // Move off-screen. - newFrame.origin.y -= (_splitPosition + _splitWidth); - } - - newFrame.size.height = _splitPosition; - masterRect = newFrame; - - newFrame.origin.y += newFrame.size.height; - newFrame.size.height = _splitWidth; - dividerRect = newFrame; - - newFrame.origin.y += newFrame.size.height; - newFrame.size.height = height - newFrame.origin.y; - detailRect = newFrame; - - } else { - if (!shouldShowMaster) { - // Move off-screen. - newFrame.size.height += (_splitPosition + _splitWidth); - } - - newFrame.size.height -= (_splitPosition + _splitWidth); - detailRect = newFrame; - - newFrame.origin.y += newFrame.size.height; - newFrame.size.height = _splitWidth; - dividerRect = newFrame; - - newFrame.origin.y += newFrame.size.height; - newFrame.size.height = _splitPosition; - masterRect = newFrame; - } - - // Position master. - controller = self.masterViewController; - if (controller && [controller isKindOfClass:[UIViewController class]]) { - theView = controller.view; - if (theView) { - theView.frame = masterRect; - if (!theView.superview) { - [controller viewWillAppear:NO]; - [self.view addSubview:theView]; - [controller viewDidAppear:NO]; - } - } - } - - // Position divider. - theView = _dividerView; - theView.frame = dividerRect; - if (!theView.superview) { - [self.view addSubview:theView]; - } - - // Position detail. - controller = self.detailViewController; - if (controller && [controller isKindOfClass:[UIViewController class]]) { - theView = controller.view; - if (theView) { - theView.frame = detailRect; - if (!theView.superview) { - [self.view insertSubview:theView aboveSubview:self.masterViewController.view]; - } else { - [self.view bringSubviewToFront:theView]; - } - } - } - } - - // Create corner views if necessary. - MGSplitCornersView *leadingCorners; // top/left of screen in vertical/horizontal split. - MGSplitCornersView *trailingCorners; // bottom/right of screen in vertical/horizontal split. - if (!_cornerViews) { - CGRect cornerRect = CGRectMake(0, 0, 10, 10); // arbitrary, will be resized below. - leadingCorners = [[MGSplitCornersView alloc] initWithFrame:cornerRect]; - leadingCorners.splitViewController = self; - leadingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR; - leadingCorners.cornerRadius = MG_DEFAULT_CORNER_RADIUS; - trailingCorners = [[MGSplitCornersView alloc] initWithFrame:cornerRect]; - trailingCorners.splitViewController = self; - trailingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR; - trailingCorners.cornerRadius = MG_DEFAULT_CORNER_RADIUS; - _cornerViews = [[NSArray alloc] initWithObjects:leadingCorners, trailingCorners, nil]; - [leadingCorners release]; - [trailingCorners release]; - - } else if ([_cornerViews count] == 2) { - leadingCorners = [_cornerViews objectAtIndex:0]; - trailingCorners = [_cornerViews objectAtIndex:1]; - } - - // Configure and layout the corner-views. - leadingCorners.cornersPosition = (_vertical) ? MGCornersPositionLeadingVertical : MGCornersPositionLeadingHorizontal; - trailingCorners.cornersPosition = (_vertical) ? MGCornersPositionTrailingVertical : MGCornersPositionTrailingHorizontal; - leadingCorners.autoresizingMask = (_vertical) ? UIViewAutoresizingFlexibleBottomMargin : UIViewAutoresizingFlexibleRightMargin; - trailingCorners.autoresizingMask = (_vertical) ? UIViewAutoresizingFlexibleTopMargin : UIViewAutoresizingFlexibleLeftMargin; - - float x, y, cornersWidth, cornersHeight; - CGRect leadingRect, trailingRect; - float radius = leadingCorners.cornerRadius; - if (_vertical) { // left/right split - cornersWidth = (radius * 2.0) + _splitWidth; - cornersHeight = radius; - x = ((shouldShowMaster) ? ((masterFirst) ? _splitPosition : width - (_splitPosition + _splitWidth)) : (0 - _splitWidth)) - radius; - y = 0; - leadingRect = CGRectMake(x, y, cornersWidth, cornersHeight); // top corners - trailingRect = CGRectMake(x, (height - cornersHeight), cornersWidth, cornersHeight); // bottom corners - - } else { // top/bottom split - x = 0; - y = ((shouldShowMaster) ? ((masterFirst) ? _splitPosition : height - (_splitPosition + _splitWidth)) : (0 - _splitWidth)) - radius; - cornersWidth = radius; - cornersHeight = (radius * 2.0) + _splitWidth; - leadingRect = CGRectMake(x, y, cornersWidth, cornersHeight); // left corners - trailingRect = CGRectMake((width - cornersWidth), y, cornersWidth, cornersHeight); // right corners - } - - leadingCorners.frame = leadingRect; - trailingCorners.frame = trailingRect; - - // Ensure corners are visible and frontmost. - if (!leadingCorners.superview) { - [self.view insertSubview:leadingCorners aboveSubview:self.detailViewController.view]; - [self.view insertSubview:trailingCorners aboveSubview:self.detailViewController.view]; - } else { - [self.view bringSubviewToFront:leadingCorners]; - [self.view bringSubviewToFront:trailingCorners]; - } + if (_reconfigurePopup) { + [self reconfigureForMasterInPopover:![self shouldShowMasterForInterfaceOrientation:theOrientation]]; + } + + // Layout the master, detail and divider views appropriately, adding/removing subviews as needed. + // First obtain relevant geometry. + CGSize fullSize = [self splitViewSizeForOrientation:theOrientation]; + float width = fullSize.width; + float height = fullSize.height; + + if (NO) { // Just for debugging. + NSLog(@"Target orientation is %@, dimensions will be %.0f x %.0f", + [self nameOfInterfaceOrientation:theOrientation], width, height); + } + + // Layout the master, divider and detail views. + CGRect newFrame = CGRectMake(0, 0, width, height); + UIViewController *controller; + UIView *theView; + BOOL shouldShowMaster = [self shouldShowMasterForInterfaceOrientation:theOrientation]; + BOOL masterFirst = [self isMasterBeforeDetail]; + if ([self isVertical]) { + // Master on left, detail on right (or vice versa). + CGRect masterRect, dividerRect, detailRect; + if (masterFirst) { + if (!shouldShowMaster) { + // Move off-screen. + newFrame.origin.x -= (_splitPosition + _splitWidth); + } + + newFrame.size.width = _splitPosition; + masterRect = newFrame; + + newFrame.origin.x += newFrame.size.width; + newFrame.size.width = _splitWidth; + dividerRect = newFrame; + + newFrame.origin.x += newFrame.size.width; + newFrame.size.width = width - newFrame.origin.x; + detailRect = newFrame; + + } else { + if (!shouldShowMaster) { + // Move off-screen. + newFrame.size.width += (_splitPosition + _splitWidth); + } + + newFrame.size.width -= (_splitPosition + _splitWidth); + detailRect = newFrame; + + newFrame.origin.x += newFrame.size.width; + newFrame.size.width = _splitWidth; + dividerRect = newFrame; + + newFrame.origin.x += newFrame.size.width; + newFrame.size.width = _splitPosition; + masterRect = newFrame; + } + + // Position master. + controller = self.masterViewController; + if (controller && [controller isKindOfClass:[UIViewController class]]) { + theView = controller.view; + if (theView) { + theView.frame = masterRect; + if (!theView.superview) { + [controller viewWillAppear:NO]; + [self.view addSubview:theView]; + [controller viewDidAppear:NO]; + } + } + } + + // Position divider. + theView = _dividerView; + theView.frame = dividerRect; + if (!theView.superview) { + [self.view addSubview:theView]; + } + + // Position detail. + controller = self.detailViewController; + if (controller && [controller isKindOfClass:[UIViewController class]]) { + theView = controller.view; + if (theView) { + theView.frame = detailRect; + if (!theView.superview) { + [self.view insertSubview:theView aboveSubview:self.masterViewController.view]; + } else { + [self.view bringSubviewToFront:theView]; + } + } + } + + } else { + // Master above, detail below (or vice versa). + CGRect masterRect, dividerRect, detailRect; + if (masterFirst) { + if (!shouldShowMaster) { + // Move off-screen. + newFrame.origin.y -= (_splitPosition + _splitWidth); + } + + newFrame.size.height = _splitPosition; + masterRect = newFrame; + + newFrame.origin.y += newFrame.size.height; + newFrame.size.height = _splitWidth; + dividerRect = newFrame; + + newFrame.origin.y += newFrame.size.height; + newFrame.size.height = height - newFrame.origin.y; + detailRect = newFrame; + + } else { + if (!shouldShowMaster) { + // Move off-screen. + newFrame.size.height += (_splitPosition + _splitWidth); + } + + newFrame.size.height -= (_splitPosition + _splitWidth); + detailRect = newFrame; + + newFrame.origin.y += newFrame.size.height; + newFrame.size.height = _splitWidth; + dividerRect = newFrame; + + newFrame.origin.y += newFrame.size.height; + newFrame.size.height = _splitPosition; + masterRect = newFrame; + } + + // Position master. + controller = self.masterViewController; + if (controller && [controller isKindOfClass:[UIViewController class]]) { + theView = controller.view; + if (theView) { + theView.frame = masterRect; + if (!theView.superview) { + [controller viewWillAppear:NO]; + [self.view addSubview:theView]; + [controller viewDidAppear:NO]; + } + } + } + + // Position divider. + theView = _dividerView; + theView.frame = dividerRect; + if (!theView.superview) { + [self.view addSubview:theView]; + } + + // Position detail. + controller = self.detailViewController; + if (controller && [controller isKindOfClass:[UIViewController class]]) { + theView = controller.view; + if (theView) { + theView.frame = detailRect; + if (!theView.superview) { + [self.view insertSubview:theView aboveSubview:self.masterViewController.view]; + } else { + [self.view bringSubviewToFront:theView]; + } + } + } + } + + // Create corner views if necessary. + MGSplitCornersView *leadingCorners = nil; // top/left of screen in vertical/horizontal split. + MGSplitCornersView *trailingCorners = nil; // bottom/right of screen in vertical/horizontal split. + if (!_cornerViews) { + CGRect cornerRect = CGRectMake(0, 0, 10, 10); // arbitrary, will be resized below. + leadingCorners = [[MGSplitCornersView alloc] initWithFrame:cornerRect]; + leadingCorners.splitViewController = self; + leadingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR; + leadingCorners.cornerRadius = NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_7_0 ? 0 : MG_DEFAULT_CORNER_RADIUS; + trailingCorners = [[MGSplitCornersView alloc] initWithFrame:cornerRect]; + trailingCorners.splitViewController = self; + trailingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR; + trailingCorners.cornerRadius = NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_7_0 ? 0 : MG_DEFAULT_CORNER_RADIUS; + _cornerViews = [[NSArray alloc] initWithObjects:leadingCorners, trailingCorners, nil]; + + } else if ([_cornerViews count] == 2) { + leadingCorners = [_cornerViews objectAtIndex:0]; + trailingCorners = [_cornerViews objectAtIndex:1]; + } + + // Configure and layout the corner-views. + leadingCorners.cornersPosition = (_vertical) ? MGCornersPositionLeadingVertical : MGCornersPositionLeadingHorizontal; + trailingCorners.cornersPosition = (_vertical) ? MGCornersPositionTrailingVertical : MGCornersPositionTrailingHorizontal; + leadingCorners.autoresizingMask = (_vertical) ? UIViewAutoresizingFlexibleBottomMargin : UIViewAutoresizingFlexibleRightMargin; + trailingCorners.autoresizingMask = (_vertical) ? UIViewAutoresizingFlexibleTopMargin : UIViewAutoresizingFlexibleLeftMargin; + + float x, y, cornersWidth, cornersHeight; + CGRect leadingRect, trailingRect; + float radius = leadingCorners.cornerRadius; + if (_vertical) { // left/right split + cornersWidth = (radius * 2.f) + _splitWidth; + cornersHeight = radius; + x = ((shouldShowMaster) ? ((masterFirst) ? _splitPosition : width - (_splitPosition + _splitWidth)) : (0 - _splitWidth)) - radius; + y = 0; + leadingRect = CGRectMake(x, y, cornersWidth, cornersHeight); // top corners + trailingRect = CGRectMake(x, (height - cornersHeight), cornersWidth, cornersHeight); // bottom corners + + } else { // top/bottom split + x = 0; + y = ((shouldShowMaster) ? ((masterFirst) ? _splitPosition : height - (_splitPosition + _splitWidth)) : (0 - _splitWidth)) - radius; + cornersWidth = radius; + cornersHeight = (radius * 2.f) + _splitWidth; + leadingRect = CGRectMake(x, y, cornersWidth, cornersHeight); // left corners + trailingRect = CGRectMake((width - cornersWidth), y, cornersWidth, cornersHeight); // right corners + } + + leadingCorners.frame = leadingRect; + trailingCorners.frame = trailingRect; + + // Ensure corners are visible and frontmost. + if (!leadingCorners.superview) { + [self.view insertSubview:leadingCorners aboveSubview:self.detailViewController.view]; + [self.view insertSubview:trailingCorners aboveSubview:self.detailViewController.view]; + } else { + [self.view bringSubviewToFront:leadingCorners]; + [self.view bringSubviewToFront:trailingCorners]; + } } - (void)layoutSubviewsWithAnimation:(BOOL)animate { - [self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:animate]; + [self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:animate]; } - (void)layoutSubviews { - [self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:YES]; + [self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:YES]; } - (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - if ([self isShowingMaster]) { - [self.masterViewController viewWillAppear:animated]; - } - [self.detailViewController viewWillAppear:animated]; - - _reconfigurePopup = YES; - [self layoutSubviews]; + [super viewWillAppear:animated]; + + if ([self isShowingMaster]) { + [self.masterViewController viewWillAppear:animated]; + } + [self.detailViewController viewWillAppear:animated]; + + _reconfigurePopup = YES; } - (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - - if ([self isShowingMaster]) { - [self.masterViewController viewDidAppear:animated]; - } - [self.detailViewController viewDidAppear:animated]; + [super viewDidAppear:animated]; + + if ([self isShowingMaster]) { + [self.masterViewController viewDidAppear:animated]; + } + [self.detailViewController viewDidAppear:animated]; + [self layoutSubviews]; } - (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - - if ([self isShowingMaster]) { - [self.masterViewController viewWillDisappear:animated]; - } - [self.detailViewController viewWillDisappear:animated]; + [super viewWillDisappear:animated]; + + if ([self isShowingMaster]) { + [self.masterViewController viewWillDisappear:animated]; + } + [self.detailViewController viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - - if ([self isShowingMaster]) { - [self.masterViewController viewDidDisappear:animated]; - } - [self.detailViewController viewDidDisappear:animated]; + [super viewDidDisappear:animated]; + + if ([self isShowingMaster]) { + [self.masterViewController viewDidDisappear:animated]; + } + [self.detailViewController viewDidDisappear:animated]; } @@ -545,73 +536,73 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover { - _reconfigurePopup = NO; - - if ((inPopover && _hiddenPopoverController) || (!inPopover && !_hiddenPopoverController) || !self.masterViewController) { - // Nothing to do. - return; - } - - if (inPopover && !_hiddenPopoverController && !_barButtonItem) { - // Create and configure popover for our masterViewController. - [_hiddenPopoverController release]; - _hiddenPopoverController = nil; - [self.masterViewController viewWillDisappear:NO]; - _hiddenPopoverController = [[UIPopoverController alloc] initWithContentViewController:self.masterViewController]; - [self.masterViewController viewDidDisappear:NO]; - - // Create and configure _barButtonItem. - _barButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Master", nil) - style:UIBarButtonItemStyleBordered - target:self - action:@selector(showMasterPopover:)]; - - // Inform delegate of this state of affairs. - if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willHideViewController:withBarButtonItem:forPopoverController:)]) { - [(NSObject *)_delegate splitViewController:self - willHideViewController:self.masterViewController - withBarButtonItem:_barButtonItem - forPopoverController:_hiddenPopoverController]; + _reconfigurePopup = NO; + + if ((inPopover && _hiddenPopoverController) || (!inPopover && !_hiddenPopoverController) || !self.masterViewController) { + // Nothing to do. + return; + } + + if (inPopover && !_hiddenPopoverController && !_barButtonItem) { + // Create and configure popover for our masterViewController. + _hiddenPopoverController = nil; + [self.masterViewController viewWillDisappear:NO]; + _hiddenPopoverController = [[UIPopoverController alloc] initWithContentViewController:self.masterViewController]; + [self.masterViewController viewDidDisappear:NO]; + + // Create and configure _barButtonItem. + _barButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Master", nil) + style:UIBarButtonItemStyleBordered + target:self + action:(self.togglesMasterPopover ? @selector(toggleMasterPopover:) : @selector(showMasterPopover:))]; + + // Inform delegate of this state of affairs. + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willHideViewController:withBarButtonItem:forPopoverController:)]) { + [(NSObject *)_delegate splitViewController:self + willHideViewController:self.masterViewController + withBarButtonItem:_barButtonItem + forPopoverController:_hiddenPopoverController]; + } + + } else if (!inPopover && _hiddenPopoverController && _barButtonItem) { + // I know this looks strange, but it fixes a bizarre issue with UIPopoverController leaving masterViewController's views in disarray. + // It does also break stuff on iOS8, so we disable it. + if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) { + [_hiddenPopoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; } - } else if (!inPopover && _hiddenPopoverController && _barButtonItem) { - // I know this looks strange, but it fixes a bizarre issue with UIPopoverController leaving masterViewController's views in disarray. - [_hiddenPopoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; - - // Remove master from popover and destroy popover, if it exists. - [_hiddenPopoverController dismissPopoverAnimated:NO]; - [_hiddenPopoverController release]; - _hiddenPopoverController = nil; - - // Inform delegate that the _barButtonItem will become invalid. - if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willShowViewController:invalidatingBarButtonItem:)]) { - [(NSObject *)_delegate splitViewController:self - willShowViewController:self.masterViewController - invalidatingBarButtonItem:_barButtonItem]; - } - - // Destroy _barButtonItem. - [_barButtonItem release]; - _barButtonItem = nil; - - // Move master view. - UIView *masterView = self.masterViewController.view; - if (masterView && masterView.superview != self.view) { - [masterView removeFromSuperview]; - } - } + // Remove master from popover and destroy popover, if it exists. + [_hiddenPopoverController dismissPopoverAnimated:NO]; + _hiddenPopoverController = nil; + + // Inform delegate that the _barButtonItem will become invalid. + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willShowViewController:invalidatingBarButtonItem:)]) { + [(NSObject *)_delegate splitViewController:self + willShowViewController:self.masterViewController + invalidatingBarButtonItem:_barButtonItem]; + } + + // Destroy _barButtonItem. + _barButtonItem = nil; + + // Move master view. + UIView *masterView = self.masterViewController.view; + if (masterView && masterView.superview != self.view) { + [masterView removeFromSuperview]; + } + } } - (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController { - [self reconfigureForMasterInPopover:NO]; + [self reconfigureForMasterInPopover:NO]; } - (void)notePopoverDismissed { - [self popoverControllerDidDismissPopover:_hiddenPopoverController]; + [self popoverControllerDidDismissPopover:_hiddenPopoverController]; } @@ -621,14 +612,14 @@ - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { - if (([animationID isEqualToString:MG_ANIMATION_CHANGE_SPLIT_ORIENTATION] || - [animationID isEqualToString:MG_ANIMATION_CHANGE_SUBVIEWS_ORDER]) - && _cornerViews) { - for (UIView *corner in _cornerViews) { - corner.hidden = NO; - } - _dividerView.hidden = NO; - } + if (([animationID isEqualToString:MG_ANIMATION_CHANGE_SPLIT_ORIENTATION] || + [animationID isEqualToString:MG_ANIMATION_CHANGE_SUBVIEWS_ORDER]) + && _cornerViews) { + for (UIView *corner in _cornerViews) { + corner.hidden = NO; + } + _dividerView.hidden = NO; + } } @@ -638,83 +629,131 @@ - (IBAction)toggleSplitOrientation:(id)sender { - BOOL showingMaster = [self isShowingMaster]; - if (showingMaster) { - if (_cornerViews) { - for (UIView *corner in _cornerViews) { - corner.hidden = YES; - } - _dividerView.hidden = YES; - } - [UIView beginAnimations:MG_ANIMATION_CHANGE_SPLIT_ORIENTATION context:nil]; - [UIView setAnimationDelegate:self]; - [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; - } - self.vertical = (!self.vertical); - if (showingMaster) { - [UIView commitAnimations]; - } + BOOL showingMaster = [self isShowingMaster]; + if (showingMaster) { + if (_cornerViews) { + for (UIView *corner in _cornerViews) { + corner.hidden = YES; + } + _dividerView.hidden = YES; + } + [UIView beginAnimations:MG_ANIMATION_CHANGE_SPLIT_ORIENTATION context:nil]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; + } + self.vertical = (!self.vertical); + if (showingMaster) { + [UIView commitAnimations]; + } } - (IBAction)toggleMasterBeforeDetail:(id)sender { - BOOL showingMaster = [self isShowingMaster]; - if (showingMaster) { - if (_cornerViews) { - for (UIView *corner in _cornerViews) { - corner.hidden = YES; - } - _dividerView.hidden = YES; - } - [UIView beginAnimations:MG_ANIMATION_CHANGE_SUBVIEWS_ORDER context:nil]; - [UIView setAnimationDelegate:self]; - [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; - } - self.masterBeforeDetail = (!self.masterBeforeDetail); - if (showingMaster) { - [UIView commitAnimations]; - } + BOOL showingMaster = [self isShowingMaster]; + if (showingMaster) { + if (_cornerViews) { + for (UIView *corner in _cornerViews) { + corner.hidden = YES; + } + _dividerView.hidden = YES; + } + [UIView beginAnimations:MG_ANIMATION_CHANGE_SUBVIEWS_ORDER context:nil]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; + } + self.masterBeforeDetail = (!self.masterBeforeDetail); + if (showingMaster) { + [UIView commitAnimations]; + } } - (IBAction)toggleMasterView:(id)sender { - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - if (![self isShowingMaster]) { - // We're about to show the master view. Ensure it's in place off-screen to be animated in. - _reconfigurePopup = YES; - [self reconfigureForMasterInPopover:NO]; - [self layoutSubviews]; - } - - // This action functions on the current primary orientation; it is independent of the other primary orientation. - [UIView beginAnimations:@"toggleMaster" context:nil]; - if (self.isLandscape) { - self.showsMasterInLandscape = !_showsMasterInLandscape; - } else { - self.showsMasterInPortrait = !_showsMasterInPortrait; - } - [UIView commitAnimations]; + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + if (![self isShowingMaster]) { + // We're about to show the master view. Ensure it's in place off-screen to be animated in. + _reconfigurePopup = YES; + [self reconfigureForMasterInPopover:NO]; + [self layoutSubviews]; + } + + // This action functions on the current primary orientation; it is independent of the other primary orientation. + [UIView beginAnimations:@"toggleMaster" context:nil]; + if (self.isLandscape) { + self.showsMasterInLandscape = !_showsMasterInLandscape; + } else { + self.showsMasterInPortrait = !_showsMasterInPortrait; + } + [UIView commitAnimations]; } -- (IBAction)showMasterPopover:(id) sender +- (void) setTogglesMasterPopover:(BOOL)flag { + + togglesMasterPopover = flag; + + if (!_barButtonItem) + return; + + _barButtonItem.action = flag ? @selector(toggleMasterPopover:) : @selector(showMasterPopover:); + +} + +- (IBAction)toggleMasterPopover:(id)sender { - if (_hiddenPopoverController && !(_hiddenPopoverController.popoverVisible)) { - // Inform delegate. - if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:popoverController:willPresentViewController:)]) { - [(NSObject *)_delegate splitViewController:self - popoverController:_hiddenPopoverController - willPresentViewController:self.masterViewController]; - } + + if (!_hiddenPopoverController) + return; + + if (_hiddenPopoverController.popoverVisible) { + + [self hideMasterPopover:sender]; + + } else { + + [self showMasterPopover:sender]; + + } + +} + - // Show popover. - [_hiddenPopoverController presentPopoverFromBarButtonItem:_barButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; - } +- (IBAction)showMasterPopover:(id)sender +{ + if (_hiddenPopoverController && !(_hiddenPopoverController.popoverVisible)) { + // Inform delegate. + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:popoverController:willPresentViewController:)]) { + [(NSObject *)_delegate splitViewController:self + popoverController:_hiddenPopoverController + willPresentViewController:self.masterViewController]; + } + + // Show popover. + [_hiddenPopoverController presentPopoverFromBarButtonItem:(sender ? sender : _barButtonItem) permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; + } +} + + +- (IBAction)hideMasterPopover:(id)sender +{ + + if(_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:popoverController:willDismissViewController:)]) { + + [(NSObject *)_delegate splitViewController:self popoverController:_hiddenPopoverController willDismissViewController:self.masterViewController]; + + } + + [_hiddenPopoverController dismissPopoverAnimated:YES]; + + } + } @@ -724,395 +763,393 @@ - (id)delegate { - return _delegate; + return _delegate; } - (void)setDelegate:(id )newDelegate { - if (newDelegate != _delegate && - (!newDelegate || [(NSObject *)newDelegate conformsToProtocol:@protocol(MGSplitViewControllerDelegate)])) { - _delegate = newDelegate; - } + if (newDelegate != _delegate && + (!newDelegate || [(NSObject *)newDelegate conformsToProtocol:@protocol(MGSplitViewControllerDelegate)])) { + _delegate = newDelegate; + } } - (BOOL)showsMasterInPortrait { - return _showsMasterInPortrait; + return _showsMasterInPortrait; } - (void)setShowsMasterInPortrait:(BOOL)flag { - if (flag != _showsMasterInPortrait) { - _showsMasterInPortrait = flag; - - if (![self isLandscape]) { // i.e. if this will cause a visual change. - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - // Rearrange views. - _reconfigurePopup = YES; - [self layoutSubviews]; - } - } + if (flag != _showsMasterInPortrait) { + _showsMasterInPortrait = flag; + + if (![self isLandscape]) { // i.e. if this will cause a visual change. + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + // Rearrange views. + _reconfigurePopup = YES; + [self layoutSubviews]; + } + } } - (BOOL)showsMasterInLandscape { - return _showsMasterInLandscape; + return _showsMasterInLandscape; } - (void)setShowsMasterInLandscape:(BOOL)flag { - if (flag != _showsMasterInLandscape) { - _showsMasterInLandscape = flag; - - if ([self isLandscape]) { // i.e. if this will cause a visual change. - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - // Rearrange views. - _reconfigurePopup = YES; - [self layoutSubviews]; - } - } + if (flag != _showsMasterInLandscape) { + _showsMasterInLandscape = flag; + + if ([self isLandscape]) { // i.e. if this will cause a visual change. + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + // Rearrange views. + _reconfigurePopup = YES; + [self layoutSubviews]; + } + } } - (BOOL)isVertical { - return _vertical; + return _vertical; } - (void)setVertical:(BOOL)flag { - if (flag != _vertical) { - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - _vertical = flag; - - // Inform delegate. - if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willChangeSplitOrientationToVertical:)]) { - [_delegate splitViewController:self willChangeSplitOrientationToVertical:_vertical]; - } - - [self layoutSubviews]; - } + if (flag != _vertical) { + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + _vertical = flag; + + // Inform delegate. + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willChangeSplitOrientationToVertical:)]) { + [_delegate splitViewController:self willChangeSplitOrientationToVertical:_vertical]; + } + + [self layoutSubviews]; + } } - (BOOL)isMasterBeforeDetail { - return _masterBeforeDetail; + return _masterBeforeDetail; } - (void)setMasterBeforeDetail:(BOOL)flag { - if (flag != _masterBeforeDetail) { - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - _masterBeforeDetail = flag; - - if ([self isShowingMaster]) { - [self layoutSubviews]; - } - } + if (flag != _masterBeforeDetail) { + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + _masterBeforeDetail = flag; + + if ([self isShowingMaster]) { + [self layoutSubviews]; + } + } } - (float)splitPosition { - return _splitPosition; + return _splitPosition; } - (void)setSplitPosition:(float)posn { - // Check to see if delegate wishes to constrain the position. - float newPosn = posn; - BOOL constrained = NO; - CGSize fullSize = [self splitViewSizeForOrientation:self.interfaceOrientation]; - if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:constrainSplitPosition:splitViewSize:)]) { - newPosn = [_delegate splitViewController:self constrainSplitPosition:newPosn splitViewSize:fullSize]; - constrained = YES; // implicitly trust delegate's response. - - } else { - // Apply default constraints if delegate doesn't wish to participate. - float minPos = MG_MIN_VIEW_WIDTH; - float maxPos = ((_vertical) ? fullSize.width : fullSize.height) - (MG_MIN_VIEW_WIDTH + _splitWidth); - constrained = (newPosn != _splitPosition && newPosn >= minPos && newPosn <= maxPos); - } - - if (constrained) { - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - _splitPosition = newPosn; - - // Inform delegate. - if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willMoveSplitToPosition:)]) { - [_delegate splitViewController:self willMoveSplitToPosition:_splitPosition]; - } - - if ([self isShowingMaster]) { - [self layoutSubviews]; - } - } + // Check to see if delegate wishes to constrain the position. + float newPosn = posn; + BOOL constrained = NO; + CGSize fullSize = [self splitViewSizeForOrientation:self.interfaceOrientation]; + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:constrainSplitPosition:splitViewSize:)]) { + newPosn = [_delegate splitViewController:self constrainSplitPosition:newPosn splitViewSize:fullSize]; + constrained = YES; // implicitly trust delegate's response. + + } else { + // Apply default constraints if delegate doesn't wish to participate. + float minPos = MG_MIN_VIEW_WIDTH; + float maxPos = (float) (((_vertical) ? fullSize.width : fullSize.height) - (MG_MIN_VIEW_WIDTH + _splitWidth)); + constrained = (newPosn != _splitPosition && newPosn >= minPos && newPosn <= maxPos); + } + + if (constrained) { + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + _splitPosition = newPosn; + + // Inform delegate. + if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willMoveSplitToPosition:)]) { + [_delegate splitViewController:self willMoveSplitToPosition:_splitPosition]; + } + + if ([self isShowingMaster]) { + [self layoutSubviews]; + } + } } - (void)setSplitPosition:(float)posn animated:(BOOL)animate { - BOOL shouldAnimate = (animate && [self isShowingMaster]); - if (shouldAnimate) { - [UIView beginAnimations:@"SplitPosition" context:nil]; - } - [self setSplitPosition:posn]; - if (shouldAnimate) { - [UIView commitAnimations]; - } + BOOL shouldAnimate = (animate && [self isShowingMaster]); + if (shouldAnimate) { + [UIView beginAnimations:@"SplitPosition" context:nil]; + } + [self setSplitPosition:posn]; + if (shouldAnimate) { + [UIView commitAnimations]; + } } - (float)splitWidth { - return _splitWidth; + return _splitWidth; } - (void)setSplitWidth:(float)width { - if (width != _splitWidth && width >= 0) { - _splitWidth = width; - if ([self isShowingMaster]) { - [self layoutSubviews]; - } - } + if (width != _splitWidth && width >= 0) { + _splitWidth = width; + if ([self isShowingMaster]) { + [self layoutSubviews]; + } + } } - (NSArray *)viewControllers { - return [[_viewControllers copy] autorelease]; + return [_viewControllers copy]; } - (void)setViewControllers:(NSArray *)controllers { - if (controllers != _viewControllers) { - for (UIViewController *controller in _viewControllers) { - if ([controller isKindOfClass:[UIViewController class]]) { - [controller.view removeFromSuperview]; - } - } - [_viewControllers release]; - _viewControllers = [[NSMutableArray alloc] initWithCapacity:2]; - if (controllers && [controllers count] >= 2) { - self.masterViewController = [controllers objectAtIndex:0]; - self.detailViewController = [controllers objectAtIndex:1]; - } else { - NSLog(@"Error: %@ requires 2 view-controllers. (%@)", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); - } - - [self layoutSubviews]; - } + if (controllers != _viewControllers) { + for (UIViewController *controller in _viewControllers) { + if ([controller isKindOfClass:[UIViewController class]]) { + [controller.view removeFromSuperview]; + } + } + _viewControllers = [[NSMutableArray alloc] initWithCapacity:2]; + if (controllers && [controllers count] >= 2) { + self.masterViewController = [controllers objectAtIndex:0]; + self.detailViewController = [controllers objectAtIndex:1]; + } else { + NSLog(@"Error: %@ requires 2 view-controllers. (%@)", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); + } + + [self layoutSubviews]; + } } - (UIViewController *)masterViewController { - if (_viewControllers && [_viewControllers count] > 0) { - NSObject *controller = [_viewControllers objectAtIndex:0]; - if ([controller isKindOfClass:[UIViewController class]]) { - return [[controller retain] autorelease]; - } - } - - return nil; + if (_viewControllers && [_viewControllers count] > 0) { + UIViewController *controller = (UIViewController *)[_viewControllers objectAtIndex:0]; + if ([controller isKindOfClass:[UIViewController class]]) { + return controller; + } + } + + return nil; } - (void)setMasterViewController:(UIViewController *)master { - if (!_viewControllers) { - _viewControllers = [[NSMutableArray alloc] initWithCapacity:2]; - } - - NSObject *newMaster = master; - if (!newMaster) { - newMaster = [NSNull null]; - } - - BOOL changed = YES; - if ([_viewControllers count] > 0) { - if ([_viewControllers objectAtIndex:0] == newMaster) { - changed = NO; - } else { - [_viewControllers replaceObjectAtIndex:0 withObject:newMaster]; - } - - } else { - [_viewControllers addObject:newMaster]; - } - - if (changed) { - [self layoutSubviews]; - } + if (!_viewControllers) { + _viewControllers = [[NSMutableArray alloc] initWithCapacity:2]; + } + + NSObject *newMaster = master; + if (!newMaster) { + newMaster = [NSNull null]; + } + + BOOL changed = YES; + if ([_viewControllers count] > 0) { + if ([_viewControllers objectAtIndex:0] == newMaster) { + changed = NO; + } else { + [_viewControllers replaceObjectAtIndex:0 withObject:newMaster]; + } + + } else { + [_viewControllers addObject:newMaster]; + } + + if (changed) { + [self layoutSubviews]; + } } - (UIViewController *)detailViewController { - if (_viewControllers && [_viewControllers count] > 1) { - NSObject *controller = [_viewControllers objectAtIndex:1]; - if ([controller isKindOfClass:[UIViewController class]]) { - return [[controller retain] autorelease]; - } - } - - return nil; + if (_viewControllers && [_viewControllers count] > 1) { + UIViewController *controller = (UIViewController *)[_viewControllers objectAtIndex:1]; + if ([controller isKindOfClass:[UIViewController class]]) { + return controller; + } + } + + return nil; } - (void)setDetailViewController:(UIViewController *)detail { - if (!_viewControllers) { - _viewControllers = [[NSMutableArray alloc] initWithCapacity:2]; - [_viewControllers addObject:[NSNull null]]; - } - - BOOL changed = YES; - if ([_viewControllers count] > 1) { - if ([_viewControllers objectAtIndex:1] == detail) { - changed = NO; - } else { - [_viewControllers replaceObjectAtIndex:1 withObject:detail]; - } - - } else { - [_viewControllers addObject:detail]; - } - - if (changed) { - [self layoutSubviews]; - } + if (!_viewControllers) { + _viewControllers = [[NSMutableArray alloc] initWithCapacity:2]; + [_viewControllers addObject:[NSNull null]]; + } + + BOOL changed = YES; + if ([_viewControllers count] > 1) { + if ([_viewControllers objectAtIndex:1] == detail) { + changed = NO; + } else { + [_viewControllers replaceObjectAtIndex:1 withObject:detail]; + } + + } else { + [_viewControllers addObject:detail]; + } + + if (changed) { + [self layoutSubviews]; + } } - (MGSplitDividerView *)dividerView { - return [[_dividerView retain] autorelease]; + return _dividerView; } - (void)setDividerView:(MGSplitDividerView *)divider { - if (divider != _dividerView) { - [_dividerView removeFromSuperview]; - [_dividerView release]; - _dividerView = [divider retain]; - _dividerView.splitViewController = self; - _dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR; - if ([self isShowingMaster]) { - [self layoutSubviews]; - } - } + if (divider != _dividerView) { + [_dividerView removeFromSuperview]; + _dividerView = divider; + _dividerView.splitViewController = self; + _dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR; + if ([self isShowingMaster]) { + [self layoutSubviews]; + } + } } - (BOOL)allowsDraggingDivider { - if (_dividerView) { - return _dividerView.allowsDragging; - } - - return NO; + if (_dividerView) { + return _dividerView.allowsDragging; + } + + return NO; } - (void)setAllowsDraggingDivider:(BOOL)flag { - if (self.allowsDraggingDivider != flag && _dividerView) { - _dividerView.allowsDragging = flag; - } + if (self.allowsDraggingDivider != flag && _dividerView) { + _dividerView.allowsDragging = flag; + } } - (MGSplitViewDividerStyle)dividerStyle { - return _dividerStyle; + return _dividerStyle; } - (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle { - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - // We don't check to see if newStyle equals _dividerStyle, because it's a meta-setting. - // Aspects could have been changed since it was set. - _dividerStyle = newStyle; - - // Reconfigure general appearance and behaviour. - float cornerRadius; - if (_dividerStyle == MGSplitViewDividerStyleThin) { - cornerRadius = MG_DEFAULT_CORNER_RADIUS; - _splitWidth = MG_DEFAULT_SPLIT_WIDTH; - self.allowsDraggingDivider = NO; - - } else if (_dividerStyle == MGSplitViewDividerStylePaneSplitter) { - cornerRadius = MG_PANESPLITTER_CORNER_RADIUS; - _splitWidth = MG_PANESPLITTER_SPLIT_WIDTH; - self.allowsDraggingDivider = YES; - } - - // Update divider and corners. - [_dividerView setNeedsDisplay]; - if (_cornerViews) { - for (MGSplitCornersView *corner in _cornerViews) { - corner.cornerRadius = cornerRadius; - } - } - - // Layout all views. - [self layoutSubviews]; + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + // We don't check to see if newStyle equals _dividerStyle, because it's a meta-setting. + // Aspects could have been changed since it was set. + _dividerStyle = newStyle; + + // Reconfigure general appearance and behaviour. + float cornerRadius = 0.0f; + if (_dividerStyle == MGSplitViewDividerStyleThin) { + cornerRadius = NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_7_0 ? 0 : MG_DEFAULT_CORNER_RADIUS; + _splitWidth = MG_DEFAULT_SPLIT_WIDTH; + self.allowsDraggingDivider = NO; + + } else if (_dividerStyle == MGSplitViewDividerStylePaneSplitter) { + cornerRadius = MG_PANESPLITTER_CORNER_RADIUS; + _splitWidth = MG_PANESPLITTER_SPLIT_WIDTH; + self.allowsDraggingDivider = YES; + } + + // Update divider and corners. + [_dividerView setNeedsDisplay]; + if (_cornerViews) { + for (MGSplitCornersView *corner in _cornerViews) { + corner.cornerRadius = cornerRadius; + } + } + + // Layout all views. + [self layoutSubviews]; } - (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle animated:(BOOL)animate { - BOOL shouldAnimate = (animate && [self isShowingMaster]); - if (shouldAnimate) { - [UIView beginAnimations:@"DividerStyle" context:nil]; - } - [self setDividerStyle:newStyle]; - if (shouldAnimate) { - [UIView commitAnimations]; - } + BOOL shouldAnimate = (animate && [self isShowingMaster]); + if (shouldAnimate) { + [UIView beginAnimations:@"DividerStyle" context:nil]; + } + [self setDividerStyle:newStyle]; + if (shouldAnimate) { + [UIView commitAnimations]; + } } - (NSArray *)cornerViews { - if (_cornerViews) { - return [[_cornerViews retain] autorelease]; - } - - return nil; + if (_cornerViews) { + return _cornerViews; + } + + return nil; } @@ -1120,14 +1157,15 @@ @synthesize showsMasterInLandscape; @synthesize vertical; @synthesize delegate; -@synthesize viewControllers; +@synthesize viewControllers = _viewControllers; @synthesize masterViewController; @synthesize detailViewController; -@synthesize dividerView; +@synthesize dividerView = _dividerView; @synthesize splitPosition; @synthesize splitWidth; @synthesize allowsDraggingDivider; @synthesize dividerStyle; +@synthesize togglesMasterPopover; @end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MXAudioPlayerFadeOperation.m --- a/project_files/HedgewarsMobile/Classes/MXAudioPlayerFadeOperation.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MXAudioPlayerFadeOperation.m Thu Sep 10 18:22:52 2015 +0200 @@ -79,7 +79,8 @@ } - (void)main { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + [NSThread sleepForTimeInterval:_delay]; if ([self.audioPlayer isKindOfClass:[AVAudioPlayer class]]) { [self beginFadeOperation]; @@ -88,7 +89,7 @@ ALog(@"AudioPlayerFadeOperation began with invalid AVAudioPlayer"); } - [pool release]; + } } - (void)beginFadeOperation { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib --- a/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib Thu Sep 10 18:22:52 2015 +0200 @@ -1,34 +1,26 @@ - + - 1056 - 10K549 - 823 - 1038.36 - 461.00 + 1792 + 14E46 + 7706 + 1348.17 + 758.70 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 - - YES - - YES - - - YES - - - - YES + + IBProxyObject + IBUIButton + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + IBFilesOwner IBIPadFramework @@ -38,15 +30,15 @@ IBIPadFramework - + 294 - - YES + 274 {1024, 768} + NO IBIPadFramework @@ -59,34 +51,41 @@ 301 {{383, 389}, {271, 244}} + NO IBIPadFramework 0 0 - - Helvetica-Bold - 15 - 16 - 215 0.0 0.0 0.0 + + 2 + MC45OTYwNzg0OTEyIDAuODAwMDAwMDcxNSAwLjAzOTIxNTY4NzY2AA + 3 MQA - - 2 - MC45OTYwNzg0OTEyIDAuODAwMDAwMDcxNSAwLjAzOTIxNTY4NzY2AA - 3 MC41AA NSImage - localplayButton~ipad.png + localplayButton.png + + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 @@ -94,6 +93,7 @@ 289 {{986, 19}, {18, 19}} + NO YES 0.31690141558647156 @@ -101,15 +101,16 @@ IBIPadFramework 0 0 - 3 YES - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + @@ -121,50 +122,54 @@ IBIPadFramework 0 0 - - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage settingsButton.png + + 268 {{20, 686}, {64, 64}} + NO 4 IBIPadFramework 0 0 - - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage savesButton.png + + 301 {{242, 43}, {540, 300}} + NO IBIPadFramework NSImage - title~ipad.png + title.png @@ -172,57 +177,76 @@ 269 {{565, 686}, {89, 37}} + NO 5 IBIPadFramework 0 0 - 1 - Missions + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + Missions + + 269 {{383, 686}, {89, 37}} + NO 6 IBIPadFramework 0 0 - 1 - Simple + - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + Simple + + - + {1024, 768} - + 1 MCAwIDAAA + darkTextColor + 3 3 + + IBUIScreenMetrics + IBIPadFramework + iPad Full Screen + + YES + + + + + + {768, 1024} + {1024, 768} + + + 1 + IBIPadFramework - + - - YES + view @@ -232,13 +256,20 @@ 3 - - switchViews: - - - 7 + + simpleGameButton + + - 47 + 95 + + + + missionsButton + + + + 96 @@ -252,6 +283,15 @@ switchViews: + + + 7 + + 47 + + + + switchViews: 7 @@ -285,21 +325,19 @@ 94 - + - - YES + 0 - + 1 - - YES + @@ -308,7 +346,7 @@ - + @@ -363,357 +401,46 @@ - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 37.IBPluginDependency - 39.IBPluginDependency - 45.IBPluginDependency - 45.IBViewBoundsToFrameTransform - 52.IBPluginDependency - 52.IBViewBoundsToFrameTransform - 88.IBPluginDependency - 88.IBViewBoundsToFrameTransform - 90.IBPluginDependency - 90.IBViewBoundsToFrameTransform - 91.IBPluginDependency - 91.IBViewBoundsToFrameTransform - 93.IBPluginDependency - 93.IBViewBoundsToFrameTransform - - - YES - MainMenuViewController - UIResponder - {{89, 260}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABERsAAw6cAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABEaQAAxDsAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAxDsAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDbQAAw6qAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABD6gAAxDRAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDuYAAxDRAAA - - - - - YES - - - YES - - - - - YES - - - YES - - - - 94 - - - - YES - - MainMenuViewController - UIViewController - - switchViews: - id - - - switchViews: - - switchViews: - id - - - - IBProjectSource - Classes/MainMenuViewController.h - - - - UIButton - - IBProjectSource - Classes/ExtraCategories.h - - + - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIImageView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIImageView.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - + + MainMenuViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 96 + 0 IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES - ../Hedgewars.xcodeproj 3 - - YES - - YES - background.png - localplayButton~ipad.png - savesButton.png - settingsButton.png - title~ipad.png - - - YES - {1024, 768} - {263, 244} - {64, 64} - {64, 64} - {540, 300} - - - 132 + + {1024, 768} + {263, 244} + {64, 64} + {64, 64} + {540, 300} + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MainMenuViewController-iPhone.xib --- a/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPhone.xib Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPhone.xib Thu Sep 10 18:22:52 2015 +0200 @@ -1,34 +1,26 @@ - + - 1056 - 10K549 - 823 - 1038.36 - 461.00 + 1792 + 14E46 + 7706 + 1348.17 + 758.70 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 - - YES - - YES - - - YES - - - - YES + + IBProxyObject + IBUIButton + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + IBFilesOwner IBCocoaTouchFramework @@ -40,23 +32,24 @@ 293 - - YES + 274 {480, 320} + + 3 MCAwAA - 4 + 2 NO IBCocoaTouchFramework NSImage - background~iphone.png + background.png @@ -64,6 +57,8 @@ 293 {{105, 20}, {270, 150}} + + NO NO 4 @@ -71,14 +66,54 @@ IBCocoaTouchFramework NSImage - title~iphone.png + title.png + + + + + 289 + {{376, 14}, {89, 31}} + + + + NO + 5 + IBCocoaTouchFramework + 0 + 0 + 1 + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + 3 + MQA + + Missions + + 3 + MC41AA + + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 - 289 + 269 {{190, 200}, {100, 100}} + + 1 MCAwIDAgMAA @@ -88,149 +123,137 @@ IBCocoaTouchFramework 0 0 - - Helvetica-Bold - 15 - 16 - - - 3 - MQA - 1 MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - 3 - MC41AA - + + NSImage - localplayButton~iphone.png + localplayButton.png + + - 269 + 265 {{396, 236}, {64, 64}} + NO NO 2 IBCocoaTouchFramework 0 0 - - 1 MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + NSImage settingsButton.png + + - 269 + 268 {{20, 236}, {64, 64}} + + NO NO 4 IBCocoaTouchFramework 0 0 - - 1 MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + NSImage savesButton.png + + 292 {{20, 19}, {18, 19}} + + NO 0.5 3 IBCocoaTouchFramework 0 0 - 3 YES - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + - - - - 292 - {{439, 13}, {29, 31}} - - NO - 5 - IBCocoaTouchFramework - 0 - 0 + - 2 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - + - 292 - {{439, 68}, {29, 31}} + 289 + {{376, 57}, {89, 31}} + + NO 6 IBCocoaTouchFramework 0 0 - - 2 + 1 + - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + Simple + + - + {480, 320} + + 1 MCAwIDAAA + darkTextColor + 3 3 + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + IBCocoaTouchFramework - + - - YES + view @@ -240,13 +263,20 @@ 3 - - switchViews: - - - 7 + + missionsButton + + - 30 + 54 + + + + simpleGameButton + + + + 56 @@ -260,6 +290,15 @@ switchViews: + + + 7 + + 30 + + + + switchViews: 7 @@ -278,45 +317,43 @@ switchViews: - + 7 - 47 + 55 switchViews: - + 7 - 49 + 53 - + - - YES + 0 - + 1 - - YES + - - - + + + @@ -361,103 +398,42 @@ - 46 - + 51 + - 48 - + 52 + - + - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 22.IBPluginDependency - 22.IBViewBoundsToFrameTransform - 23.IBPluginDependency - 23.IBViewBoundsToFrameTransform - 24.IBPluginDependency - 24.IBViewBoundsToFrameTransform - 28.IBPluginDependency - 28.IBViewBoundsToFrameTransform - 41.IBPluginDependency - 41.IBViewBoundsToFrameTransform - 43.IBPluginDependency - 43.IBViewBoundsToFrameTransform - 46.IBPluginDependency - 46.IBViewBoundsToFrameTransform - 48.IBPluginDependency - 48.IBViewBoundsToFrameTransform - - - YES - MainMenuViewController - UIResponder - {{517, 519}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAw5UAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABCygAAwzcAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDPgAAw5UAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDxgAAw5iAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBcAAAwhAAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw5iAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AUPbgABBUAAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABD3gAAwjwAAA - - - - - YES - - - YES - - + + MainMenuViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + {567, 470} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - YES - - + - 49 + 56 - - YES + MainMenuViewController UIViewController @@ -474,124 +450,43 @@ IBProjectSource - Classes/MainMenuViewController.h - - - - UIButton - - IBProjectSource - Classes/ExtraCategories.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h + ../Classes/MainMenuViewController.h - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h + MainMenuViewController + + switchViews: + id - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h + + switchViews: + + switchViews: + id + - - - NSObject + + UIButton + UIButton + + + + missionsButton + UIButton + + + simpleGameButton + UIButton + + - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h + IBProjectSource + ../Classes/MainMenuViewController.m - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - + + UIButton UIControl @@ -609,6 +504,14 @@ + UIGestureRecognizer + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIGestureRecognizer.h + + + UIImageView UIView @@ -619,7 +522,10 @@ UIResponder NSObject - + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + UISearchBar @@ -639,20 +545,6 @@ UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView UIResponder IBFrameworkSource @@ -661,74 +553,29 @@ UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController UIResponder IBFrameworkSource UIKit.framework/Headers/UIViewController.h - + 0 IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES - ../Hedgewars.xcodeproj 3 - - YES - - YES - background~iphone.png - localplayButton~iphone.png - savesButton.png - settingsButton.png - title~iphone.png - - - YES - {480, 320} - {100, 100} - {64, 64} - {64, 64} - {270, 150} - - - 132 + + {480, 320} + {100, 100} + {64, 64} + {64, 64} + {270, 150} + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MainMenuViewController.m --- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -29,6 +29,10 @@ #import "ServerProtocolNetwork.h" #import "GameInterfaceBridge.h" +@interface MainMenuViewController () +@property (retain, nonatomic) IBOutlet UIButton *simpleGameButton; +@property (retain, nonatomic) IBOutlet UIButton *missionsButton; +@end @implementation MainMenuViewController @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController, @@ -42,7 +46,10 @@ -(void) viewDidLoad { self.view.frame = [[UIScreen mainScreen] safeBounds]; [super viewDidLoad]; - + + [self.simpleGameButton applyDarkBlueQuickStyle]; + [self.missionsButton applyDarkBlueQuickStyle]; + // get the app's version NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey]; @@ -71,7 +78,7 @@ self.restoreViewController = restored; [restored release]; } - [self performSelector:@selector(presentModalViewController:animated:) withObject:self.restoreViewController afterDelay:0.25]; + [self performSelector:@selector(presentViewController:) withObject:self.restoreViewController afterDelay:0.25]; } else { // let's not prompt for rating when app crashed >_> [Appirater appLaunched]; @@ -82,6 +89,11 @@ */ } +- (void) presentViewController:(UIViewController *)vc +{ + [self presentViewController:vc animated:NO completion:nil]; +} + -(void) viewWillAppear:(BOOL)animated { [[AudioManagerController mainManager] playBackgroundMusic]; [super viewWillAppear:animated]; @@ -105,7 +117,7 @@ self.gameConfigViewController = gcvc; [gcvc release]; } - [self presentModalViewController:self.gameConfigViewController animated:YES]; + [self presentViewController:self.gameConfigViewController animated:YES completion:nil]; break; case 2: if (nil == self.settingsViewController) { @@ -114,7 +126,7 @@ self.settingsViewController = svrc; [svrc release]; } - [self presentModalViewController:self.settingsViewController animated:YES]; + [self presentViewController:self.settingsViewController animated:YES completion:nil]; break; case 3: #ifdef DEBUG @@ -122,7 +134,7 @@ debugStr = [[NSString alloc] initWithContentsOfFile:DEBUG_FILE()]; else debugStr = [[NSString alloc] initWithString:@"Here be log"]; - UITextView *scroll = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)]; + UITextView *scroll = [[UITextView alloc] initWithFrame:self.view.frame]; scroll.text = debugStr; [debugStr release]; scroll.editable = NO; @@ -131,7 +143,7 @@ UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; [btn addTarget:scroll action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchUpInside]; [btn addTarget:btn action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchUpInside]; - btn.frame = CGRectMake(self.view.frame.size.height-58, -6, 64, 64); + btn.frame = CGRectMake(self.view.frame.size.width-58, -6, 64, 64); btn.backgroundColor = [UIColor blackColor]; btn.titleLabel.textColor = [UIColor whiteColor]; btn.titleLabel.textAlignment = UITextAlignmentCenter; @@ -160,7 +172,7 @@ self.aboutViewController = about; [about release]; } - [self presentModalViewController:self.aboutViewController animated:YES]; + [self presentViewController:self.aboutViewController animated:YES completion:nil]; #endif break; case 4: @@ -172,7 +184,7 @@ self.savedGamesViewController = savedgames; [savedgames release]; } - [self presentModalViewController:self.savedGamesViewController animated:YES]; + [self presentViewController:self.savedGamesViewController animated:YES completion:nil]; break; case 5: if (nil == self.missionsViewController) { @@ -184,7 +196,7 @@ self.missionsViewController = missions; [missions release]; } - [self presentModalViewController:self.missionsViewController animated:YES]; + [self presentViewController:self.missionsViewController animated:YES completion:nil]; break; case 6: [GameInterfaceBridge registerCallingController:self]; @@ -238,6 +250,8 @@ releaseAndNil(savedGamesViewController); releaseAndNil(restoreViewController); releaseAndNil(missionsViewController); + [_simpleGameButton release]; + [_missionsButton release]; [super dealloc]; } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MapConfigViewController-iPhone.xib --- a/project_files/HedgewarsMobile/Classes/MapConfigViewController-iPhone.xib Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController-iPhone.xib Thu Sep 10 18:22:52 2015 +0200 @@ -1,34 +1,30 @@ - + - 1056 - 10K549 - 823 - 1038.36 - 461.00 + 1792 + 14E46 + 7706 + 1348.17 + 758.70 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 - - YES - - YES - - - YES - - - - YES + + IBProxyObject + IBUIButton + IBUIImageView + IBUILabel + IBUISegmentedControl + IBUISlider + IBUITableView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + IBFilesOwner IBCocoaTouchFramework @@ -40,18 +36,19 @@ 274 - - YES + - 292 + 274 {480, 276} + + 2 NO IBCocoaTouchFramework NSImage - background~iphone.png + background.png @@ -59,46 +56,42 @@ 292 {{9, 14}, {270, 30}} + NO IBCocoaTouchFramework 2 4 1 - - YES + Random Map Maze Mission - - - YES + + - - - YES + + - - - YES + + {0, 0} {0, 0} {0, 0} {0, 0} - - - YES + + - + 3 MC42NjY2NjY2NjY3AA @@ -109,17 +102,13 @@ 292 {{71, 196}, {145, 44}} + NO YES 7 NO IBCocoaTouchFramework Loading... - - Helvetica-Bold - 17 - 16 - 2 MC45NDExNzY1MzM3IDAuODE1Njg2MzQ1MSAwAA @@ -128,39 +117,59 @@ 1 10 1 + + Helvetica-Bold + Helvetica + 2 + 17 + + + Helvetica-Bold + 17 + 16 + + YES 292 {{16, 58}, {256, 128}} + NO IBCocoaTouchFramework 0 0 - - Helvetica-Bold - 15 - 16 + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 3 MQA - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - 3 MC41AA + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + 274 {{284, 0}, {196, 276}} + 3 MCAwAA @@ -183,6 +192,7 @@ 292 {{52, 239}, {184, 23}} + NO IBCocoaTouchFramework 0 @@ -190,20 +200,26 @@ 0.05000000074505806 0.05000000074505806 - + {480, 276} + + YES + 3 3 + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + IBCocoaTouchFramework - + - - YES + view @@ -229,6 +245,39 @@ 16 + + segmentedControl + + + + 21 + + + + tableView + + + + 32 + + + + slider + + + + 38 + + + + segmentedControlChanged: + + + 13 + + 22 + + sliderChanged: @@ -248,47 +297,6 @@ - segmentedControl - - - - 21 - - - - segmentedControlChanged: - - - 13 - - 22 - - - - dataSource - - - - 26 - - - - delegate - - - - 27 - - - - tableView - - - - 32 - - - delegate @@ -306,34 +314,40 @@ - slider - - + dataSource + + - 38 + 26 - + + + delegate + + + + 27 + + - - YES + 0 - + 1 - - YES + - + @@ -360,9 +374,7 @@ 25 - - YES - + Table View (Themes) @@ -381,343 +393,141 @@ - + - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 11.IBPluginDependency - 11.IBViewBoundsToFrameTransform - 25.IBPluginDependency - 25.IBViewBoundsToFrameTransform - 35.IBPluginDependency - 35.IBViewBoundsToFrameTransform - 7.IBPluginDependency - 7.IBViewBoundsToFrameTransform - 8.CustomClassName - 8.IBPluginDependency - 8.IBViewBoundsToFrameTransform - 9.CustomClassName - 9.IBPluginDependency - 9.IBViewBoundsToFrameTransform - - - YES - MapConfigViewController - UIResponder - {{790, 298}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AUKOAABDRAAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDjgAAw4kAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAw4kAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBUAAAwigAAA - - MNEValueTrackingSlider - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABCWAAAw4IAAA - - MapPreviewButtonView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBgAAAwzgAAA - - - - - YES - - - YES - - + + MapConfigViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MNEValueTrackingSlider + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MapPreviewButtonView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - YES - - + 38 - - YES + MNEValueTrackingSlider UISlider IBProjectSource - Classes/MNEValueTrackingSlider.h + ../Classes/MNEValueTrackingSlider.h MapConfigViewController UIViewController - - YES - - YES - mapButtonPressed: - segmentedControlChanged: - sliderChanged: - sliderEndedChanging: - - - YES - id - id - id - id + + id + id + id + id + + + + mapButtonPressed: + id - - - YES - - YES - mapButtonPressed: - segmentedControlChanged: - sliderChanged: - sliderEndedChanging: + + segmentedControlChanged: + id - - YES - - mapButtonPressed: - id - - - segmentedControlChanged: - id - - - sliderChanged: - id - - - sliderEndedChanging: - id - + + sliderChanged: + id + + + sliderEndedChanging: + id - - - YES - - YES - maxLabel - previewButton - segmentedControl - slider - tableView - - - YES - UILabel - MapPreviewButtonView - UISegmentedControl - MNEValueTrackingSlider - UITableView + + + UILabel + MapPreviewButtonView + UISegmentedControl + MNEValueTrackingSlider + UITableView + + + + maxLabel + UILabel - - - YES - - YES - maxLabel - previewButton - segmentedControl - slider - tableView + + previewButton + MapPreviewButtonView + + + segmentedControl + UISegmentedControl - - YES - - maxLabel - UILabel - - - previewButton - MapPreviewButtonView - - - segmentedControl - UISegmentedControl - - - slider - MNEValueTrackingSlider - - - tableView - UITableView - + + slider + MNEValueTrackingSlider - + + tableView + UITableView + + IBProjectSource - Classes/MapConfigViewController.h + ../Classes/MapConfigViewController.h + + + + MapConfigViewController + + id + id + id + id + + + + mapButtonPressed: + id + + + segmentedControlChanged: + id + + + sliderChanged: + id + + + sliderEndedChanging: + id + + + + IBProjectSource + ../Classes/MapConfigViewController.m MapPreviewButtonView UIButton - - delegate - id - - - delegate - - delegate - id - - IBProjectSource - Classes/MapPreviewButtonView.h - - - - UIButton - - IBProjectSource - Classes/ExtraCategories.h - - - - UILabel - - - - UITableView - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h + ../Classes/MapPreviewButtonView.h - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - + + UIButton UIControl @@ -735,6 +545,14 @@ + UIGestureRecognizer + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIGestureRecognizer.h + + + UIImageView UIView @@ -753,7 +571,10 @@ UIResponder NSObject - + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + UIScrollView @@ -805,20 +626,6 @@ UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView UIResponder IBFrameworkSource @@ -827,59 +634,26 @@ UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController UIResponder IBFrameworkSource UIKit.framework/Headers/UIViewController.h - + 0 IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES - ../Hedgewars.xcodeproj 3 - background~iphone.png + background.png {480, 320} - 132 diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MapConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -179,8 +179,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; if (newRow != oldRow) { NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m --- a/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m Thu Sep 10 18:22:52 2015 +0200 @@ -24,6 +24,10 @@ #define INDICATOR_TAG 7654 +@interface MapPreviewButtonView () +@property (nonatomic) NSInteger port; +@end + @implementation MapPreviewButtonView @synthesize delegate; @@ -64,7 +68,7 @@ IPaddress ip; BOOL serverQuit = NO; uint8_t packedMap[128*32]; - int port = [HWUtils randomPort]; + self.port = [HWUtils randomPort]; if (SDLNet_Init() < 0) { DLog(@"SDLNet_Init: %s", SDLNet_GetError()); @@ -72,23 +76,45 @@ } // Resolving the host using NULL make network interface to listen - if (SDLNet_ResolveHost(&ip, NULL, port) < 0) { + if (SDLNet_ResolveHost(&ip, NULL, self.port) < 0) { DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError()); serverQuit = YES; } // Open a connection with the IP provided (listen on the host's port) if (!(sd = SDLNet_TCP_Open(&ip))) { - DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), port); + DLog(@"SDLNet_TCP_Open: %s %ld\n", SDLNet_GetError(), (long)self.port); serverQuit = YES; } - // launch the preview here so that we're sure the tcp channel is open - pthread_t thread_id; - pthread_create(&thread_id, NULL, (void *(*)(void *))GenLandPreview, (void *)port); - pthread_detach(thread_id); - - DLog(@"Waiting for a client on port %d", port); + // launch the preview in background here so that we're sure the tcp channel is open + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{ + NSString *ipcString = [[NSString alloc] initWithFormat:@"%ld", (long)self.port]; + NSString *documentsDirectory = DOCUMENTS_FOLDER(); + + NSMutableArray *gameParameters = [[NSMutableArray alloc] initWithObjects: + @"--internal", + @"--port", ipcString, + @"--user-prefix", documentsDirectory, + @"--landpreview", + nil]; + [ipcString release]; + + int argc = [gameParameters count]; + const char **argv = (const char **)malloc(sizeof(const char*)*argc); + for (int i = 0; i < argc; i++) + argv[i] = strdup([[gameParameters objectAtIndex:i] UTF8String]); + [gameParameters release]; + + RunEngine(argc, argv); + + // cleanup + for (int i = 0; i < argc; i++) + free((void *)argv[i]); + free(argv); + }); + + DLog(@"Waiting for a client on port %ld", (long)self.port); while (!serverQuit) { /* This check the sd if there is a pending connection. * If there is one, accept that, and open a new socket for communicating */ @@ -111,7 +137,7 @@ serverQuit = YES; } } - [HWUtils freePort:port]; + [HWUtils freePort:self.port]; SDLNet_TCP_Close(sd); SDLNet_Quit(); @@ -129,13 +155,14 @@ } -(void) drawingThread { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + uint8_t unpackedMap[128*32*8]; [self engineProtocol:unpackedMap]; // http://developer.apple.com/mac/library/qa/qa2001/qa1037.html CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceGray(); - CGContextRef bitmapImage = CGBitmapContextCreate(unpackedMap, 256, 128, 8, 256, colorspace, kCGImageAlphaNone); + CGContextRef bitmapImage = CGBitmapContextCreate(unpackedMap, 256, 128, 8, 256, colorspace, (CGBitmapInfo)kCGImageAlphaNone); CGColorSpaceRelease(colorspace); CGImageRef previewCGImage = CGBitmapContextCreateImage(bitmapImage); @@ -149,7 +176,7 @@ waitUntilDone:NO]; [previewImage release]; [self performSelectorOnMainThread:@selector(setLabelText:) - withObject:[NSString stringWithFormat:@"%d", maxHogs] + withObject:[NSString stringWithFormat:@"%ld", (long)maxHogs] waitUntilDone:NO]; [self performSelectorOnMainThread:@selector(turnOnWidgets) withObject:nil @@ -157,8 +184,8 @@ [self performSelectorOnMainThread:@selector(removeIndicator) withObject:nil waitUntilDone:NO]; - - [pool release]; + + } } -(void) updatePreviewWithSeed:(NSString *)seed { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPhone.xib --- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPhone.xib Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController-iPhone.xib Thu Sep 10 18:22:52 2015 +0200 @@ -1,34 +1,27 @@ - + - 1056 - 10K549 - 823 - 1038.36 - 461.00 + 1792 + 14E46 + 7706 + 1348.17 + 758.70 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 7703 - - YES - - YES - - - YES - - - - YES + + IBProxyObject + IBUIButton + IBUIImageView + IBUITableView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + IBFilesOwner IBCocoaTouchFramework @@ -40,18 +33,19 @@ 274 - - YES + - 292 + 274 {480, 320} + + 2 NO IBCocoaTouchFramework NSImage - smallerBackground~iphone.png + smallerBackground.png @@ -59,6 +53,7 @@ 274 {{180, 0}, {300, 320}} + 3 MQA @@ -80,6 +75,7 @@ 292 {{11, 19}, {157, 130}} + YES NO IBCocoaTouchFramework @@ -89,20 +85,16 @@ 292 {{57, 245}, {64, 64}} + NO IBCocoaTouchFramework 0 0 - - Helvetica-Bold - 15 - 16 - - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + 3 MC41AA @@ -111,32 +103,46 @@ NSImage backButton.png + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + 292 {{18, 164}, {142, 64}} + NO 1 IBCocoaTouchFramework 0 0 - - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage startGameButton.png + + - + {480, 320} + 3 MQA @@ -145,14 +151,18 @@ + 3 3 + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + IBCocoaTouchFramework - + - - YES + view @@ -163,6 +173,22 @@ + previewImage + + + + 13 + + + + tableView + + + + 14 + + + dataSource @@ -178,22 +204,6 @@ 12 - - previewImage - - - - 13 - - - - tableView - - - - 14 - - buttonPressed: @@ -211,27 +221,25 @@ 20 - + - - YES + 0 - + 1 - - YES + - + @@ -248,9 +256,7 @@ 9 - - YES - + @@ -273,72 +279,28 @@ - + - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 10.IBPluginDependency - 10.IBViewBoundsToFrameTransform - 17.IBPluginDependency - 17.IBViewBoundsToFrameTransform - 18.IBPluginDependency - 18.IBViewBoundsToFrameTransform - 23.IBPluginDependency - 9.IBPluginDependency - 9.IBViewBoundsToFrameTransform - - - YES - MissionTrainingViewController - UIResponder - {{492, 751}, {480, 320}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABAoAAAwwYAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABChAAAw5eAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABB2AAAw2cAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDUAAAw5UAAA - - - - - YES - - - YES - - + + MissionTrainingViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - YES - - + 23 - - YES + MissionTrainingViewController UIViewController @@ -353,173 +315,50 @@ id - - YES - - YES - descriptionLabel - previewImage - tableView + + UILabel + UIImageView + UITableView + + + + descriptionLabel + UILabel - - YES - UILabel - UIImageView - UITableView + + previewImage + UIImageView + + tableView + UITableView + + + + IBProjectSource + ../Classes/MissionTrainingViewController.h - - YES - - YES - descriptionLabel - previewImage - tableView - - - YES - - descriptionLabel - UILabel - - - previewImage - UIImageView - - - tableView - UITableView - + + + MissionTrainingViewController + + buttonPressed: + id + + + buttonPressed: + + buttonPressed: + id IBProjectSource - Classes/MissionTrainingViewController.h - - - - UIButton - - IBProjectSource - Classes/ExtraCategories.h - - - - UILabel - - - - UITableView - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h + ../Classes/MissionTrainingViewController.m - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - + + UIButton UIControl @@ -537,6 +376,14 @@ + UIGestureRecognizer + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIGestureRecognizer.h + + + UIImageView UIView @@ -555,7 +402,10 @@ UIResponder NSObject - + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + UIScrollView @@ -591,20 +441,6 @@ UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView UIResponder IBFrameworkSource @@ -613,70 +449,27 @@ UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController UIResponder IBFrameworkSource UIKit.framework/Headers/UIViewController.h - + 0 IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES - ../Hedgewars.xcodeproj 3 - - YES - - YES - backButton.png - smallerBackground~iphone.png - startGameButton.png - - - YES - {64, 64} - {480, 320} - {142, 64} - - - 132 + + {64, 64} + {480, 320} + {142, 64} + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m --- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -65,7 +65,7 @@ if (button.tag == 0) { [[AudioManagerController mainManager] playBackSound]; - [[self parentViewController] dismissModalViewControllerAnimated:YES]; + [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; } else { [GameInterfaceBridge registerCallingController:self]; [GameInterfaceBridge startMissionGame:self.missionName]; @@ -92,11 +92,18 @@ for (NSUInteger i = 0; i < [self.listOfMissions count]; i++) { NSString *desc = [[self.listOfMissions objectAtIndex:i] stringByDeletingPathExtension]; for (NSString *str in descArray) + { if ([str hasPrefix:desc] && [str hasSuffix:@"\""]) { NSArray *descriptionText = [str componentsSeparatedByString:@"\""]; - [filteredArray insertObject:[descriptionText objectAtIndex:1] atIndex:i]; + [filteredArray addObject:[descriptionText objectAtIndex:1]]; break; } + } + + if ([filteredArray count] == i) + { + [filteredArray addObject:@""]; + } } self.listOfDescriptions = filteredArray; [filteredArray release]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/PascalImports.h --- a/project_files/HedgewarsMobile/Classes/PascalImports.h Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/PascalImports.h Thu Sep 10 18:22:52 2015 +0200 @@ -28,9 +28,8 @@ * that you want to use in your non-Pascal code */ - void Game(const int argc, const char *argv[]); - void GenLandPreview(void); - void LoadLocaleWrapper(const char *filename); + void RunEngine(const int argc, const char *argv[]); + void LoadLocaleWrapper(const char *filepath, const char *filename); void HW_versionInfo(int *protoNum, char **versionStr); void *HW_getSDLWindow(void); diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/RestoreViewController.m --- a/project_files/HedgewarsMobile/Classes/RestoreViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/RestoreViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -32,14 +32,14 @@ if (theButton.tag != 0) { [[AudioManagerController mainManager] playClickSound]; - [GameInterfaceBridge registerCallingController:self.parentViewController]; + [GameInterfaceBridge registerCallingController:self.presentingViewController]; [GameInterfaceBridge startSaveGame:[[NSUserDefaults standardUserDefaults] objectForKey:@"savedGamePath"]]; } else { [[AudioManagerController mainManager] playBackSound]; [defaults setObject:@"" forKey:@"savedGamePath"]; [defaults synchronize]; } - [self.parentViewController dismissModalViewControllerAnimated:YES]; + [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; } -(void) viewDidLoad { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/SavedGamesViewController.m --- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -68,7 +68,7 @@ if (button.tag == 0) { [[AudioManagerController mainManager] playBackSound]; [self.tableView setEditing:NO animated:YES]; - [[self parentViewController] dismissModalViewControllerAnimated:YES]; + [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; } else { NSString *titleStr, *cancelStr, *confirmStr; titleStr = NSLocalizedString(@"Are you reeeeeally sure?", @""); diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -125,6 +125,8 @@ } else { UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"]; UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage]; + background.contentMode = UIViewContentModeScaleAspectFill; + background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [backgroundImage release]; [self.view addSubview:background]; [background release]; @@ -276,8 +278,8 @@ else lastIndexPath = self.lastIndexPath_lu; - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; if (newRow != oldRow) { //TODO: this code works only for a single section table @@ -297,7 +299,7 @@ if ([[settings objectForKey:@"sync_ws"] boolValue]) { for (NSString *str in self.listOfWeapons) { if ([str isEqualToString:self.selectedScheme]) { - int row = [self.listOfSchemes indexOfObject:str]; + NSInteger row = [self.listOfSchemes indexOfObject:str]; self.selectedWeapon = str; self.lastIndexPath_we = [NSIndexPath indexPathForRow:row inSection:1]; break; @@ -320,20 +322,32 @@ self.scriptCommand = [NSString stringWithFormat:@"escript Scripts/Multiplayer/%@",self.selectedScript]; NSString *scheme = [scriptOptions objectAtIndex:0]; - if ([scheme isEqualToString:@"locked"]) { + if ([scheme isEqualToString:@"locked"]) + { self.selectedScheme = @"Default.plist"; [self.topControl setEnabled:NO forSegmentAtIndex:0]; - } else { - self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme]; + } + else + { + if (![scheme isEqualToString:@"*"]) + { + self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme]; + } [self.topControl setEnabled:YES forSegmentAtIndex:0]; } NSString *weapon = [scriptOptions objectAtIndex:1]; - if ([weapon isEqualToString:@"locked"]) { + if ([weapon isEqualToString:@"locked"]) + { self.selectedWeapon = @"Default.plist"; [self.topControl setEnabled:NO forSegmentAtIndex:1]; - } else { - self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon]; + } + else + { + if (![weapon isEqualToString:@"*"]) + { + self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon]; + } [self.topControl setEnabled:YES forSegmentAtIndex:1]; } } diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m --- a/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Thu Sep 10 18:22:52 2015 +0200 @@ -82,7 +82,8 @@ } -(void) serverProtocol { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + IPaddress ip; BOOL clientQuit = NO; char *buffer = (char *)malloc(sizeof(char)*BUFFER_SIZE); @@ -206,7 +207,7 @@ SDLNet_TCP_Close(self.ssd); SDLNet_Quit(); - [pool release]; + } } @end diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m --- a/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -133,7 +133,7 @@ -(void) dismissSplitView { [[AudioManagerController mainManager] playBackSound]; - [[[HedgewarsAppDelegate sharedAppDelegate] mainViewController] dismissModalViewControllerAnimated:YES]; + [[[HedgewarsAppDelegate sharedAppDelegate] mainViewController] dismissViewControllerAnimated:YES completion:nil]; } -(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { @@ -198,8 +198,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; UIViewController *nextController = nil; if (newRow != oldRow) { diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m --- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -190,7 +190,8 @@ [img release]; UILabel *cellLabel = (UILabel *)[cell.contentView viewWithTag:LABEL_TAG]; - cellLabel.text = [[self.basicSettingList objectAtIndex:row] objectForKey:@"title"]; + NSString *basicSettingTitleKey = [[self.basicSettingList objectAtIndex:row] objectForKey:@"title"]; + cellLabel.text = NSLocalizedStringFromTable(basicSettingTitleKey, @"Scheme", nil); cellLabel.adjustsFontSizeToFitWidth = YES; // can't use the viewWithTag method because row is dynamic @@ -221,7 +222,7 @@ cellSlider.frame = CGRectMake(hOffset, vOffset, sliderLength, 23); NSString *prestring = nil; - checkValueString(prestring,cellLabel.text,cellSlider); + checkValueString(prestring,basicSettingTitleKey,cellSlider); // forced to use this weird format otherwise the label disappears when size of the text is bigger than the original while ([prestring length] <= 4) @@ -251,8 +252,10 @@ [image release]; cell.imageView.layer.cornerRadius = 6.0f; cell.imageView.layer.masksToBounds = YES; - cell.textLabel.text = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"title"]; - cell.detailTextLabel.text = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"description"]; + NSString *gameModTitleKey = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"title"]; + cell.textLabel.text = NSLocalizedStringFromTable(gameModTitleKey, @"Scheme", nil); + NSString *gameModDescKey = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"description"]; + cell.detailTextLabel.text = NSLocalizedStringFromTable(gameModDescKey, @"Scheme", nil); cell.detailTextLabel.adjustsFontSizeToFitWidth = YES; cell.detailTextLabel.minimumFontSize = 6; @@ -284,7 +287,7 @@ // save changes in the main array NSMutableArray *array = [self.schemeDictionary objectForKey:@"basic"]; - [array replaceObjectAtIndex:theSlider.tag-SLIDER_TAG withObject:[NSNumber numberWithInt:(NSInteger) theSlider.value]]; + [array replaceObjectAtIndex:theSlider.tag-SLIDER_TAG withObject:[NSNumber numberWithInteger:theSlider.value]]; } #pragma mark - diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m --- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -19,6 +19,10 @@ #import "SingleWeaponViewController.h" +@interface SingleWeaponViewController () +@property (nonatomic, retain) NSString *trPath; +@property (nonatomic, retain) NSString *trFileName; +@end @implementation SingleWeaponViewController @synthesize weaponName, description, ammoStoreImage; @@ -32,9 +36,10 @@ -(void) viewDidLoad { [super viewDidLoad]; - NSString *trFilePath = [NSString stringWithFormat:@"%@/%@.txt",LOCALE_DIRECTORY(),[[NSLocale preferredLanguages] objectAtIndex:0]]; + self.trPath = [NSString stringWithFormat:@"%@", LOCALE_DIRECTORY()]; + self.trFileName = [NSString stringWithFormat:@"%@.txt", [[NSLocale preferredLanguages] firstObject]]; // fill the data structure that we are going to read - LoadLocaleWrapper([trFilePath UTF8String]); + LoadLocaleWrapper([self.trPath UTF8String], [self.trFileName UTF8String]); quantity = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1)); probability = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1)); @@ -261,6 +266,9 @@ -(void) dealloc { + releaseAndNil(_trPath); + releaseAndNil(_trFileName); + releaseAndNil(weaponName); releaseAndNil(description); releaseAndNil(ammoStoreImage); diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/SquareButtonView.m --- a/project_files/HedgewarsMobile/Classes/SquareButtonView.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/SquareButtonView.m Thu Sep 10 18:22:52 2015 +0200 @@ -61,7 +61,7 @@ -(void) selectColor:(NSUInteger) color { if (color != self.selectedColor) { self.selectedColor = color; - self.colorIndex = [self.colorArray indexOfObject:[NSNumber numberWithUnsignedInt:color]]; + self.colorIndex = [self.colorArray indexOfObject:[NSNumber numberWithUnsignedInteger:color]]; self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f green:((color & 0x0000FF00) >> 8)/255.0f diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/StatsPageViewController.m --- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -44,7 +44,9 @@ aTableView.separatorStyle = UITableViewCellSeparatorStyleNone; aTableView.delegate = self; aTableView.dataSource = self; - + + aTableView.rowHeight = 44; + [self.view addSubview:aTableView]; [aTableView release]; @@ -162,7 +164,7 @@ #pragma mark button delegate -(void) dismissView { [[AudioManagerController mainManager] playClickSound]; - [self dismissModalViewControllerAnimated:YES]; + [self dismissViewControllerAnimated:YES completion:nil]; } #pragma mark - diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/TeamConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -45,6 +45,8 @@ } else { UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"]; UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage]; + background.contentMode = UIViewContentModeScaleAspectFill; + background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [backgroundImage release]; [self.view addSubview:background]; [background release]; @@ -245,7 +247,7 @@ SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView; NSInteger increaseNumber = [[selectedRow objectForKey:@"number"] intValue] + 1; - NSNumber *newNumber = [NSNumber numberWithInt:[self filterNumberOfHogs:increaseNumber]]; + NSNumber *newNumber = [NSNumber numberWithInteger:[self filterNumberOfHogs:increaseNumber]]; [squareButton setTitle:[newNumber stringValue] forState:UIControlStateNormal]; [selectedRow setObject:newNumber forKey:@"number"]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/VoicesViewController.m --- a/project_files/HedgewarsMobile/Classes/VoicesViewController.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/VoicesViewController.m Thu Sep 10 18:22:52 2015 +0200 @@ -104,8 +104,8 @@ #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int newRow = [indexPath row]; - int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; + NSInteger newRow = [indexPath row]; + NSInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; if (newRow != oldRow) { [teamDictionary setObject:[voiceArray objectAtIndex:newRow] forKey:@"voicepack"]; diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Classes/WeaponCellView.m --- a/project_files/HedgewarsMobile/Classes/WeaponCellView.m Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/WeaponCellView.m Thu Sep 10 18:22:52 2015 +0200 @@ -200,10 +200,10 @@ crateLab.text = ((int)crateSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)crateSli.value]; [delegate updateValues:[NSArray arrayWithObjects: - [NSNumber numberWithInt:(int)initialSli.value], - [NSNumber numberWithInt:(int)probabilitySli.value], - [NSNumber numberWithInt:(int)delaySli.value], - [NSNumber numberWithInt:(int)crateSli.value], nil] + [NSNumber numberWithInteger:initialSli.value], + [NSNumber numberWithInteger:probabilitySli.value], + [NSNumber numberWithInteger:delaySli.value], + [NSNumber numberWithInteger:crateSli.value], nil] atIndex:self.tag]; } else DLog(@"error - delegate = nil!"); diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Default-568h@2x.png Binary file project_files/HedgewarsMobile/Default-568h@2x.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Thu Sep 10 18:22:52 2015 +0200 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXAggregateTarget section */ @@ -244,6 +244,23 @@ 61F9040B11DF59370068B24D /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040A11DF59370068B24D /* background.png */; }; 61F904D711DF7DA30068B24D /* WeaponCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F904D611DF7DA30068B24D /* WeaponCellView.m */; }; 922F64900F10F53100DC6EC0 /* libfpc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 928301170F10CAFC00CC5A3C /* libfpc.a */; }; + F65724FD1B7E784700A86262 /* helpabove.png in Resources */ = {isa = PBXBuildFile; fileRef = F65724F81B7E784700A86262 /* helpabove.png */; }; + F65724FE1B7E784700A86262 /* helpbottom.png in Resources */ = {isa = PBXBuildFile; fileRef = F65724F91B7E784700A86262 /* helpbottom.png */; }; + F65724FF1B7E784700A86262 /* helpleft.png in Resources */ = {isa = PBXBuildFile; fileRef = F65724FA1B7E784700A86262 /* helpleft.png */; }; + F65725001B7E784700A86262 /* helpplain.png in Resources */ = {isa = PBXBuildFile; fileRef = F65724FB1B7E784700A86262 /* helpplain.png */; }; + F65725011B7E784700A86262 /* helpright.png in Resources */ = {isa = PBXBuildFile; fileRef = F65724FC1B7E784700A86262 /* helpright.png */; }; + F65E1DBF1B9B95A400A78ADF /* Icon-60@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F65E1DBC1B9B95A400A78ADF /* Icon-60@2x.png */; }; + F65E1DC01B9B95A400A78ADF /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = F65E1DBD1B9B95A400A78ADF /* Icon-76.png */; }; + F65E1DC11B9B95A400A78ADF /* Icon-76@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F65E1DBE1B9B95A400A78ADF /* Icon-76@2x.png */; }; + F6D7E09F1B76884E004F3BCF /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F6D7E09E1B76884E004F3BCF /* Default-568h@2x.png */; }; + F6D7E0C21B768F19004F3BCF /* uLandGenPerlin.pas in Sources */ = {isa = PBXBuildFile; fileRef = F6D7E0BF1B768F19004F3BCF /* uLandGenPerlin.pas */; }; + F6D7E0C31B768F19004F3BCF /* uLandGenTemplateBased.pas in Sources */ = {isa = PBXBuildFile; fileRef = F6D7E0C01B768F19004F3BCF /* uLandGenTemplateBased.pas */; }; + F6D7E0C41B768F19004F3BCF /* uLandUtils.pas in Sources */ = {isa = PBXBuildFile; fileRef = F6D7E0C11B768F19004F3BCF /* uLandUtils.pas */; }; + F6D7E0C61B769819004F3BCF /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6D7E0C51B769819004F3BCF /* CoreMotion.framework */; }; + F6D7E0C81B7698BF004F3BCF /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F6D7E0C71B7698BE004F3BCF /* libstdc++.dylib */; }; + F6F07BDE1B7E72D40010E48F /* HelpPageLobbyViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6F07BDA1B7E72D40010E48F /* HelpPageLobbyViewController-iPad.xib */; }; + F6F07BDF1B7E72D40010E48F /* HelpPageLobbyViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6F07BDB1B7E72D40010E48F /* HelpPageLobbyViewController-iPhone.xib */; }; + F6F07BE01B7E72D40010E48F /* HelpPageLobbyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F07BDD1B7E72D40010E48F /* HelpPageLobbyViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXBuildRule section */ @@ -416,9 +433,6 @@ 61177BA7148A658900686905 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = Locale/German.lproj/Localizable.strings; sourceTree = ""; }; 61177BA9148A660C00686905 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = Locale/German.lproj/Scheme.strings; sourceTree = ""; }; 61177BAA148A661600686905 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = Locale/German.lproj/About.strings; sourceTree = ""; }; - 61177BAC148A671600686905 /* Turkish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Turkish; path = Locale/Turkish.lproj/About.strings; sourceTree = ""; }; - 61177BAD148A672000686905 /* Turkish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Turkish; path = Locale/Turkish.lproj/Localizable.strings; sourceTree = ""; }; - 61177BAE148A672C00686905 /* Turkish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Turkish; path = Locale/Turkish.lproj/Scheme.strings; sourceTree = ""; }; 61177BE4148B881C00686905 /* Danish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Danish; path = Locale/Danish.lproj/About.strings; sourceTree = ""; }; 61177BF0148B882500686905 /* Danish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Danish; path = Locale/Danish.lproj/Localizable.strings; sourceTree = ""; }; 61177BF1148B882F00686905 /* Danish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Danish; path = Locale/Danish.lproj/Scheme.strings; sourceTree = ""; }; @@ -695,6 +709,27 @@ 61F904D611DF7DA30068B24D /* WeaponCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WeaponCellView.m; path = Classes/WeaponCellView.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 928301170F10CAFC00CC5A3C /* libfpc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libfpc.a; sourceTree = BUILT_PRODUCTS_DIR; }; + F65724F81B7E784700A86262 /* helpabove.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = helpabove.png; sourceTree = ""; }; + F65724F91B7E784700A86262 /* helpbottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = helpbottom.png; sourceTree = ""; }; + F65724FA1B7E784700A86262 /* helpleft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = helpleft.png; sourceTree = ""; }; + F65724FB1B7E784700A86262 /* helpplain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = helpplain.png; sourceTree = ""; }; + F65724FC1B7E784700A86262 /* helpright.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = helpright.png; sourceTree = ""; }; + F65725291B7EB9CC00A86262 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = Locale/ru.lproj/About.strings; sourceTree = ""; }; + F657252A1B7EB9CC00A86262 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = Locale/ru.lproj/Localizable.strings; sourceTree = ""; }; + F657252B1B7EB9CC00A86262 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = Locale/ru.lproj/Scheme.strings; sourceTree = ""; }; + F65E1DBC1B9B95A400A78ADF /* Icon-60@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-60@2x.png"; path = "Resources/Icons/Icon-60@2x.png"; sourceTree = ""; }; + F65E1DBD1B9B95A400A78ADF /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-76.png"; path = "Resources/Icons/Icon-76.png"; sourceTree = ""; }; + F65E1DBE1B9B95A400A78ADF /* Icon-76@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-76@2x.png"; path = "Resources/Icons/Icon-76@2x.png"; sourceTree = ""; }; + F6D7E09E1B76884E004F3BCF /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + F6D7E0BF1B768F19004F3BCF /* uLandGenPerlin.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandGenPerlin.pas; path = ../../hedgewars/uLandGenPerlin.pas; sourceTree = ""; }; + F6D7E0C01B768F19004F3BCF /* uLandGenTemplateBased.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandGenTemplateBased.pas; path = ../../hedgewars/uLandGenTemplateBased.pas; sourceTree = ""; }; + F6D7E0C11B768F19004F3BCF /* uLandUtils.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandUtils.pas; path = ../../hedgewars/uLandUtils.pas; sourceTree = ""; }; + F6D7E0C51B769819004F3BCF /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + F6D7E0C71B7698BE004F3BCF /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; + F6F07BDA1B7E72D40010E48F /* HelpPageLobbyViewController-iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "HelpPageLobbyViewController-iPad.xib"; sourceTree = ""; }; + F6F07BDB1B7E72D40010E48F /* HelpPageLobbyViewController-iPhone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "HelpPageLobbyViewController-iPhone.xib"; sourceTree = ""; }; + F6F07BDC1B7E72D40010E48F /* HelpPageLobbyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpPageLobbyViewController.h; sourceTree = ""; }; + F6F07BDD1B7E72D40010E48F /* HelpPageLobbyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpPageLobbyViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -702,6 +737,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F6D7E0C81B7698BF004F3BCF /* libstdc++.dylib in Frameworks */, + F6D7E0C61B769819004F3BCF /* CoreMotion.framework in Frameworks */, 617D791E16D933060091D4D6 /* libPhysfs.a in Frameworks */, 617D795716D9345F0091D4D6 /* libPhyslayer.a in Frameworks */, 922F64900F10F53100DC6EC0 /* libfpc.a in Frameworks */, @@ -794,6 +831,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + F6D7E09E1B76884E004F3BCF /* Default-568h@2x.png */, 6129B9F611EFB04D0017E305 /* denied.png */, 6167C88B14294738003DD50F /* denied@2x.png */, 6199E86C12464A8E00DADF8C /* surprise.png */, @@ -822,6 +860,7 @@ 61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */, 61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */, 61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */, + F6D7E0C71B7698BE004F3BCF /* libstdc++.dylib */, 61798934114AB25F00BA94A9 /* AudioToolbox.framework */, 612CABAA1391CE68005E9596 /* AVFoundation.framework */, 61A117FE1168322700359010 /* CoreGraphics.framework */, @@ -833,6 +872,7 @@ 61272338117DF778005B90CF /* MobileCoreServices.framework */, 6199E81512463EA800DADF8C /* CFNetwork.framework */, 6199E81912463EC400DADF8C /* SystemConfiguration.framework */, + F6D7E0C51B769819004F3BCF /* CoreMotion.framework */, ); name = Frameworks; sourceTree = ""; @@ -924,6 +964,10 @@ 616591F311CA9BA200D6E256 /* MapConfigViewController.m */, 6165924D11CA9CB400D6E256 /* MapConfigViewController-iPad.xib */, 6165924E11CA9CB400D6E256 /* MapConfigViewController-iPhone.xib */, + F6F07BDC1B7E72D40010E48F /* HelpPageLobbyViewController.h */, + F6F07BDD1B7E72D40010E48F /* HelpPageLobbyViewController.m */, + F6F07BDA1B7E72D40010E48F /* HelpPageLobbyViewController-iPad.xib */, + F6F07BDB1B7E72D40010E48F /* HelpPageLobbyViewController-iPhone.xib */, ); name = "Game Configuration"; sourceTree = ""; @@ -1120,6 +1164,9 @@ 61F7A43411E290650040BA66 /* Icon-Small@2x.png */, 61F7A43511E290650040BA66 /* Icon.png */, 61F7A43611E290650040BA66 /* Icon@2x.png */, + F65E1DBC1B9B95A400A78ADF /* Icon-60@2x.png */, + F65E1DBD1B9B95A400A78ADF /* Icon-76.png */, + F65E1DBE1B9B95A400A78ADF /* Icon-76@2x.png */, 61F7A43711E290650040BA66 /* iTunesArtwork.png */, ); name = Icons; @@ -1172,6 +1219,7 @@ 6172FEEC1298D25D00D73365 /* smallerBackground@2x~iphone.png */, 6172FEEE1298D25D00D73365 /* smallerBackground~iphone.png */, 6172FEED1298D25D00D73365 /* smallerBackground~ipad.png */, + F65724F71B7E784700A86262 /* Help Bubbles */, ); name = Frontend; sourceTree = ""; @@ -1229,10 +1277,13 @@ 617987FC114AA34C00BA94A9 /* uGears.pas */, 617987FD114AA34C00BA94A9 /* uIO.pas */, 617987FF114AA34C00BA94A9 /* uLand.pas */, + F6D7E0BF1B768F19004F3BCF /* uLandGenPerlin.pas */, + F6D7E0C01B768F19004F3BCF /* uLandGenTemplateBased.pas */, 61798800114AA34C00BA94A9 /* uLandGraphics.pas */, 61798801114AA34C00BA94A9 /* uLandObjects.pas */, 61798802114AA34C00BA94A9 /* uLandTemplates.pas */, 61798803114AA34C00BA94A9 /* uLandTexture.pas */, + F6D7E0C11B768F19004F3BCF /* uLandUtils.pas */, 61798804114AA34C00BA94A9 /* uLocale.pas */, 61798805114AA34C00BA94A9 /* uMisc.pas */, 61798806114AA34C00BA94A9 /* uRandom.pas */, @@ -1247,6 +1298,19 @@ name = "Pascal Sources"; sourceTree = ""; }; + F65724F71B7E784700A86262 /* Help Bubbles */ = { + isa = PBXGroup; + children = ( + F65724F81B7E784700A86262 /* helpabove.png */, + F65724F91B7E784700A86262 /* helpbottom.png */, + F65724FA1B7E784700A86262 /* helpleft.png */, + F65724FB1B7E784700A86262 /* helpplain.png */, + F65724FC1B7E784700A86262 /* helpright.png */, + ); + name = "Help Bubbles"; + path = "Resources/Frontend/Help Bubbles"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1301,9 +1365,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0640; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Hedgewars" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -1319,6 +1384,7 @@ Bulgarian, Portuguese, Romanian, + ru, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; projectDirPath = ""; @@ -1441,11 +1507,14 @@ 61F7A43911E290650040BA66 /* Icon-Small-50.png in Resources */, 61F7A43A11E290650040BA66 /* Icon-Small.png in Resources */, 61F7A43C11E290650040BA66 /* Icon.png in Resources */, + F65724FE1B7E784700A86262 /* helpbottom.png in Resources */, 61F7A43E11E290650040BA66 /* iTunesArtwork.png in Resources */, + F65E1DC11B9B95A400A78ADF /* Icon-76@2x.png in Resources */, 6129B9F711EFB04D0017E305 /* denied.png in Resources */, 61F2E7CF1205EDE0005734F7 /* AboutViewController.xib in Resources */, 61F2E7EC12060E31005734F7 /* checkbox.png in Resources */, 615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */, + F6D7E09F1B76884E004F3BCF /* Default-568h@2x.png in Resources */, 615AD9E9120764CA00F2FF04 /* backButton.png in Resources */, 615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */, 611EE974122A9C4100DF6938 /* clickSound.caf in Resources */, @@ -1454,7 +1523,9 @@ 611D9BFC12497E9800008271 /* SavedGamesViewController.xib in Resources */, 6147DAD31253DCDE0010357E /* savesButton.png in Resources */, 610D5FB21270E2660033333A /* Icon-Small@2x.png in Resources */, + F6F07BDF1B7E72D40010E48F /* HelpPageLobbyViewController-iPhone.xib in Resources */, 610D5FB31270E26C0033333A /* Icon@2x.png in Resources */, + F65E1DC01B9B95A400A78ADF /* Icon-76.png in Resources */, 61A670C012747D9B00B06CE7 /* Default.png in Resources */, 61A670C112747DB900B06CE7 /* MainMenuViewController-iPhone.xib in Resources */, 61A670C212747DBD00B06CE7 /* MapConfigViewController-iPhone.xib in Resources */, @@ -1464,11 +1535,13 @@ 61D3D2A51290E03A003CE7C3 /* irc.png in Resources */, 6172FED91298CF9800D73365 /* background~iphone.png in Resources */, 6172FEEF1298D25D00D73365 /* mediumBackground~ipad.png in Resources */, + F65E1DBF1B9B95A400A78ADF /* Icon-60@2x.png in Resources */, 6172FEF11298D25D00D73365 /* smallerBackground~ipad.png in Resources */, 6172FEF21298D25D00D73365 /* smallerBackground~iphone.png in Resources */, 61889985129995B500D55FD6 /* title~ipad.png in Resources */, 615FEAE212A2A6640098EE92 /* localplayButton~ipad.png in Resources */, 615FEAE312A2A6640098EE92 /* localplayButton~iphone.png in Resources */, + F65725001B7E784700A86262 /* helpplain.png in Resources */, 61188BF712A6FE5A0026C5DA /* backButton@2x.png in Resources */, 61188BF812A6FE5C0026C5DA /* background@2x~iphone.png in Resources */, 61188BF912A6FE5D0026C5DA /* checkbox@2x.png in Resources */, @@ -1481,10 +1554,14 @@ 61188C0412A6FE880026C5DA /* savesButton@2x.png in Resources */, 61188C0512A6FE8F0026C5DA /* Data in Resources */, 61188C0612A6FE950026C5DA /* smallerBackground@2x~iphone.png in Resources */, + F65724FD1B7E784700A86262 /* helpabove.png in Resources */, + F6F07BDE1B7E72D40010E48F /* HelpPageLobbyViewController-iPad.xib in Resources */, 61188C0712A6FE960026C5DA /* settingsButton@2x.png in Resources */, 61188C0812A6FE9A0026C5DA /* title@2x~iphone.png in Resources */, + F65724FF1B7E784700A86262 /* helpleft.png in Resources */, 61188C0912A6FE9C0026C5DA /* tw@2x.png in Resources */, 6174F7C812CD62E300205D6F /* smallerTitle.png in Resources */, + F65725011B7E784700A86262 /* helpright.png in Resources */, 6174F7C912CD62E300205D6F /* smallerTitle@2x.png in Resources */, 6167A6771391514600AA6D07 /* RestoreViewController-iPhone.xib in Resources */, 6167A72D13919E6800AA6D07 /* RestoreViewController-iPad.xib in Resources */, @@ -1568,7 +1645,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "HG=/usr/local/bin/hg\nSOURCE_DIR=${PROJECT_DIR}/../../\n\n#create config.inc\necho \"Updating config file...\"\nPRON=`grep HEDGEWARS_PROTO_VER ${SOURCE_DIR}/CMakeLists.txt | grep -o -E [0-9]+`\nMAJN=`grep CPACK_PACKAGE_VERSION_MAJOR ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nMINN=`grep CPACK_PACKAGE_VERSION_MINOR ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nPATN=`grep CPACK_PACKAGE_VERSION_PATCH ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nREVN=`$HG id -n ${SOURCE_DIR}`\nHASH=`$HG id -i ${SOURCE_DIR}`\n\necho \"{Do not change this file, use the project target to regenerate}\" > ${PROJECT_DIR}/config.inc\necho \"const cNetProtoVersion = $PRON;\" >> ${PROJECT_DIR}/config.inc\necho \"const cVersionString = '$MAJN.$MINN.$PATN';\" >> ${PROJECT_DIR}/config.inc\necho \"const cRevisionString = '$REVN';\" >> ${PROJECT_DIR}/config.inc\necho \"const cHashString = '$HASH';\" >> ${PROJECT_DIR}/config.inc\n"; + shellScript = "HG=/usr/local/bin/hg\nSOURCE_DIR=${PROJECT_DIR}/../../\n\n#create config.inc\necho \"Updating config file...\"\nPRON=`grep HEDGEWARS_PROTO_VER ${SOURCE_DIR}/CMakeLists.txt | grep -o -E [0-9]+`\nMAJN=`grep CPACK_PACKAGE_VERSION_MAJOR ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nMINN=`grep CPACK_PACKAGE_VERSION_MINOR ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nPATN=`grep CPACK_PACKAGE_VERSION_PATCH ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nREVN=`$HG id -n ${SOURCE_DIR}`\nHASH=`$HG id -i ${SOURCE_DIR}`\n\necho \"{Do not change this file, use the project target to regenerate}\" > ${PROJECT_DIR}/config.inc\necho \"const cNetProtoVersion = $PRON;\" >> ${PROJECT_DIR}/config.inc\necho \"const cVersionString = '$MAJN.$MINN.$PATN';\" >> ${PROJECT_DIR}/config.inc\necho \"const cRevisionString = '$REVN';\" >> ${PROJECT_DIR}/config.inc\necho \"const cHashString = '$HASH';\" >> ${PROJECT_DIR}/config.inc\necho \"const cDefaultPathPrefix = '';\" >> ${PROJECT_DIR}/config.inc\n"; }; 9283011B0F10CB2D00CC5A3C /* Build libfpc.a */ = { isa = PBXShellScriptBuildPhase; @@ -1584,7 +1661,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Build libfpc.a\n# 9 July 2006 (Jonas Maebe)\n# * original version\n# 15 September 2006 (Erling Johansen)\n# * simplified\n# 26 April 2007 (Jonas Maebe)\n# * added support for ppc64/x86_64 (future proofing)\n# 4 August 2007 (Jonas Maebe)\n# * call ranlib after ar so the toc of the library is up-to-date\n# 3 January 2009 (Jonas Maebe)\n# * support for ARM\n# 24 October 2009 (Jonas Maebe)\n# * don't hardcode version 2.3.1 anymore under certain circumstances\n# * use the FPC_RTL_UNITS_BASE setting\n# 13 December 2009 (Jonas Maebe)\n# * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nrm -f \"$TARGET_TEMP_DIR\"/*.a\nnarch=\n\ntemparchs=`echo $ARCHS|sed -e 's/arm[^\\w]*/arm\\\n/'|sort -u`\nfor arch in $temparchs\ndo\n\ttargetos=darwin;\n\tcase $arch in\n\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n\t\ti386) fpc_arch=386; fpc_rtl=i386; targetos=iphonesim ;;\n\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t*) continue\n\tesac\n\tif test -e \"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch}\n\tthen\n\t\tupath=\"$FPC_RTL_UNITS_BASE\"/`\"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch} -iV`/units/${fpc_rtl}-${targetos}\n\t\tar -q \"$TARGET_TEMP_DIR\"/libfpc${narch}.a `ls \"$upath\"/*/*.o | grep -v 'darwin/fv/'`\n\t\tranlib \"$TARGET_TEMP_DIR\"/libfpc${narch}.a\n\t\tnarch=${narch}x\n\telse\n\t\techo error: can\\'t build libfpc.a for $arch \\(${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch} not found, derived from FPC_COMPILER_BINARY_DIR project setting\\)\n\tfi\ndone\n\nif test ${#narch} -gt 1\nthen\n\tlipo -create \"$TARGET_TEMP_DIR\"/libfpc*.a -output \"$TARGET_BUILD_DIR\"/libfpc.a\n\trm -f \"$TARGET_TEMP_DIR\"/*.a\nelse\n\tmv \"$TARGET_TEMP_DIR\"/libfpc.a \"$TARGET_BUILD_DIR\"\nfi\n"; + shellScript = "# Build libfpc.a\n# 9 July 2006 (Jonas Maebe)\n# * original version\n# 15 September 2006 (Erling Johansen)\n# * simplified\n# 26 April 2007 (Jonas Maebe)\n# * added support for ppc64/x86_64 (future proofing)\n# 4 August 2007 (Jonas Maebe)\n# * call ranlib after ar so the toc of the library is up-to-date\n# 3 January 2009 (Jonas Maebe)\n# * support for ARM\n# 24 October 2009 (Jonas Maebe)\n# * don't hardcode version 2.3.1 anymore under certain circumstances\n# * use the FPC_RTL_UNITS_BASE setting\n# 13 December 2009 (Jonas Maebe)\n# * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nrm -f \"$TARGET_TEMP_DIR\"/*.a\nnarch=\n\n#temparchs=`echo $ARCHS|sed -e 's/arm[^\\w]*/arm\\\n#/'|sort -u`\ntemparchs=`echo $ARCHS|sort -u`\necho $temparchs\nfor arch in $temparchs\ndo\n\ttargetos=darwin;\n\tcase $arch in\n arm64) fpc_arch=rossa64; fpc_rtl=aarch64 ;;\n armv7) fpc_arch=rossarm; fpc_rtl=arm ;;\n x86_64) fpc_arch=x64; fpc_rtl=x86_64; targetos=iphonesim ;;\n# ppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n#\t\ti386) fpc_arch=386; fpc_rtl=i386; targetos=iphonesim ;;\n#\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n#\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n#\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t*) continue\n\tesac\n\tif test -e \"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch}\n\tthen\n\t\tupath=\"$FPC_RTL_UNITS_BASE\"/`\"${FPC_COMPILER_BINARY_DIR}\"/ppc${fpc_arch} -iV`/units/${fpc_rtl}-${targetos}\n\t\tar -q \"$TARGET_TEMP_DIR\"/libfpc${narch}.a `ls \"$upath\"/*/*.o | grep -v 'darwin/fv/'`\n\t\tranlib \"$TARGET_TEMP_DIR\"/libfpc${narch}.a\n\t\tnarch=${narch}x\n\telse\n\t\techo error: can\\'t build libfpc.a for $arch \\(${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch} not found, derived from FPC_COMPILER_BINARY_DIR project setting\\)\n\tfi\ndone\n \nif test ${#narch} -gt 1\nthen\n\tlipo -create \"$TARGET_TEMP_DIR\"/libfpc*.a -output \"$TARGET_BUILD_DIR\"/libfpc.a\n\trm -f \"$TARGET_TEMP_DIR\"/*.a\nelse\n\tmv \"$TARGET_TEMP_DIR\"/libfpc.a \"$TARGET_BUILD_DIR\"\nfi\n"; }; 928301560F10E04C00CC5A3C /* Compile Pascal Sources */ = { isa = PBXShellScriptBuildPhase; @@ -1599,7 +1676,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Compile Pascal Sources\n# 15sep06,ejo written.\n# 26 April 2007 - Jonas Maebe\n# * support for ppc64 and x86_64\n# * don't run when cleaning (in case running scripts when cleaning is ever fixed by Apple)\n# * split the options in FPC_COMMON_FLAGS (common to all configurations) and FPC_CFG_SPECIFIC_FLAGS (per configuration)\n# 4 January 2009 - Jonas Maebe\n# * support for ARM\n# 24 October 2009 - Jonas Maebe\n# * don't hardcode 2.3.1 in some cases anymore\n# 13 December 2009 (Jonas Maebe)\n# * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nif [ x\"$ACTION\" != \"xbuild\" ]; then\n # in case running scripts during cleaning gets fixed\n exit 0\nfi\n\nif test ! -e \"$FPC_MAIN_FILE\"\nthen\n\techo error: FPC_MAIN_FILE not found \\($FPC_MAIN_FILE\\)\n\texit 2\nfi\n\nfor variant in $BUILD_VARIANTS\ndo\n\tfor arch in $ARCHS\n\tdo\n\t\ttargetos=darwin;\n\t\tcase $arch in\n\t\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n\t\t\ti386) fpc_arch=386; fpc_rtl=i386; targetos=iphonesim ;;\n\t\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n\t\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n\t\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t\t*) continue\n\t\tesac\n\n\t\tapp_target_temp_dir=$CONFIGURATION_TEMP_DIR/`basename \"$PROJECT_TEMP_DIR\"`\n\t\tout_dir=$app_target_temp_dir/`basename \"$DERIVED_SOURCES_DIR\"`-$variant/$arch\n\t\tfpccompiler=\"${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch}\"\n\t\tif test -e \"$fpccompiler\"\n\t\tthen\n\t\t\tfpcversion=`\"$fpccompiler\" -iV`\n\t\t\tmainunitdir=\"$FPC_RTL_UNITS_BASE/$fpcversion/units/${fpc_rtl}-${targetos}/\"\n\t\t\tmkdir -p \"$out_dir\"\n\t\t\tcd \"$out_dir\"\n\t\t\techo \"Compiling to $out_dir\"\n\t\t\trm -f compilefailed\n\t\n\t\t\t# delete any ppu files for which the \".s\" file was somehow deleted (Xcode does that sometimes in case of errors),\n\t\t\t# so that FPC will recompile the unit\n\t\t\tfor file in *.ppu\n\t\t\tdo\n\t\t\t\tasmname=`basename \"$file\" ppu`s\n\t\t\t\tif [ ! -f \"$asmname\" ]; then\n\t\t\t\t\t# can fail in case there are no .ppu files, since then it will try to erase the file with name '*.ppu'\n\t\t\t\t\t# -> use -f so it won't give an error message\n\t\t\t\t\trm -f \"$file\"\n\t\t\t\tfi\n\t\t\tdone\n\n\t\t\techo $fpccompiler -n -l -viwn -a -s -vbr -FE. $FPC_COMMON_OPTIONS $FPC_SPECIFIC_OPTIONS '\\' >ppccmd.sh\n\t\t\techo -Fi\\\"`dirname \"$FPC_MAIN_FILE\"`\\\" '\\' >>ppccmd.sh\n\t\t\techo -Fu\"$mainunitdir/*\" -Fu\"$mainunitdir/rtl\" '\\' >>ppccmd.sh\n\t\t\t# allow FPC_UNIT_PATHS to override default search directory\n\t\t\techo $FPC_UNIT_PATHS '\\' >>ppccmd.sh\n\t\t\techo \\\"$FPC_MAIN_FILE\\\" >>ppccmd.sh\n\t\t\t# cat ppccmd.sh\n\n\t\t\t/bin/sh ppccmd.sh\n\t\t\tif [ $? != 0 ]; then\n\t\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\t\texit 1\n\t\t\tfi\n\t\telse\n\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\techo $FPC_MAIN_FILE:1: error: 1: can\\'t compile for $arch \\(ppc${fpc_arch} not found\\)\n\t\t\texit 2\n\t\tfi\n\tdone\ndone\n"; + shellScript = "# Compile Pascal Sources\n# 15sep06,ejo written.\n# 26 April 2007 - Jonas Maebe\n# * support for ppc64 and x86_64\n# * don't run when cleaning (in case running scripts when cleaning is ever fixed by Apple)\n# * split the options in FPC_COMMON_FLAGS (common to all configurations) and FPC_CFG_SPECIFIC_FLAGS (per configuration)\n# 4 January 2009 - Jonas Maebe\n# * support for ARM\n# 24 October 2009 - Jonas Maebe\n# * don't hardcode 2.3.1 in some cases anymore\n# 13 December 2009 (Jonas Maebe)\n# * use new FPC_COMPILER_BINARY_DIR setting to make it easier to change the used FPC version\n\nif [ x\"$ACTION\" != \"xbuild\" ]; then\n # in case running scripts during cleaning gets fixed\n exit 0\nfi\n\nif test ! -e \"$FPC_MAIN_FILE\"\nthen\n\techo error: FPC_MAIN_FILE not found \\($FPC_MAIN_FILE\\)\n\texit 2\nfi\n\nfor variant in $BUILD_VARIANTS\ndo\n\tfor arch in $ARCHS\n\tdo\n\t\ttargetos=darwin;\n\t\tcase $arch in\n arm64) fpc_arch=rossa64; fpc_rtl=aarch64 ;;\n armv7) fpc_arch=rossarm; fpc_rtl=arm ;;\n x86_64) fpc_arch=x64; fpc_rtl=x86_64; targetos=iphonesim ;;\n#\t\t\tppc) fpc_arch=ppc; fpc_rtl=powerpc ;;\n#\t\t\ti386) fpc_arch=386; fpc_rtl=i386; targetos=iphonesim ;;\n#\t\t\tppc64) fpc_arch=ppc64; fpc_rtl=powerpc64 ;;\n#\t\t\tx86_64) fpc_arch=x64; fpc_rtl=x86_64 ;;\n#\t\t\tarm*) fpc_arch=arm; fpc_rtl=arm ;;\n\t\t\t*) continue\n\t\tesac\n\n\t\tapp_target_temp_dir=$CONFIGURATION_TEMP_DIR/`basename \"$PROJECT_TEMP_DIR\"`\n\t\tout_dir=$app_target_temp_dir/`basename \"$DERIVED_SOURCES_DIR\"`-$variant/$arch\n\t\tfpccompiler=\"${FPC_COMPILER_BINARY_DIR}/ppc${fpc_arch}\"\n\t\tif test -e \"$fpccompiler\"\n\t\tthen\n\t\t\tfpcversion=`\"$fpccompiler\" -iV`\n\t\t\tmainunitdir=\"$FPC_RTL_UNITS_BASE/$fpcversion/units/${fpc_rtl}-${targetos}/\"\n\t\t\tmkdir -p \"$out_dir\"\n\t\t\tcd \"$out_dir\"\n\t\t\techo \"Compiling to $out_dir\"\n\t\t\trm -f compilefailed\n\t\n\t\t\t# delete any ppu files for which the \".s\" file was somehow deleted (Xcode does that sometimes in case of errors),\n\t\t\t# so that FPC will recompile the unit\n\t\t\tfor file in *.ppu\n\t\t\tdo\n\t\t\t\tasmname=`basename \"$file\" ppu`s\n\t\t\t\tif [ ! -f \"$asmname\" ]; then\n\t\t\t\t\t# can fail in case there are no .ppu files, since then it will try to erase the file with name '*.ppu'\n\t\t\t\t\t# -> use -f so it won't give an error message\n\t\t\t\t\trm -f \"$file\"\n\t\t\t\tfi\n\t\t\tdone\n\n\t\t\techo $fpccompiler -n -l -viwn -a -s -vbr -FE. $FPC_COMMON_OPTIONS $FPC_SPECIFIC_OPTIONS '\\' >ppccmd.sh\n\t\t\techo -Fi\\\"`dirname \"$FPC_MAIN_FILE\"`\\\" '\\' >>ppccmd.sh\n\t\t\techo -Fu\"$mainunitdir/*\" -Fu\"$mainunitdir/rtl\" '\\' >>ppccmd.sh\n\t\t\t# allow FPC_UNIT_PATHS to override default search directory\n\t\t\techo $FPC_UNIT_PATHS '\\' >>ppccmd.sh\n\t\t\techo \\\"$FPC_MAIN_FILE\\\" >>ppccmd.sh\n\t\t\t# cat ppccmd.sh\n\n\t\t\t/bin/sh ppccmd.sh\n\t\t\tif [ $? != 0 ]; then\n\t\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\t\texit 1\n\t\t\tfi\n\t\telse\n\t\t\ttouch \"$out_dir\"/compilefailed\n\t\t\techo $FPC_MAIN_FILE:1: error: 1: can\\'t compile for $arch \\(ppc${fpc_arch} not found\\)\n\t\t\texit 2\n\t\tfi\n\tdone\ndone\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1628,6 +1705,7 @@ 6179882E114AA34C00BA94A9 /* uLandGraphics.pas in Sources */, 6179882F114AA34C00BA94A9 /* uLandObjects.pas in Sources */, 61798830114AA34C00BA94A9 /* uLandTemplates.pas in Sources */, + F6D7E0C31B768F19004F3BCF /* uLandGenTemplateBased.pas in Sources */, 61798831114AA34C00BA94A9 /* uLandTexture.pas in Sources */, 61798832114AA34C00BA94A9 /* uLocale.pas in Sources */, 61798833114AA34C00BA94A9 /* uMisc.pas in Sources */, @@ -1692,6 +1770,7 @@ 61AC067412B2E32D000B52A2 /* Appirater.m in Sources */, 61E2E12E12BAAEE30051B659 /* ServerProtocolNetwork.m in Sources */, 61B7A33812CC21080086B604 /* StatsPageViewController.m in Sources */, + F6D7E0C41B768F19004F3BCF /* uLandUtils.pas in Sources */, 61EDB5B0135B3F97009B29A6 /* GameInterfaceBridge.m in Sources */, 61A976B3136F668500DD9878 /* uCursor.pas in Sources */, 6167A6761391514600AA6D07 /* RestoreViewController.m in Sources */, @@ -1709,11 +1788,13 @@ 615E76BC14E4421200FBA131 /* MGSplitCornersView.m in Sources */, 615E76BD14E4421200FBA131 /* MGSplitDividerView.m in Sources */, 615E76BE14E4421200FBA131 /* MGSplitViewController.m in Sources */, + F6F07BE01B7E72D40010E48F /* HelpPageLobbyViewController.m in Sources */, 615BE3D4155C5DDF003CA34D /* uInputHandler.pas in Sources */, 619349C8160BAF3E00A08518 /* uAILandMarks.pas in Sources */, 619349C9160BAF3E00A08518 /* uGearsHandlers.pas in Sources */, 619349CA160BAF3E00A08518 /* uGearsHandlersRope.pas in Sources */, 610FB7C81661390E002FB2A7 /* uPhysFSLayer.pas in Sources */, + F6D7E0C21B768F19004F3BCF /* uLandGenPerlin.pas in Sources */, 61B37A1F17837C78009F283D /* ArgParsers.pas in Sources */, 61B37A2017837C78009F283D /* uVisualGearsList.pas in Sources */, 61B37A80178381DB009F283D /* uGearsHandlersMess.pas in Sources */, @@ -1780,13 +1861,13 @@ 6115652D147F4C52006729A9 /* French */, 61156530147F4D10006729A9 /* Polish */, 61177BAA148A661600686905 /* German */, - 61177BAC148A671600686905 /* Turkish */, 61177BE4148B881C00686905 /* Danish */, 617BC22D1490210E00E1C294 /* Italian */, 619BCEC41495615700C1C409 /* Bulgarian */, 61D08D8714AEA9670007C078 /* Japanese */, 61C6783F14B3DD020087425A /* Portuguese */, 6154A53114C37E4A00F6EEF6 /* Romanian */, + F65725291B7EB9CC00A86262 /* ru */, ); name = About.strings; sourceTree = ""; @@ -1799,13 +1880,13 @@ 6115652C147F4C4C006729A9 /* French */, 61156531147F4D17006729A9 /* Polish */, 61177BA7148A658900686905 /* German */, - 61177BAD148A672000686905 /* Turkish */, 61177BF0148B882500686905 /* Danish */, 617BC2391490211500E1C294 /* Italian */, 619BCED01495615F00C1C409 /* Bulgarian */, 61D08D8814AEA9700007C078 /* Japanese */, 61C6784B14B3DD0B0087425A /* Portuguese */, 6154A53E14C37E5400F6EEF6 /* Romanian */, + F657252A1B7EB9CC00A86262 /* ru */, ); name = Localizable.strings; sourceTree = ""; @@ -1818,13 +1899,13 @@ 6115652B147F4C45006729A9 /* French */, 61156532147F4D1E006729A9 /* Polish */, 61177BA9148A660C00686905 /* German */, - 61177BAE148A672C00686905 /* Turkish */, 61177BF1148B882F00686905 /* Danish */, 617BC23A1490211F00E1C294 /* Italian */, 619BCED11495616700C1C409 /* Bulgarian */, 61D08D8914AEA9780007C078 /* Japanese */, 61C6784C14B3DD140087425A /* Portuguese */, 6154A54014C37EB100F6EEF6 /* Romanian */, + F657252B1B7EB9CC00A86262 /* ru */, ); name = Scheme.strings; sourceTree = ""; @@ -1861,19 +1942,28 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLY_RULES_IN_COPY_FILES = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; FPC_COMMON_OPTIONS = "-l- -dIPHONEOS -Cs2000000 -B -vwi -Sgix -Fi${PROJECT_DIR}"; - FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.7.1; + FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/3.1.1; FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas"; FPC_RTL_UNITS_BASE = /usr/local/lib/fpc; - FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -Os -Xs -Cfvfpv3 -dNOCONSOLE"; + FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -Os -Xs -dNOCONSOLE"; FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\""; GCC_C_LANGUAGE_STANDARD = c99; GCC_DEBUGGING_SYMBOLS = default; GCC_DYNAMIC_NO_PIC = NO; GCC_FAST_MATH = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_STRICT_ALIASING = YES; @@ -1892,6 +1982,7 @@ GCC_WARN_SHADOW = YES; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; @@ -1902,7 +1993,7 @@ "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LLVM_LTO = NO; ONLY_ACTIVE_ARCH = NO; OTHER_CODE_SIGN_FLAGS = ""; @@ -1916,7 +2007,7 @@ SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv7 x86_64 arm64"; WARNING_CFLAGS = ( "-Wall", "-Wbad-function-cast", @@ -1945,6 +2036,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = NO; PREBINDING = NO; PRODUCT_NAME = fpc; + SKIP_INSTALL = YES; ZERO_LINK = NO; }; name = "Distro AppStore"; @@ -1965,20 +2057,29 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLY_RULES_IN_COPY_FILES = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "Entitlements-Distribution.plist"; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; FPC_COMMON_OPTIONS = "-l- -dIPHONEOS -Cs2000000 -B -vwi -Sgix -Fi${PROJECT_DIR}"; - FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.7.1; + FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/3.1.1; FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas"; FPC_RTL_UNITS_BASE = /usr/local/lib/fpc; - FPC_SPECIFIC_OPTIONS = "-dDEBUGFILE -O- -g -gl -gw2 -gt -ghttt -Xs- -Cfvfpv3"; + FPC_SPECIFIC_OPTIONS = "-dDEBUGFILE -O- -g -gl -gw2 -gt -ghttt -Xs-"; FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\""; GCC_C_LANGUAGE_STANDARD = c99; GCC_DEBUGGING_SYMBOLS = full; GCC_DYNAMIC_NO_PIC = YES; GCC_FAST_MATH = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_STRICT_ALIASING = YES; @@ -1997,6 +2098,7 @@ GCC_WARN_SHADOW = YES; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; @@ -2007,7 +2109,7 @@ "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lz", @@ -2019,7 +2121,7 @@ SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv7 x86_64 arm64"; WARNING_CFLAGS = ( "-Wall", "-Wbad-function-cast", @@ -2048,6 +2150,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = NO; PREBINDING = NO; PRODUCT_NAME = fpc; + SKIP_INSTALL = YES; ZERO_LINK = NO; }; name = "Distro Adhoc"; @@ -2092,6 +2195,7 @@ GCC_OPTIMIZATION_LEVEL = 0; PREBINDING = NO; PRODUCT_NAME = fpc; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -2103,6 +2207,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = NO; PREBINDING = NO; PRODUCT_NAME = fpc; + SKIP_INSTALL = YES; ZERO_LINK = NO; }; name = Release; @@ -2112,12 +2217,19 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLY_RULES_IN_COPY_FILES = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; FPC_COMMON_OPTIONS = "-l- -dIPHONEOS -Cs2000000 -B -vwi -Sgix -Fi${PROJECT_DIR}"; - FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.6.0; + FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/3.1.1; FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas"; FPC_RTL_UNITS_BASE = /usr/local/lib/fpc; FPC_SPECIFIC_OPTIONS = "-Tiphonesim -dDEBUGFILE -O- -g -gl -gw2 -gt -ghttt -Xs-"; @@ -2126,6 +2238,7 @@ GCC_DEBUGGING_SYMBOLS = full; GCC_DYNAMIC_NO_PIC = NO; GCC_FAST_MATH = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_STRICT_ALIASING = YES; @@ -2144,6 +2257,7 @@ GCC_WARN_SHADOW = YES; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; @@ -2154,8 +2268,8 @@ "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 3.0; - ONLY_ACTIVE_ARCH = NO; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-lz", "-Wl,-no_order_inits", @@ -2166,7 +2280,7 @@ SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = NO; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv7 x86_64 arm64"; WARNING_CFLAGS = ( "-Wall", "-Wbad-function-cast", @@ -2181,20 +2295,29 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLY_RULES_IN_COPY_FILES = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "Entitlements-Development.plist"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; FPC_COMMON_OPTIONS = "-l- -dIPHONEOS -Cs2000000 -B -vwi -Sgix -Fi${PROJECT_DIR}"; - FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.6.0; + FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/3.1.1; FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas"; FPC_RTL_UNITS_BASE = /usr/local/lib/fpc; - FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -Os -Xs -Cfvfpv3 -dDEBUGFILE"; + FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -Os -Xs -dDEBUGFILE"; FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\""; GCC_C_LANGUAGE_STANDARD = c99; GCC_DEBUGGING_SYMBOLS = default; - GCC_DYNAMIC_NO_PIC = YES; + GCC_DYNAMIC_NO_PIC = NO; GCC_FAST_MATH = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_STRICT_ALIASING = YES; @@ -2213,6 +2336,7 @@ GCC_WARN_SHADOW = YES; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; @@ -2223,7 +2347,7 @@ "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LLVM_LTO = NO; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( @@ -2236,7 +2360,7 @@ SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = NO; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv7 x86_64 arm64"; WARNING_CFLAGS = ( "-Wall", "-Wbad-function-cast", diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.xcworkspace/contents.xcworkspacedata --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.xcworkspace/contents.xcworkspacedata Thu Sep 10 18:22:52 2015 +0200 @@ -0,0 +1,7 @@ + + + + + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Info.plist --- a/project_files/HedgewarsMobile/Info.plist Thu Sep 10 04:59:02 2015 +0200 +++ b/project_files/HedgewarsMobile/Info.plist Thu Sep 10 18:22:52 2015 +0200 @@ -16,34 +16,32 @@ Icon-Small.png Icon-Small-50.png Icon-Small@2x.png + Icon-60@2x.png + Icon-76.png + Icon-76@2x.png CFBundleIdentifier - org.hedgewars.mobile + com.AC27.Hedgewars CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 2.0 CFBundleSignature ???? CFBundleVersion ${HEDGEWARS_REVISION} - CFBundleShortVersionString - 1.3.2 LSRequiresIPhoneOS + UILaunchImageFile~ipad + Default-ipad UIPrerenderedIcon UIStatusBarHidden - UILaunchImageFile~ipad - Default-ipad - UISupportedInterfaceOrientations~iphone - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait @@ -51,5 +49,10 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UISupportedInterfaceOrientations~iphone + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Locale/Turkish.lproj/About.strings Binary file project_files/HedgewarsMobile/Locale/Turkish.lproj/About.strings has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Locale/Turkish.lproj/Localizable.strings Binary file project_files/HedgewarsMobile/Locale/Turkish.lproj/Localizable.strings has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Locale/Turkish.lproj/Scheme.strings Binary file project_files/HedgewarsMobile/Locale/Turkish.lproj/Scheme.strings has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Locale/ru.lproj/About.strings Binary file project_files/HedgewarsMobile/Locale/ru.lproj/About.strings has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Locale/ru.lproj/Localizable.strings Binary file project_files/HedgewarsMobile/Locale/ru.lproj/Localizable.strings has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Locale/ru.lproj/Scheme.strings Binary file project_files/HedgewarsMobile/Locale/ru.lproj/Scheme.strings has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpabove.png Binary file project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpabove.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpbottom.png Binary file project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpbottom.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpleft.png Binary file project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpleft.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpplain.png Binary file project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpplain.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpright.png Binary file project_files/HedgewarsMobile/Resources/Frontend/Help Bubbles/helpright.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Icons/Icon-60@2x.png Binary file project_files/HedgewarsMobile/Resources/Icons/Icon-60@2x.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Icons/Icon-76.png Binary file project_files/HedgewarsMobile/Resources/Icons/Icon-76.png has changed diff -r 1fb80cd8ba7b -r 5c40c65b619d project_files/HedgewarsMobile/Resources/Icons/Icon-76@2x.png Binary file project_files/HedgewarsMobile/Resources/Icons/Icon-76@2x.png has changed