# HG changeset patch # User nemo # Date 1287532037 14400 # Node ID 57121975b64b8405787e8960dc2c97e9d1bb1a3e # Parent 91ac041ecb2049854cf45ba520e698f35f439bf8# Parent aa24192417a87aec1339dcc7d354a91a28a0bc14 merge diff -r 91ac041ecb20 -r 57121975b64b hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/GSHandlers.inc Tue Oct 19 19:47:17 2010 -0400 @@ -422,7 +422,7 @@ begin doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); for i:= 0 to 2 do - AddGear(hwRound(Gear^.X) - 30 + GetRandom(60), hwRound(Gear^.Y) - 20 + GetRandom(40), gtPoisonCloud, 0, _0, _0, 0); + AddGear(int64(hwRound(Gear^.X)) - 30 + GetRandom(60), int64(hwRound(Gear^.Y)) - 20 + GetRandom(40), gtPoisonCloud, 0, _0, _0, 0); end; end; DeleteGear(Gear); @@ -4101,6 +4101,8 @@ DrawCircle(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Radius, 1.5, 0, 0, $FF, $FF); + doStepHedgehogMoving(hh^.Gear); + if ((Gear^.Message and gmUp) <> 0) then begin if (GameTicks and $F) <> 0 then exit; end else begin @@ -4109,9 +4111,14 @@ graves := GearsNear(hh^.Gear, gtGrave, Gear^.Radius); + if Length(graves) = 0 then begin + Gear^.Timer := 250; + Gear^.doStep := @doStepIdle; + exit; + end; + if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) then begin i := getRandom(Length(graves)); - writeln(i); dec(hh^.Gear^.Health); inc(graves[i]^.Health); {-for i:= 0 to High(graves) do begin diff -r 91ac041ecb20 -r 57121975b64b hedgewars/PascalExports.pas --- a/hedgewars/PascalExports.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/PascalExports.pas Tue Oct 19 19:47:17 2010 -0400 @@ -267,6 +267,16 @@ exit (str2pchar(trammo[Ammoz[TAmmoType(whichone+1)].NameId])); end; +function HW_getWeaponCaptionByIndex(whichone: LongInt): PChar; cdecl; export; +begin + exit (str2pchar(trammoc[Ammoz[TAmmoType(whichone+1)].NameId])); +end; + +function HW_getWeaponDescriptionByIndex(whichone: LongInt): PChar; cdecl; export; +begin + exit (str2pchar(trammod[Ammoz[TAmmoType(whichone+1)].NameId])); +end; + function HW_getNumberOfWeapons:LongInt; cdecl; export; begin exit(ord(high(TAmmoType))); diff -r 91ac041ecb20 -r 57121975b64b hedgewars/VGSHandlers.inc --- a/hedgewars/VGSHandlers.inc Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/VGSHandlers.inc Tue Oct 19 19:47:17 2010 -0400 @@ -36,7 +36,7 @@ if (round(X) >= cLeftScreenBorder) and (round(X) <= cRightScreenBorder) and - (round(Y) <= (LAND_HEIGHT + 75)) and + (round(Y) <= (int64(LAND_HEIGHT) + 75)) and (Timer > 0) and (Timer-Steps > 0) then begin if tdX > 0 then sign := 1 @@ -54,7 +54,7 @@ if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else if round(X) > cRightScreenBorder then X:= X - cScreenSpace; // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + float(25); // For if flag is set for flakes rising upwards? - if round(Y) > (LAND_HEIGHT + 75) then Y:= Y - float(1024 + 150); // TODO - configure in theme (jellies for example could use limited range) + if round(Y) > (int64(LAND_HEIGHT) + 75) then Y:= Y - float(1024 + 150); // TODO - configure in theme (jellies for example could use limited range) Timer:= 0; tdX:= 0; tdY:= 0 @@ -84,7 +84,7 @@ t := 8 * AngleSin(s mod 2048).QWordValue / 4294967296; if (s < 2048) then t := -t; -Gear^.Y := LAND_HEIGHT-1184 + Gear^.Timer mod 8 + t; +Gear^.Y := int64(LAND_HEIGHT) - 1184 + Gear^.Timer mod 8 + t; if round(Gear^.X) < cLeftScreenBorder then Gear^.X:= Gear^.X + cScreenSpace else if round(Gear^.X) > cRightScreenBorder then Gear^.X:= Gear^.X - cScreenSpace @@ -480,7 +480,7 @@ procedure doStepHealthTagWorkUnderWater(Gear: PVisualGear; Steps: Longword); begin -if round(Gear^.Y) < cWaterLine + 10 then +if round(Gear^.Y) < int64(cWaterLine) + 10 then DeleteVisualGear(Gear) else Gear^.Y:= Gear^.Y - 0.08 * Steps; diff -r 91ac041ecb20 -r 57121975b64b hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/hwengine.pas Tue Oct 19 19:47:17 2010 -0400 @@ -175,7 +175,7 @@ if isTerminated = false then begin CurrTime:= SDL_GetTicks; - if PrevTime + cTimerInterval <= CurrTime then + if PrevTime + longword(cTimerInterval) <= CurrTime then begin DoTimer(CurrTime - PrevTime); PrevTime:= CurrTime diff -r 91ac041ecb20 -r 57121975b64b hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/uConsts.pas Tue Oct 19 19:47:17 2010 -0400 @@ -2180,7 +2180,7 @@ NameTex: nil; Probability: 0; NumberInCase: 1; - Ammo: (Propz: ammoprop_NoCrosshair; + Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_NoRoundEndHint; Count: 1; NumPerTurn: 0; Timer: 0; diff -r 91ac041ecb20 -r 57121975b64b hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/uGears.pas Tue Oct 19 19:47:17 2010 -0400 @@ -534,7 +534,7 @@ end; gtPoisonCloud: begin gear^.Timer:= 5000; - gear^.dY:= int2hwfloat((-4 + getRandom(8))) / 1000; + gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000; end; gtResurrector: begin gear^.Radius := 100; @@ -1034,8 +1034,8 @@ begin if not (((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and ((Gear^.State and gstAttacked) = 0)) then exit; - DrawTexture(round(sx + 16), round(sy + 16), ropeIconTex); - DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.75, round(sx + 30), round(sy + 30), ord(CurAmmoType) - 1, 1, 32, 32); + DrawTexture(round(int64(sx) + 16), round(int64(sy) + 16), ropeIconTex); + DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.75, round(int64(sx) + 30), round(int64(sy) + 30), ord(CurAmmoType) - 1, 1, 32, 32); end; end; diff -r 91ac041ecb20 -r 57121975b64b hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/uLandObjects.pas Tue Oct 19 19:47:17 2010 -0400 @@ -292,9 +292,9 @@ end end; inc(y, 3); - until y > LAND_HEIGHT - 1 - Height; + until y > int64(LAND_HEIGHT) - 1 - Height; inc(x, getrandom(6) + 3) - until x > LAND_WIDTH - 1 - Width; + until x > int64(LAND_WIDTH) - 1 - Width; bRes:= cnt <> 0; if bRes then begin @@ -341,9 +341,9 @@ end end; inc(y, 12); - until y > LAND_HEIGHT - 1 - Height - 8; + until y > int64(LAND_HEIGHT) - 1 - Height - 8; inc(x, getrandom(12) + 12) - until x > LAND_WIDTH - 1 - Width; + until x > int64(LAND_WIDTH) - 1 - Width; bRes:= cnt <> 0; if bRes then begin @@ -455,7 +455,7 @@ Readln(f, vobFramesCount, vobFrameTicks, vobVelocity, vobFallSpeed); // adjust amount of flakes scaled by screen space -vobCount:= vobCount * cScreenSpace div LAND_WIDTH; +vobCount:= longint(vobCount) * cScreenSpace div LAND_WIDTH; if (cReducedQuality and rqKillFlakes) <> 0 then vobCount:= 0; diff -r 91ac041ecb20 -r 57121975b64b hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/uVisualGears.pas Tue Oct 19 19:47:17 2010 -0400 @@ -370,7 +370,7 @@ if Gear^.Kind = vgtFlake then begin // Damage calc from doMakeExplosion - dmg:= min(101,Radius + cHHRadius div 2 - (round(abs(Gear^.X - float(X))+abs(Gear^.Y - float(Y))) div 5)); + dmg:= min(101, int64(Radius) + cHHRadius div 2 - (round(abs(Gear^.X - float(X))+abs(Gear^.Y - float(Y))) div 5)); if dmg > 1 then begin Gear^.tdX:= 0.02 * dmg + 0.01; diff -r 91ac041ecb20 -r 57121975b64b hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Tue Oct 19 19:46:43 2010 -0400 +++ b/hedgewars/uWorld.pas Tue Oct 19 19:47:17 2010 -0400 @@ -615,8 +615,8 @@ tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle); for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do DrawSprite(sprPower, - hwRound(Gear^.X) + GetLaunchX(CurAmmoType, hwSign(Gear^.dX), Gear^.Angle) + round(WorldDx + tdx * (24 + i * 2)) - 16, - hwRound(Gear^.Y) + GetLaunchY(CurAmmoType, Gear^.Angle) + round(WorldDy + tdy * (24 + i * 2)) - 16, + int64(hwRound(Gear^.X)) + GetLaunchX(CurAmmoType, hwSign(Gear^.dX), Gear^.Angle) + round(WorldDx + tdx * (24 + i * 2)) - 16, + int64(hwRound(Gear^.Y)) + GetLaunchY(CurAmmoType, Gear^.Angle) + round(WorldDy + tdy * (24 + i * 2)) - 16, i) end end; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h --- a/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h Tue Oct 19 19:47:17 2010 -0400 @@ -23,16 +23,24 @@ @interface AmmoMenuViewController : UIViewController { - UIImage *weaponsImage; NSArray *buttonsArray; + NSArray *imagesArray; + UILabel *nameLabel; + UILabel *extraLabel; + UILabel *captionLabel; + uint8_t *delay; + BOOL *shouldUpdateImage; CGPoint startingPoint; BOOL isVisible; } -@property (nonatomic,retain) UIImage *weaponsImage; -@property (nonatomic,retain) NSArray *buttonsArray; +@property (retain) NSArray *buttonsArray; +@property (retain) NSArray *imagesArray; +@property (nonatomic,retain) UILabel *nameLabel; +@property (nonatomic,retain) UILabel *extraLabel; +@property (nonatomic,retain) UILabel *captionLabel; @property (assign) BOOL isVisible; -(void) buttonPressed:(id)sender; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m --- a/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -28,7 +28,7 @@ #define BTNS_PER_ROW 9 @implementation AmmoMenuViewController -@synthesize weaponsImage, buttonsArray, isVisible; +@synthesize imagesArray, buttonsArray, nameLabel, extraLabel, captionLabel, isVisible; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { return rotationManager(interfaceOrientation); @@ -51,9 +51,11 @@ self.view.autoresizingMask = UIViewAutoresizingNone; self.isVisible = NO; - delay = (uint8_t *) calloc(HW_getNumberOfWeapons(), sizeof(uint8_t)); + delay = (uint8_t *)calloc(HW_getNumberOfWeapons(), sizeof(uint8_t)); HW_getAmmoDelays(delay); + shouldUpdateImage = (BOOL *)calloc(HW_getNumberOfWeapons(), sizeof(BOOL)); + [super viewDidLoad]; } @@ -85,14 +87,45 @@ #pragma mark - #pragma mark drawing +-(void) prepareLabels { + int x = 12; + int y = (HW_getNumberOfWeapons()/BTNS_PER_ROW)*44 + 18; + UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(x, y, 200, 20)]; + name.backgroundColor = [UIColor clearColor]; + name.textColor = UICOLOR_HW_YELLOW_BODER; + name.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]]; + self.nameLabel = name; + [self.view addSubview:self.nameLabel]; + [name release]; + + UILabel *caption = [[UILabel alloc] initWithFrame:CGRectMake(x+200, y, 220, 20)]; + caption.backgroundColor = [UIColor clearColor]; + caption.textColor = [UIColor whiteColor]; + caption.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]]; + caption.adjustsFontSizeToFitWidth = YES; + caption.minimumFontSize = 8; + self.captionLabel = caption; + [self.view addSubview:self.captionLabel]; + [caption release]; + + UILabel *description = [[UILabel alloc] initWithFrame:CGRectMake(x+2, y+20, 410, 53)]; + description.backgroundColor = [UIColor clearColor]; + description.textColor = [UIColor whiteColor]; + description.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; + description.adjustsFontSizeToFitWidth = YES; + description.minimumFontSize = 8; + description.numberOfLines = 0; + self.extraLabel = description; + [self.view addSubview:self.extraLabel]; + [description release]; +} + -(void) loadAmmoStuff:(id) object { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()]; UIImage *ammoStoreImage = [[UIImage alloc] initWithContentsOfFile:str]; - [self performSelectorOnMainThread:@selector(setWeaponsImage:) withObject:ammoStoreImage waitUntilDone:NO]; - [ammoStoreImage release]; + NSMutableArray *imgs = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()]; NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()]; int i, j, e; for (i = 0, j = 0, e = 0; i < HW_getNumberOfWeapons(); i++) { @@ -122,7 +155,9 @@ button.layer.borderWidth = w; [button.layer setCornerRadius:radius]; [button.layer setMasksToBounds:YES]; - [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; + [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown]; + [button addTarget:self action:@selector(buttonReleased:) forControlEvents:UIControlEventTouchUpInside]; + [button addTarget:self action:@selector(buttonCancel:) forControlEvents:UIControlEventTouchUpOutside|UIControlEventTouchCancel]; [button setTitleColor:UICOLOR_HW_YELLOW_TEXT forState:UIControlStateNormal]; button.titleLabel.backgroundColor = [UIColor blackColor]; button.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]; @@ -132,19 +167,27 @@ button.titleLabel.layer.borderWidth = 1; [self.view addSubview:button]; [array addObject:button]; - + + int x_src = ((i*32)/(int)ammoStoreImage.size.height)*32; + int y_src = (i*32)%(int)ammoStoreImage.size.height; + UIImage *img = [ammoStoreImage cutAt:CGRectMake(x_src, y_src, 32, 32)]; + [imgs addObject:img]; } [self performSelectorOnMainThread:@selector(setButtonsArray:) withObject:array waitUntilDone:NO]; [array release]; - - [self performSelectorOnMainThread:@selector(updateAmmoVisuals) withObject:nil waitUntilDone:NO]; + + [self performSelectorOnMainThread:@selector(setImagesArray:) withObject:imgs waitUntilDone:NO]; + [imgs release]; + [ammoStoreImage release]; + + [self performSelectorOnMainThread:@selector(updateAmmoVisuals) withObject:nil waitUntilDone:YES]; UIActivityIndicatorView *spinner = (UIActivityIndicatorView *)object; [spinner stopAnimating]; [pool drain]; } -(void) updateAmmoVisuals { - if (self.buttonsArray == nil || self.weaponsImage == nil) { + if (self.buttonsArray == nil || self.imagesArray == nil) { UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; spinner.hidesWhenStopped = YES; spinner.center = self.view.center; @@ -155,11 +198,6 @@ return; } - [NSThread detachNewThreadSelector:@selector(drawingThread) toTarget:self withObject:nil]; -} - --(void) drawingThread { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int *loadout = (int *)calloc(HW_getNumberOfWeapons(), sizeof(int)); int res = HW_getAmmoCounts(loadout); int turns = HW_getTurnsForCurrentTeam(); @@ -173,22 +211,18 @@ if (delay[i]-turns >= 0) { button.layer.borderColor = [[UIColor lightGrayColor] CGColor]; [button setTitle:[NSString stringWithFormat:@" %d ",delay[i]-turns+1] forState:UIControlStateNormal]; - if (button.currentBackgroundImage == nil) { - int x_src = ((i*32)/(int)self.weaponsImage.size.height)*32; - int y_src = (i*32)%(int)self.weaponsImage.size.height; - UIImage *img = [self.weaponsImage cutAt:CGRectMake(x_src, y_src, 32, 32)]; + if (button.currentBackgroundImage == nil || shouldUpdateImage[i] == NO) { + UIImage *img = [self.imagesArray objectAtIndex:i]; [button setBackgroundImage:[img convertToGrayScale] forState:UIControlStateNormal]; - button.imageView.tag = 10000; + shouldUpdateImage[i] = YES; } } else { button.layer.borderColor = [UICOLOR_HW_YELLOW_TEXT CGColor]; - [button setTitle:@"" forState:UIControlStateNormal]; - if (button.currentBackgroundImage == nil || button.imageView.tag == 10000) { - int x_src = ((i*32)/(int)self.weaponsImage.size.height)*32; - int y_src = (i*32)%(int)self.weaponsImage.size.height; - UIImage *img = [self.weaponsImage cutAt:CGRectMake(x_src, y_src, 32, 32)]; + [button setTitle:nil forState:UIControlStateNormal]; + if (button.currentBackgroundImage == nil || shouldUpdateImage[i] == YES) { + UIImage *img = [self.imagesArray objectAtIndex:i]; [button setBackgroundImage:img forState:UIControlStateNormal]; - button.imageView.tag = 0; + shouldUpdateImage[i] = NO; } } button.enabled = YES; @@ -197,8 +231,8 @@ [button setBackgroundImage:nil forState:UIControlStateNormal]; button.layer.borderColor = [[UIColor darkGrayColor] CGColor]; button.enabled = NO; + shouldUpdateImage[i] = NO; } - } } else { self.view.userInteractionEnabled = NO; @@ -206,15 +240,46 @@ free(loadout); loadout = NULL; - [pool drain]; } #pragma mark - #pragma mark user interaction -(void) buttonPressed:(id) sender { UIButton *theButton = (UIButton *)sender; - HW_setWeapon(theButton.tag); - playSound(@"clickSound"); + if (self.nameLabel == nil || self.extraLabel == nil) + [self prepareLabels]; + + self.nameLabel.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(theButton.tag)]; + // description contains a lot of unnecessary stuff, we clean it by removing .|, !| and ?| + NSString *description = [NSString stringWithUTF8String:HW_getWeaponDescriptionByIndex(theButton.tag)]; + NSArray *elements = [description componentsSeparatedByString:@".|"]; + NSArray *purgedElements = [[elements objectAtIndex:0] componentsSeparatedByString:@"!|"]; + NSArray *morePurgedElements = [[purgedElements objectAtIndex:0] componentsSeparatedByString:@"?|"]; + self.extraLabel.text = [[[morePurgedElements objectAtIndex:0] stringByReplacingOccurrencesOfString:@"|" withString:@" "] stringByAppendingString:@"."]; + if (theButton.currentTitle != nil) + self.captionLabel.text = NSLocalizedString(@"This weapon is locked",@""); + else + self.captionLabel.text = [NSString stringWithUTF8String:HW_getWeaponCaptionByIndex(theButton.tag)]; +} + +-(void) buttonCancel:(id) sender { + self.nameLabel.text = nil; + self.extraLabel.text = nil; + self.captionLabel.text = nil; +} + +-(void) buttonReleased:(id) sender { + UIButton *theButton = (UIButton *)sender; + if (self.nameLabel == nil || self.extraLabel == nil) + [self prepareLabels]; + + self.nameLabel.text = nil; + self.extraLabel.text = nil; + self.captionLabel.text = nil; + if (theButton.currentTitle == nil) { + HW_setWeapon(theButton.tag); + playSound(@"clickSound"); + } if (IS_DUALHEAD() == NO) [self disappear]; } @@ -257,24 +322,35 @@ #pragma mark - #pragma mark memory -(void) didReceiveMemoryWarning { - self.weaponsImage = nil; + self.imagesArray = nil; self.buttonsArray = nil; + self.nameLabel = nil; + self.extraLabel = nil; + self.captionLabel = nil; MSG_MEMCLEAN(); [super didReceiveMemoryWarning]; } -(void) viewDidUnload { [[NSNotificationCenter defaultCenter] removeObserver:self]; - self.weaponsImage = nil; + self.imagesArray = nil; self.buttonsArray = nil; + self.nameLabel = nil; + self.extraLabel = nil; + self.captionLabel = nil; free(delay); delay = NULL; + free(shouldUpdateImage); + shouldUpdateImage = NULL; MSG_DIDUNLOAD(); [super viewDidUnload]; } -(void) dealloc { - [weaponsImage release]; + [nameLabel release]; + [extraLabel release]; + [captionLabel release]; + [imagesArray release]; [buttonsArray release]; [super dealloc]; } diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/CommodityFunctions.h --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Tue Oct 19 19:47:17 2010 -0400 @@ -50,6 +50,7 @@ #define UICOLOR_HW_YELLOW_BODER [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xC0/255 blue:0 alpha:1] #define UICOLOR_HW_YELLOW_TEXT [UIColor colorWithRed:(CGFloat)0xF0/255 green:(CGFloat)0xD0/255 blue:0 alpha:1] #define UICOLOR_HW_DARKBLUE [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:1] +#define UICOLOR_HW_ALPHABLUE [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:0.58f] #define IS_DUALHEAD() ([[UIScreen screens] count] > 1) @@ -67,3 +68,5 @@ NSInteger randomPort (void); NSString *modelType (void); NSArray *getAvailableColors (void); +UILabel *createBlueLabel (NSString *title, CGRect frame); +UILabel *createLabelWithParams (NSString *title, CGRect frame, CGFloat borderWidth, UIColor *borderColor, UIColor *backgroundColor); diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/CommodityFunctions.m --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Tue Oct 19 19:47:17 2010 -0400 @@ -24,6 +24,7 @@ #import #import #import +#import #import "AudioToolbox/AudioToolbox.h" #import "PascalImports.h" @@ -74,45 +75,45 @@ switch (type) { case 0: //default theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: - @"9391929422199121032235111001201000000211110101011",@"ammostore_initialqt", - @"0405040541600655546554464776576666666155510101117",@"ammostore_probability", + @"9391929422199121032235111001201000000211110101010",@"ammostore_initialqt", + @"0405040541600655546554464776576666666155510101110",@"ammostore_probability", @"0000000000000205500000040007004000000000200000000",@"ammostore_delay", - @"1311110312111111123114111111111111111211111101111",@"ammostore_crate", nil]; + @"1311110312111111123114111111111111111211111101110",@"ammostore_crate", nil]; break; case 1: //crazy theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: - @"9999999999999999992999999999999999299999999909999",@"ammostore_initialqt", - @"1111110111111111111111111111111111111111111101111",@"ammostore_probability", + @"9999999999999999992999999999999999299999999909990",@"ammostore_initialqt", + @"1111110111111111111111111111111111111111111101110",@"ammostore_probability", @"0000000000000000000000000000000000000000000000000",@"ammostore_delay", - @"1311110312111111123114111111111111111211110101111",@"ammostore_crate", nil]; + @"1311110312111111123114111111111111111211110101110",@"ammostore_crate", nil]; break; case 2: //pro mode theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: @"9090009000000000000009000000000000000000000000000",@"ammostore_initialqt", @"0000000000000000000000000000000000000000000000000",@"ammostore_probability", @"0000000000000205500000040007004000000000200000000",@"ammostore_delay", - @"1111111111111111111111111111111111111111100101111",@"ammostore_crate", nil]; + @"1111111111111111111111111111111111111111100101110",@"ammostore_crate", nil]; break; case 3: //shoppa theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: @"0000009900000000000000000000000000000000000000000",@"ammostore_initialqt", @"4444410044244402210112121222422000000002000400010",@"ammostore_probability", @"0000000000000000000000000000000000000000000000000",@"ammostore_delay", - @"1111111111111111111111111111111111111111101101111",@"ammostore_crate", nil]; + @"1111111111111111111111111111111111111111101101110",@"ammostore_crate", nil]; break; case 4: //basketball theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: @"9391929422199121032235111001201000000211110101000",@"ammostore_initialqt", @"0000000000000000000000000000000000000000000000000",@"ammostore_probability", @"0000000000000005500000040007004000000000200000000",@"ammostore_delay", - @"1111111111111111111111111111111111111111111101111",@"ammostore_crate", nil]; + @"1111111111111111111111111111111111111111111101110",@"ammostore_crate", nil]; break; case 5: //minefield theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: @"0000009900090000000300000000000000000000000000000",@"ammostore_initialqt", @"0000000000000000000000000000000000000000000000000",@"ammostore_probability", @"0000000000000205500000040007004000000000200000000",@"ammostore_delay", - @"1111111111111111111111111111111111111111111101111",@"ammostore_crate", nil]; + @"1111111111111111111111111111111111111111111101110",@"ammostore_crate", nil]; break; default: NSLog(@"Nope"); @@ -260,7 +261,7 @@ AudioServicesPlaySystemSound(soundID); } -NSArray inline *getAvailableColors(void) { +NSArray inline *getAvailableColors (void) { return [NSArray arrayWithObjects:[NSNumber numberWithUnsignedInt:0x4376e9], // bluette [NSNumber numberWithUnsignedInt:0x3e9321], // greeeen [NSNumber numberWithUnsignedInt:0xa23dbb], // violett @@ -271,3 +272,26 @@ [NSNumber numberWithUnsignedInt:0x3da2bb], // cyannnn nil]; } + +UILabel *createBlueLabel (NSString *title, CGRect frame) { + return createLabelWithParams(title, frame, 1.5f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_DARKBLUE); +} + +UILabel *createLabelWithParams (NSString *title, CGRect frame, CGFloat borderWidth, UIColor *borderColor, UIColor *backgroundColor) { + UILabel *theLabel = [[UILabel alloc] initWithFrame:frame]; + theLabel.backgroundColor = backgroundColor; + + if (title != nil) { + theLabel.text = title; + theLabel.textColor = UICOLOR_HW_YELLOW_TEXT; + theLabel.textAlignment = UITextAlignmentCenter; + theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100]; + } + + [theLabel.layer setBorderWidth:borderWidth]; + [theLabel.layer setBorderColor:borderColor.CGColor]; + [theLabel.layer setCornerRadius:8.0f]; + [theLabel.layer setMasksToBounds:YES]; + + return theLabel; +} diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -256,7 +256,7 @@ [self.imgContainer removeFromSuperview]; self.imgContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 40)]; - for (int i = 0; i < 1 + random()%40; i++) { + for (int i = 0; i < 1 + random()%20; i++) { NSString *hat = [hatArray objectAtIndex:random()%numberOfHats]; NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat]; @@ -266,7 +266,10 @@ [hatSprite release]; UIImageView *hog = [[UIImageView alloc] initWithImage:hogWithHat]; - hog.frame = CGRectMake(10*(i+1)+random()%30, 30, 32, 32); + int x = 15*(i+1)+random()%40; + if (x + 32 > 300) + x = i*10; + hog.frame = CGRectMake(x, 30, 32, 32); [self.imgContainer addSubview:hog]; [hog release]; } @@ -287,10 +290,37 @@ name:@"buttonPressed" object:nil]; srandom(time(NULL)); - + // load other controllers if (self.mapConfigViewController == nil) self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil]; + + UILabel *leftBackground = createLabelWithParams(nil, CGRectMake(0, 60, 320, 620), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE); + [self.mapConfigViewController.view addSubview:leftBackground]; + [leftBackground release]; + UILabel *middleBackground = createLabelWithParams(nil, CGRectMake(337, 187, 350, 505), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE); + [self.mapConfigViewController.view addSubview:middleBackground]; + [middleBackground release]; + UILabel *rightBackground = createLabelWithParams(nil, CGRectMake(704, 214, 320, 464), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE); + [self.mapConfigViewController.view addSubview:rightBackground]; + [rightBackground release]; + UILabel *topBackground = createLabelWithParams(nil, CGRectMake(714, 14, 300, 190), 2.3f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE); + [self.mapConfigViewController.view addSubview:topBackground]; + [topBackground release]; + UILabel *bottomLeftBackground = createLabelWithParams(nil, CGRectMake(106, 714, 320, 40), 2.0f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE); + [self.mapConfigViewController.view addSubview:bottomLeftBackground]; + [bottomLeftBackground release]; + UILabel *bottomRightBackground = createLabelWithParams(NSLocalizedString(@"Max Hogs: ",@""), CGRectMake(594, 714, 320, 40), 2.0f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE); + bottomRightBackground.font = [UIFont italicSystemFontOfSize:[UIFont labelFontSize]]; + [self.mapConfigViewController.view addSubview:bottomRightBackground]; + [bottomRightBackground release]; + [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.maxLabel]; + [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.sizeLabel]; + [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.segmentedControl]; + [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.previewButton]; + [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.slider]; + [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.tableView]; + if (self.teamConfigViewController == nil) self.teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; [self.mapConfigViewController.view addSubview:self.teamConfigViewController.view]; @@ -300,7 +330,7 @@ self.mapConfigViewController.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width); self.teamConfigViewController.view.frame = CGRectMake(348, 200, 328, 480); self.schemeWeaponConfigViewController.view.frame = CGRectMake(10, 70, 300, 600); - + } else { // this is the visible controller if (self.mapConfigViewController == nil) @@ -348,16 +378,15 @@ } -(void) didReceiveMemoryWarning { - if (self.mapConfigViewController.view.superview == nil) - self.mapConfigViewController = nil; if (self.teamConfigViewController.view.superview == nil) self.teamConfigViewController = nil; if (self.schemeWeaponConfigViewController.view.superview == nil) self.schemeWeaponConfigViewController = nil; if (self.helpPage.view.superview == nil) self.helpPage = nil; + if (self.mapConfigViewController.view.superview == nil) + self.mapConfigViewController = nil; - // Release any cached data, images, etc that aren't in use. self.imgContainer = nil; MSG_MEMCLEAN(); [super didReceiveMemoryWarning]; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/GameSetup.m --- a/project_files/HedgewarsMobile/Classes/GameSetup.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/GameSetup.m Tue Oct 19 19:47:17 2010 -0400 @@ -52,7 +52,7 @@ // if path is empty it means that you have to create a new file, otherwise read from that file if ([path isEqualToString:@""] == YES) { NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; - [outputFormatter setDateFormat:@"yyyy.MM.dd '@' HH-mm"]; + [outputFormatter setDateFormat:@"yyyy-MM-dd '@' HH.mm"]; NSString *newDateString = [outputFormatter stringFromDate:[NSDate date]]; self.savePath = [SAVES_DIRECTORY() stringByAppendingFormat:@"%@.hws", newDateString]; [outputFormatter release]; @@ -416,8 +416,7 @@ case 'q': // game ended, can remove the savefile [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil]; - // so update the relative viewcontroler and the overlay - [[NSNotificationCenter defaultCenter] postNotificationName:@"removedSave" object:nil]; + //[[NSNotificationCenter defaultCenter] postNotificationName:@"removedSave" object:nil]; // and remove + disable the overlay [[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil]; setGameRunning(NO); @@ -461,7 +460,6 @@ rotation = @"-90"; else rotation = @"90"; - } NSString *horizontalSize = [[NSString alloc] initWithFormat:@"%d", width]; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/MapConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -467,7 +467,7 @@ -(void) didReceiveMemoryWarning { self.dataSourceArray = nil; - self.lastIndexPath = nil; + //self.lastIndexPath = nil; MSG_MEMCLEAN(); [super didReceiveMemoryWarning]; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/OverlayViewController.h --- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.h Tue Oct 19 19:47:17 2010 -0400 @@ -40,6 +40,7 @@ // the objc ammomenu AmmoMenuViewController *amvc; + BOOL wasVisible; // ths touch section CGFloat initialDistanceForPinching; @@ -53,6 +54,7 @@ // dual head support NSInteger initialScreenCount; + NSInteger a, b; } @property (nonatomic,retain) id popoverController; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/OverlayViewController.m --- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -45,68 +45,104 @@ @implementation OverlayViewController @synthesize popoverController, popupMenu, helpPage, amvc, isNetGame, useClassicMenu; +#pragma mark - +#pragma mark rotation -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { return rotationManager(interfaceOrientation); } +// pause the game and remove objc menus so that animation is smoother +-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval) duration{ + [self dismissPopover]; + if (HW_isPaused() == NO) + HW_pause(); + if (self.amvc.isVisible && IS_DUALHEAD() == NO) { + [self.amvc disappear]; + wasVisible = YES; + } else + wasVisible = NO; + + [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; +} + +// now restore previous state +-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation) fromInterfaceOrientation { + if (wasVisible || IS_DUALHEAD()) + [self.amvc appearInView:self.view]; + if (HW_isPaused() == YES) + HW_pause(); + + [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; +} + +// rotate the sdl view according to the orientation -- the uiview is autorotated -(void) didRotate:(NSNotification *)notification { UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; - CGRect rect = [[UIScreen mainScreen] bounds]; - CGRect usefulRect = CGRectMake(0, 0, rect.size.width, rect.size.height); UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG]; - + CGRect screenRect = [[UIScreen mainScreen] bounds]; + [UIView beginAnimations:@"rotation" context:NULL]; - [UIView setAnimationDuration:0.8f]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:0.7]; switch (orientation) { case UIDeviceOrientationLandscapeLeft: - if (IS_DUALHEAD() == NO) - sdlView.transform = CGAffineTransformMakeRotation(degreesToRadians(180)); - self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90)); + if (IS_DUALHEAD()) { + self.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height); + self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90)); + } else + sdlView.transform = CGAffineTransformMakeRotation(degreesToRadians(a)); break; case UIDeviceOrientationLandscapeRight: - if (IS_DUALHEAD() == NO) - sdlView.transform = CGAffineTransformMakeRotation(degreesToRadians(0)); - self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(-90)); - break; - case UIDeviceOrientationPortrait: - if (IS_DUALHEAD()) - self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(0)); - break; - case UIDeviceOrientationPortraitUpsideDown: - if (IS_DUALHEAD()) - self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(180)); + if (IS_DUALHEAD()) { + self.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height); + self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(-90)); + } else + sdlView.transform = CGAffineTransformMakeRotation(degreesToRadians(b)); break; default: // a debug log would spam too much break; } - if (self.amvc.isVisible) - [self.amvc appearInView:self.view]; - self.view.frame = usefulRect; [UIView commitAnimations]; - + // for single screens only landscape mode is supported // for dual screen mode the sdlview is not modified, but you can rotate the pad in any direction } #pragma mark - #pragma mark View Management +-(id) initWithCoder:(NSCoder *)aDecoder { + if ((self = [super initWithCoder:aDecoder])) { + isGameRunning = NO; + isReplay = NO; + cachedGrenadeTime = 2; + + isAttacking = NO; + wasVisible = NO; + isPopoverVisible = NO; // it is called "popover" even on the iphone + } + return self; +} + -(void) viewDidLoad { - isGameRunning = NO; - isReplay = NO; - cachedGrenadeTime = 2; - isAttacking = NO; - - // i called it a popover even on the iphone - isPopoverVisible = NO; + CGRect screenRect = [[UIScreen mainScreen] bounds]; + self.view.frame = CGRectMake(0, 0, screenRect.size.height, screenRect.size.width); + self.view.center = CGPointMake(self.view.frame.size.height/2, self.view.frame.size.width/2); self.view.alpha = 0; - self.view.center = CGPointMake(self.view.frame.size.height/2.0, self.view.frame.size.width/2.0); + // detrmine the quanitiy and direction of the rotation + if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { + a = 180; + b = 0; + } else { + a = 0; + b = 180; + } + + // get the number of screens to know the previous state whan a display is connected or detached initialScreenCount = [[UIScreen screens] count]; + // set initial orientation of the controller orientation if (IS_DUALHEAD()) { - // set initial orientation wrt the controller orientation switch (self.interfaceOrientation) { case UIDeviceOrientationLandscapeLeft: self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90)); @@ -114,30 +150,23 @@ case UIDeviceOrientationLandscapeRight: self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(-90)); break; - case UIDeviceOrientationPortrait: - self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(0)); - break; - case UIDeviceOrientationPortraitUpsideDown: - self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(180)); - break; default: DLog(@"Nope"); break; } } - CGRect screenRect = [[UIScreen mainScreen] bounds]; - self.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height); + // the timer used to dim the overlay dimTimer = [[NSTimer alloc] initWithFireDate:(IS_DUALHEAD()) ? HIDING_TIME_NEVER : [NSDate dateWithTimeIntervalSinceNow:6] interval:1000 target:self selector:@selector(dimOverlay) userInfo:nil repeats:YES]; - // add timer to runloop, otherwise it doesn't work [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode]; + // become listener of some notifications [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) @@ -163,7 +192,8 @@ selector:@selector(numberOfScreensDecreased) name:UIScreenDidDisconnectNotification object:nil]; - + + // present the overlay [UIView beginAnimations:@"showing overlay" context:NULL]; [UIView setAnimationDuration:1]; self.view.alpha = 1; @@ -209,6 +239,12 @@ doNotDim(); } +-(void) cleanup { + [self dismissPopover]; + HW_terminate(NO); + [self.view removeFromSuperview]; +} + -(void) didReceiveMemoryWarning { if (self.popupMenu.view.superview == nil) self.popupMenu = nil; @@ -227,6 +263,9 @@ -(void) viewDidUnload { // only objects initialized in viewDidLoad should be here [[NSNotificationCenter defaultCenter] removeObserver:self]; + [NSObject cancelPreviousPerformRequestsWithTarget:self + selector:@selector(unsetPreciseStatus) + object:nil]; dimTimer = nil; self.helpPage = nil; [self dismissPopover]; @@ -245,14 +284,8 @@ [super dealloc]; } --(void) cleanup { - [self dismissPopover]; - HW_terminate(NO); - [self.view removeFromSuperview]; -} - #pragma mark - -#pragma mark Overlay actions and members +#pragma mark overlay user interaction // nice transition for dimming, should be called only by the timer himself -(void) dimOverlay { if (isGameRunning) { @@ -381,6 +414,22 @@ HW_preciseSet(NO); } +-(void) sendHWClick { + HW_click(); + removeConfirmationInput(); + doDim(); +} + +-(void) setGrenadeTime:(id) sender { + UISegmentedControl *theSegment = (UISegmentedControl *)sender; + if (cachedGrenadeTime != theSegment.selectedSegmentIndex) { + HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1); + cachedGrenadeTime = theSegment.selectedSegmentIndex; + } +} + +#pragma mark - +#pragma mark other menu // present a further check before closing game -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex { if ([actionSheet cancelButtonIndex] != buttonIndex) @@ -475,8 +524,6 @@ } } - //if (currentPosition.y < screen.size.width - 130 || (currentPosition.x > 130 && currentPosition.x < screen.size.height - 130)) { - -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { CGRect screen = [[UIScreen mainScreen] bounds]; NSSet *allTouches = [event allTouches]; @@ -564,20 +611,6 @@ initialDistanceForPinching = 0; } --(void) sendHWClick { - HW_click(); - removeConfirmationInput(); - doDim(); -} - --(void) setGrenadeTime:(id) sender { - UISegmentedControl *theSegment = (UISegmentedControl *)sender; - if (cachedGrenadeTime != theSegment.selectedSegmentIndex) { - HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1); - cachedGrenadeTime = theSegment.selectedSegmentIndex; - } -} - -(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [self touchesEnded:touches withEvent:event]; } @@ -642,7 +675,7 @@ } #pragma mark - -#pragma mark Functions called by pascal +#pragma mark Functions called by pascal code void inline setGameRunning(BOOL value) { isGameRunning = value; } diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/PascalImports.h --- a/project_files/HedgewarsMobile/Classes/PascalImports.h Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/PascalImports.h Tue Oct 19 19:47:17 2010 -0400 @@ -84,6 +84,8 @@ void HW_setWeapon(int whichone); BOOL HW_isWeaponAnEffect(int whichone); char *HW_getWeaponNameByIndex(int whichone); + char *HW_getWeaponCaptionByIndex(int whichone); + char *HW_getWeaponDescriptionByIndex(int whichone); void HW_getAmmoDelays(unsigned char *pointer); int HW_getAmmoCounts(int *pointer); diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/SavedGamesViewController.m --- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -41,16 +41,12 @@ -(void) viewDidLoad { self.tableView.backgroundView = nil; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(viewWillAppear:) - name:@"removedSave" - object:nil]; [super viewDidLoad]; } -(void) viewWillAppear:(BOOL)animated { + [self updateTable]; [super viewWillAppear:animated]; - [self updateTable]; } #pragma mark - @@ -198,11 +194,12 @@ NSString *filePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]]; NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys: - [NSDictionary dictionary],@"game_dictionary", filePath,@"savefile", [NSNumber numberWithBool:NO],@"netgame", + [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:self.interfaceOrientation] forKey:@"orientation"],@"game_dictionary", nil]; [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary]; + [self.parentViewController dismissModalViewControllerAnimated:NO]; } #pragma mark - diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -20,7 +20,6 @@ #import "SchemeWeaponConfigViewController.h" -#import #import "CommodityFunctions.h" #import "SDL_uikitappdelegate.h" @@ -127,22 +126,14 @@ } -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - UILabel *theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30)]; - theLabel.backgroundColor = [UIColor blueColor]; + CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30); + NSString *text; if (section == 0) - theLabel.text = NSLocalizedString(@"Schemes",@""); + text = NSLocalizedString(@"Schemes",@""); else - theLabel.text = NSLocalizedString(@"Weapons",@""); + text = NSLocalizedString(@"Weapons",@""); + UILabel *theLabel = createBlueLabel(text, frame); theLabel.center = CGPointMake(self.view.frame.size.width/2, 20); - theLabel.textColor = UICOLOR_HW_YELLOW_TEXT; - theLabel.textAlignment = UITextAlignmentCenter; - theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100]; - theLabel.backgroundColor = UICOLOR_HW_DARKBLUE; - - [theLabel.layer setBorderWidth:1.5f]; - [theLabel.layer setBorderColor:[UICOLOR_HW_YELLOW_BODER CGColor]]; - [theLabel.layer setCornerRadius:8.0f]; - [theLabel.layer setMasksToBounds:YES]; UIView *theView = [[[UIView alloc] init] autorelease]; [theView addSubview:theLabel]; @@ -150,16 +141,6 @@ return theView; } -/* --(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger) section { - if (section == 0) { - return NSLocalizedString(@"Schemes",@""); - } else { - return NSLocalizedString(@"Weapons",@"");; - } -} -*/ - #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/TeamConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Tue Oct 19 19:47:17 2010 -0400 @@ -20,7 +20,6 @@ #import "TeamConfigViewController.h" -#import #import "CommodityFunctions.h" #import "HogButtonView.h" #import "SquareButtonView.h" @@ -172,22 +171,14 @@ } -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - UILabel *theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30)]; - theLabel.backgroundColor = [UIColor blueColor]; + CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30); + NSString *text; if (section == 0) - theLabel.text = NSLocalizedString(@"Playing Teams",@""); + text = NSLocalizedString(@"Playing Teams",@""); else - theLabel.text = NSLocalizedString(@"Available Teams",@""); + text = NSLocalizedString(@"Available Teams",@""); + UILabel *theLabel = createBlueLabel(text, frame); theLabel.center = CGPointMake(self.view.frame.size.width/2, 20); - theLabel.textColor = UICOLOR_HW_YELLOW_TEXT; - theLabel.textAlignment = UITextAlignmentCenter; - theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100]; - theLabel.backgroundColor = UICOLOR_HW_DARKBLUE; - - [theLabel.layer setBorderWidth:1.5f]; - [theLabel.layer setBorderColor:[UICOLOR_HW_YELLOW_BODER CGColor]]; - [theLabel.layer setCornerRadius:8.0f]; - [theLabel.layer setMasksToBounds:YES]; UIView *theView = [[[UIView alloc] init] autorelease]; [theView addSubview:theLabel]; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Classes/UIImageExtra.m --- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m Tue Oct 19 19:47:17 2010 -0400 @@ -138,9 +138,9 @@ UIImage *newImage = [UIImage imageWithCGImage:imageRef]; // Release colorspace, context and bitmap information - CGColorSpaceRelease(colorSpace); + CFRelease(imageRef); CGContextRelease(context); - CFRelease(imageRef); + CGColorSpaceRelease(colorSpace); // Return the new grayscale image return newImage; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Tue Oct 19 19:47:17 2010 -0400 @@ -145,7 +145,6 @@ 61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; }; 61EBA62A11DFF2BC0048B68A /* title.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62811DFF2BC0048B68A /* title.png */; }; 61EBA62D11DFF3310048B68A /* backgroundAndTitle.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */; }; - 61EBB1E41228920300C1784F /* bluebox-squeezed.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBB1E31228920300C1784F /* bluebox-squeezed.png */; }; 61EF920E11DF57AC003441C4 /* arrowDown.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920511DF57AC003441C4 /* arrowDown.png */; }; 61EF920F11DF57AC003441C4 /* arrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920611DF57AC003441C4 /* arrowLeft.png */; }; 61EF921011DF57AC003441C4 /* arrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920711DF57AC003441C4 /* arrowRight.png */; }; @@ -164,7 +163,6 @@ 61F9040911DF58B00068B24D /* settingsButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040811DF58B00068B24D /* settingsButton.png */; }; 61F9040B11DF59370068B24D /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040A11DF59370068B24D /* background.png */; }; 61F9040E11DF59D10068B24D /* localplayButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040C11DF59D10068B24D /* localplayButton.png */; }; - 61F9043A11DF64E20068B24D /* bluebox.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9043911DF64E20068B24D /* bluebox.png */; }; 61F904D711DF7DA30068B24D /* WeaponCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F904D611DF7DA30068B24D /* WeaponCellView.m */; }; 922F64900F10F53100DC6EC0 /* libfpc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 928301170F10CAFC00CC5A3C /* libfpc.a */; }; /* End PBXBuildFile section */ @@ -885,7 +883,6 @@ 61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; }; 61EBA62811DFF2BC0048B68A /* title.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = title.png; path = "Resources/Frontend-iPad/title.png"; sourceTree = ""; }; 61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backgroundAndTitle.png; path = "Resources/Frontend-iPad/backgroundAndTitle.png"; sourceTree = ""; }; - 61EBB1E31228920300C1784F /* bluebox-squeezed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bluebox-squeezed.png"; path = "Resources/Frontend-iPad/bluebox-squeezed.png"; sourceTree = ""; }; 61EF920511DF57AC003441C4 /* arrowDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowDown.png; path = Resources/Overlay/arrowDown.png; sourceTree = ""; }; 61EF920611DF57AC003441C4 /* arrowLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowLeft.png; path = Resources/Overlay/arrowLeft.png; sourceTree = ""; }; 61EF920711DF57AC003441C4 /* arrowRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowRight.png; path = Resources/Overlay/arrowRight.png; sourceTree = ""; }; @@ -918,7 +915,6 @@ 61F9040A11DF59370068B24D /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background.png; path = "Resources/Frontend-iPad/background.png"; sourceTree = ""; }; 61F9040C11DF59D10068B24D /* localplayButton.png */ = {isa = PBXFileReference; explicitFileType = image.png; name = localplayButton.png; path = "Resources/Frontend-iPad/localplayButton.png"; sourceTree = ""; }; 61F9040D11DF59D10068B24D /* netplayButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = netplayButton.png; path = "Resources/Frontend-iPad/netplayButton.png"; sourceTree = ""; }; - 61F9043911DF64E20068B24D /* bluebox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = bluebox.png; path = "Resources/Frontend-iPad/bluebox.png"; sourceTree = ""; }; 61F904D511DF7DA30068B24D /* WeaponCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeaponCellView.h; sourceTree = ""; }; 61F904D611DF7DA30068B24D /* WeaponCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeaponCellView.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1397,11 +1393,9 @@ 61F903FA11DF58680068B24D /* Frontend-iPad */ = { isa = PBXGroup; children = ( - 61EBB1E31228920300C1784F /* bluebox-squeezed.png */, 615AD96112073B4D00F2FF04 /* startGameButton.png */, 615AD9EA1207654E00F2FF04 /* helpButton.png */, 615AD9E8120764CA00F2FF04 /* backButton.png */, - 61F9043911DF64E20068B24D /* bluebox.png */, 61EBA62811DFF2BC0048B68A /* title.png */, 61F9040C11DF59D10068B24D /* localplayButton.png */, 61F9040D11DF59D10068B24D /* netplayButton.png */, @@ -2093,7 +2087,6 @@ 61F9040911DF58B00068B24D /* settingsButton.png in Resources */, 61F9040B11DF59370068B24D /* background.png in Resources */, 61F9040E11DF59D10068B24D /* localplayButton.png in Resources */, - 61F9043A11DF64E20068B24D /* bluebox.png in Resources */, 61EBA62A11DFF2BC0048B68A /* title.png in Resources */, 61EBA62D11DFF3310048B68A /* backgroundAndTitle.png in Resources */, 61F7A43811E290650040BA66 /* Icon-72.png in Resources */, @@ -2111,7 +2104,6 @@ 615AD9E9120764CA00F2FF04 /* backButton.png in Resources */, 615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */, 6187AEBD120781B900B31A27 /* Settings in Resources */, - 61EBB1E41228920300C1784F /* bluebox-squeezed.png in Resources */, 611EE974122A9C4100DF6938 /* clickSound.wav in Resources */, 611EE9D9122AA10A00DF6938 /* backSound.wav in Resources */, 611EE9DA122AA10A00DF6938 /* selSound.wav in Resources */, @@ -2147,7 +2139,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\ncp -R ${PROJECT_DIR}/../../share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some files from QTfrontend/res\nmkdir ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/btn*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/ammopic.png ${PROJECT_DIR}/Data/Graphics/Btn/iconAmmo.png\ncp ${PROJECT_DIR}/../../QTfrontend/res/icon*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp -R ${PROJECT_DIR}/../../QTfrontend/res/botlevels ${PROJECT_DIR}/Data/Graphics/Hedgehog/botlevels\n\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\n\n#delete desktop frontend translation\nrm -rf ${PROJECT_DIR}/Data/Locale/hedgewars_*\n\n#delete dummy maps and hats\nrm -rf ${PROJECT_DIR}/Data/Maps/{test*,Ruler}\nrm -rf ${PROJECT_DIR}/Data/Hats/{TeamCap,TeamHeadband,TeamHair}\n\n#copy mono audio\ncp -R ${PROJECT_DIR}/audio/* ${PROJECT_DIR}/Data/\n\n#the following ones must be removed when their support is implemented\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\n\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nmv ${PROJECT_DIR}/Data/Maps/{Basketball,Knockball} ${PROJECT_DIR}/Data/Missions/Maps/\n\n#reduce the number of flakes for City\nawk '{if ($1 == 1500) $1=40; print $0}' < ${PROJECT_DIR}/Data/Themes/City/theme.cfg > /tmp/tempfile\nmv /tmp/tempfile ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\n#remove Isalnd from the list of Themes\nawk '{if ($1 != \"Island\") print $0}' < ${PROJECT_DIR}/Data/Themes/themes.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Themes/themes.cfg\n\n#remove Isalnd from the Maps and themes\nrm -rf ${PROJECT_DIR}/Data/Themes/Island\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/Cave/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/Cave/map.cfg\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/Lonely_Island/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/Lonely_Island/map.cfg\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/PirateFlag/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/PirateFlag/map.cfg\n\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n\n#delete useless fonts\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\n#delete all names, reserved hats\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\n"; + shellScript = "#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\ncp -R ${PROJECT_DIR}/../../share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some files from QTfrontend/res\nmkdir ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/btn*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/ammopic.png ${PROJECT_DIR}/Data/Graphics/Btn/iconAmmo.png\ncp ${PROJECT_DIR}/../../QTfrontend/res/icon*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp -R ${PROJECT_DIR}/../../QTfrontend/res/botlevels ${PROJECT_DIR}/Data/Graphics/Hedgehog/botlevels\n\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg -delete\nfind ${PROJECT_DIR}/Data -name *.svgz -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\n\n#delete desktop frontend translation\nrm -rf ${PROJECT_DIR}/Data/Locale/hedgewars_*\n\n#delete dummy maps and hats\nrm -rf ${PROJECT_DIR}/Data/Maps/{test*,Ruler}\nrm -rf ${PROJECT_DIR}/Data/Hats/{TeamCap,TeamHeadband,TeamHair}\n\n#copy mono audio\ncp -R ${PROJECT_DIR}/audio/* ${PROJECT_DIR}/Data/\n\n#the following ones must be removed when their support is implemented\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\n\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nmv ${PROJECT_DIR}/Data/Maps/{Basketball,Knockball} ${PROJECT_DIR}/Data/Missions/Maps/\n\n#reduce the number of flakes for City\nawk '{if ($1 == 1500) $1=40; print $0}' < ${PROJECT_DIR}/Data/Themes/City/theme.cfg > /tmp/tempfile\nmv /tmp/tempfile ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\n#remove Isalnd from the list of Themes\nawk '{if ($1 != \"Island\") print $0}' < ${PROJECT_DIR}/Data/Themes/themes.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Themes/themes.cfg\n\n#remove Isalnd from the Maps and themes\nrm -rf ${PROJECT_DIR}/Data/Themes/Island\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/Cave/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/Cave/map.cfg\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/Lonely_Island/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/Lonely_Island/map.cfg\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/PirateFlag/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/PirateFlag/map.cfg\n\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n\n#delete useless fonts\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\n#delete all names, reserved hats\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\n"; showEnvVarsInLog = 0; }; 9283011B0F10CB2D00CC5A3C /* Build libfpc.a */ = { @@ -2696,7 +2688,7 @@ FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.5.1; FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas"; FPC_RTL_UNITS_BASE = /usr/local/lib/fpc; - FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -O-2 -Xs -Cfvfpv2"; + FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -O-2 -Xs -Cfvfpv2 -dDEBUGFILE"; FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\""; GCC_C_LANGUAGE_STANDARD = c99; GCC_DEBUGGING_SYMBOLS = default; diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Info.plist --- a/project_files/HedgewarsMobile/Info.plist Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Info.plist Tue Oct 19 19:47:17 2010 -0400 @@ -28,9 +28,13 @@ CFBundleSignature ???? CFBundleVersion - 1.0.1 + 1.1 LSRequiresIPhoneOS + UIApplicationExitsOnSuspend + + UILaunchImageFile~ipad + LI-ipad UIStatusBarHidden UISupportedInterfaceOrientations @@ -38,9 +42,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UILaunchImageFile~ipad - LI-ipad - UIApplicationExitsOnSuspend - diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Resources/Frontend-iPad/bluebox-squeezed.png Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/bluebox-squeezed.png has changed diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Resources/Frontend-iPad/bluebox.png Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/bluebox.png has changed diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Resources/MainMenuViewController-iPad.xib --- a/project_files/HedgewarsMobile/Resources/MainMenuViewController-iPad.xib Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Resources/MainMenuViewController-iPad.xib Tue Oct 19 19:47:17 2010 -0400 @@ -90,33 +90,6 @@ localplayButton.png - - - -2147483356 - {{611, 417}, {263, 244}} - - NO - 1 - IBIPadFramework - 0 - 0 - - 215 - 0.0 - 0.0 - 0.0 - Multiplayer - - - 2 - MC45OTYwNzg0OTEyIDAuODAwMDAwMDcxNSAwLjAzOTIxNTY4NzY2AA - - - - NSImage - netplayButton.png - - 292 @@ -227,15 +200,6 @@ switchViews: - - - 7 - - 49 - - - - switchViews: 7 @@ -267,7 +231,6 @@ YES - @@ -293,12 +256,6 @@ local - 40 - - - multi - - 45 @@ -330,7 +287,6 @@ 1.IBPluginDependency 37.IBPluginDependency 39.IBPluginDependency - 40.IBPluginDependency 45.IBPluginDependency 52.IBPluginDependency 88.IBPluginDependency @@ -346,7 +302,6 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -384,17 +339,6 @@ id - - versionLabel - UILabel - - - versionLabel - - versionLabel - UILabel - - IBProjectSource Classes/MainMenuViewController.h @@ -533,14 +477,6 @@ - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - UIResponder NSObject @@ -633,7 +569,6 @@ YES backgroundAndTitle.png localplayButton.png - netplayButton.png savesButton.png settingsButton.png @@ -641,7 +576,6 @@ YES {1024, 768} {263, 244} - {263, 244} {61, 59} {61, 59} diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib --- a/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Tue Oct 19 19:47:17 2010 -0400 @@ -47,6 +47,7 @@ 292 {1024, 768} + NO NO IBIPadFramework @@ -54,97 +55,6 @@ background.png - - - 292 - {{0, 60}, {320, 618}} - - NO - NO - IBIPadFramework - - NSImage - bluebox.png - - - - - 292 - {{704, 214}, {320, 464}} - - NO - NO - IBIPadFramework - - - - - 292 - {{337, 187}, {350, 505}} - - NO - NO - IBIPadFramework - - - - - 292 - {{714, 14}, {300, 190}} - - NO - NO - IBIPadFramework - - - - - 292 - {{106, 707}, {320, 40}} - - NO - NO - IBIPadFramework - - NSImage - bluebox-squeezed.png - - - - - 292 - {{594, 707}, {320, 40}} - - NO - NO - IBIPadFramework - - - - - 292 - {{610, 713}, {145, 29}} - - NO - YES - 7 - NO - IBIPadFramework - Max Hogs: - - Helvetica-Oblique - 18 - 16 - - - 2 - MC45MTM3MjU1NTQ5IDAuNzMzMzMzMzQ5MiAwLjAxMTc2NDcwNzA0AA - - - 1 - 10 - 2 - 289 @@ -198,7 +108,7 @@ 292 - {{263, 716}, {149, 23}} + {{263, 723}, {149, 23}} NO IBIPadFramework @@ -241,7 +151,7 @@ 292 - {{778, 717}, {42, 21}} + {{778, 725}, {42, 21}} NO YES @@ -266,7 +176,7 @@ 292 - {{112, 713}, {145, 29}} + {{112, 720}, {145, 29}} NO YES @@ -274,7 +184,11 @@ NO IBIPadFramework Label - + + Helvetica-Oblique + 18 + 16 + 2 MC45MTM3MjU1NTQ5IDAuNzMzMzMzMzQ5MiAwLjAxMTc2NDcwNzA0AA @@ -284,48 +198,10 @@ 10 1 - - - -2147483356 - {{10, 70}, {300, 600}} - - NO - IBIPadFramework - 0 - 0 - - 1 - teams section - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - -2147483356 - {{348, 200}, {328, 480}} - - NO - IBIPadFramework - 0 - 0 - - 1 - details section - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 292 - {{357, 30}, {309, 165}} + {{357, 28}, {309, 165}} NO NO @@ -357,7 +233,7 @@ 292 - {{441, 693}, {142, 64}} + {{441, 702}, {142, 64}} NO 1 @@ -609,19 +485,10 @@ - - - - - - - - - @@ -653,16 +520,6 @@ - 51 - - - - - 39 - - - - 17 @@ -688,41 +545,6 @@ - 78 - - - - - 80 - - - - - 79 - - - - - 61 - - - - - 54 - - - - - 53 - - - - - 55 - - - - 50 @@ -739,23 +561,14 @@ 1.IBPluginDependency 11.IBPluginDependency 17.IBPluginDependency - 39.IBPluginDependency 50.IBPluginDependency - 51.IBPluginDependency - 53.IBPluginDependency - 54.IBPluginDependency - 55.IBPluginDependency 57.IBPluginDependency - 61.IBPluginDependency 66.IBPluginDependency 7.IBPluginDependency 70.IBPluginDependency 72.IBPluginDependency 75.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency 8.IBPluginDependency - 80.IBPluginDependency 9.CustomClassName 9.IBPluginDependency @@ -763,16 +576,7 @@ YES MapConfigViewController UIResponder - {{489, 236}, {1024, 768}} - 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 + {{288, 236}, {1024, 768}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -869,7 +673,6 @@ YES YES - delegate maxLabel previewButton segmentedControl @@ -879,7 +682,6 @@ YES - id UILabel MapPreviewButtonView UISegmentedControl @@ -892,7 +694,6 @@ YES YES - delegate maxLabel previewButton segmentedControl @@ -903,10 +704,6 @@ YES - delegate - id - - maxLabel UILabel @@ -1221,8 +1018,6 @@ YES backButton.png background.png - bluebox-squeezed.png - bluebox.png helpButton.png startGameButton.png title.png @@ -1231,8 +1026,6 @@ YES {64, 64} {1024, 768} - {320, 40} - {512, 512} {64, 64} {142, 64} {273, 151} diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/Resources/Settings/credits.plist --- a/project_files/HedgewarsMobile/Resources/Settings/credits.plist Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/Resources/Settings/credits.plist Tue Oct 19 19:47:17 2010 -0400 @@ -17,7 +17,7 @@ Henning "Prg" Kühn - Finn "Tiyuri" Brice + Tiyuri Joshua Frese Stanko Tadić Julien Koesten @@ -71,7 +71,7 @@ Maze maps - Main graphics and art director + diff -r 91ac041ecb20 -r 57121975b64b project_files/HedgewarsMobile/SDL.patch --- a/project_files/HedgewarsMobile/SDL.patch Tue Oct 19 19:46:43 2010 -0400 +++ b/project_files/HedgewarsMobile/SDL.patch Tue Oct 19 19:47:17 2010 -0400 @@ -1,48 +1,7 @@ -diff -r f50c7996d925 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj ---- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Wed Sep 29 21:24:50 2010 -0700 -+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sun Oct 03 00:21:37 2010 +0200 -@@ -106,6 +106,7 @@ - 04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; }; - 56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; }; - 56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; }; -+ 61F7E7F4125543DA00DE6C14 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; }; - FD24846D0E5655AE0021E198 /* SDL_uikitkeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = FD24846B0E5655AE0021E198 /* SDL_uikitkeyboard.h */; }; - FD3F495C0DEA5B2100C5B771 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = FD99B8CC0DD52EB400FB1D6B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FD3F495D0DEA5B2100C5B771 /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = FD99B8CD0DD52EB400FB1D6B /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; -@@ -192,8 +193,6 @@ - FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */; }; - FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */; }; - FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */; }; -- FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; }; -- FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */; }; - FD6C83B60DEA66E500ABEE55 /* SDL_systimer.h in Headers */ = {isa = PBXBuildFile; fileRef = FD99BA2D0DD52EDC00FB1D6B /* SDL_systimer.h */; }; - FD8BD7AC0E27DCA400B52CD5 /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = FD8BD7AB0E27DCA400B52CD5 /* SDL_opengles.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */; }; -@@ -1186,7 +1185,6 @@ - FD689F200E26E5D900F90B21 /* SDL_uikitvideo.h in Headers */, - FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */, - FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */, -- FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */, - FD8BD7AC0E27DCA400B52CD5 /* SDL_opengles.h in Headers */, - FDC656490E560DF800311C8E /* jumphack.h in Headers */, - FD24846D0E5655AE0021E198 /* SDL_uikitkeyboard.h in Headers */, -@@ -1347,6 +1345,7 @@ - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( -+ 61F7E7F4125543DA00DE6C14 /* SDL_uikitappdelegate.m in Sources */, - 006E9852119550FB001DE610 /* audio.c in Sources */, - 006E9853119550FB001DE610 /* common.c in Sources */, - 006E9859119550FB001DE610 /* platform.c in Sources */, -@@ -1429,7 +1428,6 @@ - FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */, - FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */, - FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */, -- FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */, - FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */, - FDC656480E560DF800311C8E /* jumphack.c in Sources */, - 0495E68C0E97408800152DFE /* SDL_renderer_gl.c in Sources */, -@@ -1549,15 +1547,19 @@ +diff -r c0021a587dc7 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj +--- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sun Oct 10 15:45:58 2010 -0700 ++++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sat Oct 16 18:35:03 2010 +0200 +@@ -1549,15 +1549,19 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -54,9 +13,8 @@ + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = NO; -- IPHONEOS_DEPLOYMENT_TARGET = 3.1; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../include\""; -+ IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; - SDKROOT = iphoneos3.2; @@ -64,7 +22,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; -@@ -1566,14 +1568,18 @@ +@@ -1566,14 +1570,19 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -74,21 +32,21 @@ GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 2; + GCC_THUMB_SUPPORT = NO; ++ GCC_UNROLL_LOOPS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = NO; -- IPHONEOS_DEPLOYMENT_TARGET = 3.1; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../include\""; -+ IPHONEOS_DEPLOYMENT_TARGET = 3.0; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; PREBINDING = NO; - SDKROOT = iphoneos3.2; + SDKROOT = iphoneos4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; -diff -r f50c7996d925 Xcode-iPhoneOS/SDL/testsdl-Info.plist ---- a/Xcode-iPhoneOS/SDL/testsdl-Info.plist Wed Sep 29 21:24:50 2010 -0700 -+++ b/Xcode-iPhoneOS/SDL/testsdl-Info.plist Sun Oct 03 00:21:37 2010 +0200 +diff -r c0021a587dc7 Xcode-iPhoneOS/SDL/testsdl-Info.plist +--- a/Xcode-iPhoneOS/SDL/testsdl-Info.plist Sun Oct 10 15:45:58 2010 -0700 ++++ b/Xcode-iPhoneOS/SDL/testsdl-Info.plist Sat Oct 16 18:35:03 2010 +0200 @@ -16,7 +16,5 @@ ???? CFBundleVersion @@ -97,9 +55,9 @@ - MainWindow -diff -r f50c7996d925 include/SDL_config_iphoneos.h ---- a/include/SDL_config_iphoneos.h Wed Sep 29 21:24:50 2010 -0700 -+++ b/include/SDL_config_iphoneos.h Sun Oct 03 00:21:37 2010 +0200 +diff -r c0021a587dc7 include/SDL_config_iphoneos.h +--- a/include/SDL_config_iphoneos.h Sun Oct 10 15:45:58 2010 -0700 ++++ b/include/SDL_config_iphoneos.h Sat Oct 16 18:35:03 2010 +0200 @@ -98,6 +98,8 @@ #define HAVE_COS 1 #define HAVE_COSF 1 @@ -135,9 +93,24 @@ +#define SDL_VIEW_TAG 456987 + #endif /* _SDL_config_iphoneos_h */ -diff -r f50c7996d925 src/video/SDL_renderer_gles.c ---- a/src/video/SDL_renderer_gles.c Wed Sep 29 21:24:50 2010 -0700 -+++ b/src/video/SDL_renderer_gles.c Sun Oct 03 00:21:37 2010 +0200 +diff -r c0021a587dc7 src/SDL_fatal.c +--- a/src/SDL_fatal.c Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/SDL_fatal.c Sat Oct 16 18:35:03 2010 +0200 +@@ -38,9 +38,9 @@ + static void + SDL_Parachute(int sig) + { +- signal(sig, SIG_DFL); ++ /*signal(sig, SIG_DFL); + SDL_Quit(); +- raise(sig); ++ raise(sig);*/ + } + + static const int SDL_fatal_signals[] = { +diff -r c0021a587dc7 src/video/SDL_renderer_gles.c +--- a/src/video/SDL_renderer_gles.c Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/video/SDL_renderer_gles.c Sat Oct 16 18:35:03 2010 +0200 @@ -324,6 +324,9 @@ data->glDisable(GL_CULL_FACE); data->updateSize = SDL_TRUE; @@ -219,9 +192,9 @@ } data->glDisable(GL_TEXTURE_2D); -diff -r f50c7996d925 src/video/SDL_video.c ---- a/src/video/SDL_video.c Wed Sep 29 21:24:50 2010 -0700 -+++ b/src/video/SDL_video.c Sun Oct 03 00:21:37 2010 +0200 +diff -r c0021a587dc7 src/video/SDL_video.c +--- a/src/video/SDL_video.c Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/video/SDL_video.c Sat Oct 16 18:35:03 2010 +0200 @@ -1416,9 +1416,9 @@ SDL_MinimizeWindow(window); } @@ -234,21 +207,23 @@ if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) && _this->SetWindowGrab) { _this->SetWindowGrab(_this, window); -diff -r f50c7996d925 src/video/uikit/SDL_uikitopengles.m ---- a/src/video/uikit/SDL_uikitopengles.m Wed Sep 29 21:24:50 2010 -0700 -+++ b/src/video/uikit/SDL_uikitopengles.m Sun Oct 03 00:21:37 2010 +0200 -@@ -114,7 +114,7 @@ +diff -r c0021a587dc7 src/video/uikit/SDL_uikitopengles.m +--- a/src/video/uikit/SDL_uikitopengles.m Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/video/uikit/SDL_uikitopengles.m Sat Oct 16 18:35:03 2010 +0200 +@@ -114,8 +114,8 @@ bBits: _this->gl_config.blue_size \ aBits: _this->gl_config.alpha_size \ depthBits: _this->gl_config.depth_size]; - +- data->view = view; + view.tag = SDL_VIEW_TAG; - data->view = view; ++ data->view = view; /* add the view to our window */ -diff -r f50c7996d925 src/video/uikit/SDL_uikitview.m ---- a/src/video/uikit/SDL_uikitview.m Wed Sep 29 21:24:50 2010 -0700 -+++ b/src/video/uikit/SDL_uikitview.m Sun Oct 03 00:21:37 2010 +0200 + [uiwindow addSubview: view ]; +diff -r c0021a587dc7 src/video/uikit/SDL_uikitview.m +--- a/src/video/uikit/SDL_uikitview.m Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/video/uikit/SDL_uikitview.m Sat Oct 16 18:35:03 2010 +0200 @@ -35,9 +35,6 @@ @implementation SDL_uikitview @@ -360,9 +335,9 @@ if (NULL == view) { SDL_SetError("Window has no view"); -diff -r f50c7996d925 src/video/uikit/SDL_uikitwindow.m ---- a/src/video/uikit/SDL_uikitwindow.m Wed Sep 29 21:24:50 2010 -0700 -+++ b/src/video/uikit/SDL_uikitwindow.m Sun Oct 03 00:21:37 2010 +0200 +diff -r c0021a587dc7 src/video/uikit/SDL_uikitwindow.m +--- a/src/video/uikit/SDL_uikitwindow.m Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/video/uikit/SDL_uikitwindow.m Sat Oct 16 18:35:03 2010 +0200 @@ -144,7 +144,10 @@ if (SDL_UIKit_supports_multiple_displays) { [uiwindow setScreen:uiscreen]; @@ -375,9 +350,9 @@ if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) { [uiwindow release]; return -1; -diff -r f50c7996d925 src/video/uikit/keyinfotable.h ---- a/src/video/uikit/keyinfotable.h Wed Sep 29 21:24:50 2010 -0700 -+++ b/src/video/uikit/keyinfotable.h Sun Oct 03 00:21:37 2010 +0200 +diff -r c0021a587dc7 src/video/uikit/keyinfotable.h +--- a/src/video/uikit/keyinfotable.h Sun Oct 10 15:45:58 2010 -0700 ++++ b/src/video/uikit/keyinfotable.h Sat Oct 16 18:35:03 2010 +0200 @@ -54,7 +54,7 @@ /* 10 */ { SDL_SCANCODE_UNKNOWN, 0 }, /* 11 */ { SDL_SCANCODE_UNKNOWN, 0 }, diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Forts/Barrelhouse-preview.png Binary file share/hedgewars/Data/Forts/Barrelhouse-preview.png has changed diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Forts/BarrelhouseL.png Binary file share/hedgewars/Data/Forts/BarrelhouseL.png has changed diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Forts/BarrelhouseR.png Binary file share/hedgewars/Data/Forts/BarrelhouseR.png has changed diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Forts/Island-preview.png Binary file share/hedgewars/Data/Forts/Island-preview.png has changed diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Forts/IslandL.png Binary file share/hedgewars/Data/Forts/IslandL.png has changed diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Forts/IslandR.png Binary file share/hedgewars/Data/Forts/IslandR.png has changed diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Locale/en.txt --- a/share/hedgewars/Data/Locale/en.txt Tue Oct 19 19:46:43 2010 -0400 +++ b/share/hedgewars/Data/Locale/en.txt Tue Oct 19 19:47:17 2010 -0400 @@ -49,7 +49,7 @@ 00:46=Flamethrower 00:47=Sticky Mine 00:48=Hammer -00:49=Resurrector +00:49=Resurrector (beta) 01:00=Let's fight! 01:01=Round draw @@ -430,6 +430,7 @@ 03:46=Hot Hot Hot! 03:47=Stick these somewhere useful! 03:48=It's Hammer time! +03:49=Does what you guess ; Weapon Descriptions (use | as line breaks) 04:00=Attack your enemies using a simple grenade.|It will explode once its timer reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power @@ -481,6 +482,7 @@ 04:46=Cover your foes with sizzling liquid flame.|Heartwarming!|Attack: Activate|Up/Down: Continue aiming|Left/Right: Modify spitting power 04:47=Double the fun with two spiky, sneaky, sticky mines.|Set up a chain reaction or defend yourself (or both!)|Attack: Hold to shoot with more power (twice) 04:48=Why should the moles get all the abuse?|Wacking a hog can be just as fun! A good|blow from this hammer will shave off one|third of a hog's health and plunge them|underground.|Attack: Activate +04:49=Resurrect your friends!|But beware that this also resurrects your foes.|Attack: Keep attack pressed to resurrect slowly|Up: Accelerate resurrection ; Game goal strings 05:00=Game Modes diff -r 91ac041ecb20 -r 57121975b64b share/hedgewars/Data/Locale/pt_PT.txt --- a/share/hedgewars/Data/Locale/pt_PT.txt Tue Oct 19 19:46:43 2010 -0400 +++ b/share/hedgewars/Data/Locale/pt_PT.txt Tue Oct 19 19:47:17 2010 -0400 @@ -49,6 +49,7 @@ 00:46=Lança-chamas 00:47=Mina Pegajosa 00:48=Martelo +00:49=Ressuscitador 01:00=Vamos lutar! 01:01=Ronda empatada @@ -403,7 +404,7 @@ 03:21=Arma Balística 03:22=Chama-me Indiana! 03:23=(Mesmo) Artes Marciais -03:24=O bolo NÃO é uma mentira! +03:24=Afinal o bolo NÃO é mentira! 03:25=Kit de Vestuário 03:26=Granada Sumarenta 03:27=Granada Escaldante @@ -421,14 +422,14 @@ 03:39=Utilitário de Transporte 03:40=Granada Incendiária 03:41=Enorme fã do Squawks -03:42="I'm making a note here... HUGE SUCCESS" +03:42=I'm making a note here... HUGE SUCCESS ; just to make it easier to compare... 03:43=A composição musical mais letal de sempre 03:44=Consumir de preferência antes de: 1923 03:45=O poder da ciência 03:46=Labaredas enormes! 03:47=Cola-as onde achares mais útil! -03:48=It's Hammer time! +03:48=Garantia vitalícia! ; Weapon Descriptions (use | as line breaks) 04:00=Ataca os teus inimigos usando uma simples granada.|Explodirá quando o tempo chegar a zero.|1-5: Define o temporizador da granada|Ataque: Deixa premido para lançar com mais força @@ -457,7 +458,7 @@ 04:23=Se não tens nada a perder, isto pode ser|muito útil. Sacrifica o teu ouriço lançando-o|na direcção desejada destruindo tudo o|que esteja no caminho e explodindo no fim.|Ataque: Lança um devastador e mortífero ataque 04:24=Feliz aniversário! Lança este bolo, deixa-o caminhar até|aos teus inimigos e oferece-lhes uma festa explosiva.|O bolo pode andar em quase qualquer terreno mas isso|faz com que detone mais cedo.|Ataque: Larga o bolo ou pára-o para que expluda 04:25=Usa este kit de vestuário para fazer os teus inimigos saltar|para o teu ouriço (e para alguma falha ou buraco).|Ataque: Usa este kit e tenta seduzir outro ouriço -04:26=Atira esta sumarenta melancia aos teus inimigos.|Assim que o tempo termine, dividir-se-à em vários|pedaços explosivos.|1-5: Define o temporizador da melancia|Ataque: Deixa premido para lançar com mais força +04:26=Atira esta sumarenta melancia aos teus inimigos.|Assim que o tempo termine, dividir-se-à em várias|fatias explosivas.|1-5: Define o temporizador da melancia|Ataque: Deixa premido para lançar com mais força 04:27=Deixa as chamas do inferno chover sobre os teus|oponentes usando este demoníaco explosivo.|Não fiques muito perto da explosão pois as pequenas|chamas são igualmente perigosas.|Ataque: Deixa premido para lançar com mais força 04:28=Pouco depois de lançares este rocket, ira começar a|escavar através do solo e explodir assim que o rastilho|acabe ou alcance a superfície novamente.|Ataque: Deixa premido para disparar com mais força 04:29=Não recomendada para crianças!|A arma de bolas disparamontes de pequenas|e coloridas bolas recheadas de explosivos.|Ataque: Dispara com a força máxima|Cima/Baixo: Continua a apontar @@ -469,17 +470,17 @@ 04:35=Por vezes o tempo passa demasiado depressa.|Agarra uns segundos extra para acabar o teu ataque.|Ataque: Activar 04:36=Há dias em que a tua pontaria anda simplesmente terrível.|Obtém alguma ajuda utilizando a tecnologia moderna.|Ataque: Activar 04:37=Não temas a luz do dia. Só vai durar um turno|mas vais poder absorver parte do dano que|fizeres aos outros ouriços.|Ataque: Activar -04:38=A sniper pode ser a arma mais devastadora no teu|arsenal, mas é muito pouco eficiente ao perto.|O dano aumenta proporcionalmente à distancia do alvo.|Ataque: Disparar (duas vezes) +04:38=Embora a sniper tenha a capacidade de ser tornar uma|das armas mais devastadoras do teu arsenal é|infelizmente muito pouco eficiente a curta distancia.|O dano aumenta proporcionalmente à distancia do alvo.|Ataque: Disparar (duas vezes) 04:39=Voa para outras partes do mapa usando o disco voador.|Este utilitário difícil de controlar é capaz de te levar|a quase qualquer posição no campo de batalha.|Ataque: Activar|Cima/Esquerda/Direita: Aplica força nessa direcção|Saltar: Larga granadas ou armas similares 04:40=Pôe o chão a arder com esta garrafa cheia de|liquido altamente inflamável.|Ataque: Deixa premido para atirar com mais força 04:41=Prova que a natureza está mais avançada que o que|poderiamos imaginar. Este passarito consegue transportar|o teu ouriço e largar ovos nos teus enimigos!|Attack: Activar e largar ovos|Cima/Esquerda/Direita: Bater as asas nessa direcção -04:42=Este dispositivo de portais portatil é|capaz de instantaneamente teletransportar|os teus inimigos, o teu arsenal ou a ti|entre dois pontos no terreno.|Embora dificil de usar ao inicio, com prática|pode-se tornar uma das armas mais letais do teu arsenal.|Ataque: Disparar um portal|Trocar: Alterar (alternar) o portal de cor -04:43=Faz da tua estreia musical um sucesso explosivo!|Larga este piano do céu, mas cuidado...|alguem precisa de o tocar o que pode custar a tua vida!|Cursor: Selecciona a zona alvo|F1-F9: Tocar piano -04:44=Isto não é apenas queijo, é uma arma biologica!|Pode não causar muito dano quando o tempo|chegue a zero, mas vai definitivamente envenenar qualquer|ouriço que tenha a infelicidade de o cheirar.|1-5: Define o temporizador da granada|Ataque: Deixa premido para lançar com mais força -04:45=Finalmente todas aquelas aulas de fisica vão ser úteis.|Liberta uma devastadora onda Seno nos|teus enimigos, mas cuidado,esta|arma responde com o grande coiçe.|(Esta arma está incompleta)|Ataque: Disparar +04:42=Este dispositivo de portais portatil é capaz de|instantaneamente teletransportar os teus inimigos,|o teu arsenal ou a ti entre dois pontos no terreno.|Embora dificil de usar ao inicio, com prática pode-se|tornar uma das armas mais letais do teu arsenal.|Ataque: Disparar um portal|Trocar: Alterar (alternar) o portal de cor +04:43=Faz da tua estreia musical um sucesso explosivo!|Larga este piano do céu, mas cuidado... alguem|precisa de o tocar o que te pode custar vida!|Cursor: Selecciona a zona alvo|F1-F9: Tocar piano +04:44=Isto não é apenas queijo, é uma arma biologica!|Pode não causar muito dano quando o tempo|chegue a zero, mas vai definitivamente envenenar|qualquer ouriço que tenha a infelicidade de o cheirar.|1-5: Define o temporizador da granada|Ataque: Deixa premido para lançar com mais força +04:45=Finalmente todas aquelas aulas de fisica vão ser úteis.|Liberta uma devastadora onda Seno nos teus enimigos,|mas cuidado, esta arma responde com o grande coiçe.|(Esta arma está incompleta)|Ataque: Disparar 04:46=Cobre os teus inimigos com este viscoso e|flamejante liquido de aquecer o coração!|Ataque: Activar|Cima/Baixo: Apontar|Esquerda/Direita: Modificar a pressão -04:47=Duplica a diversão com estas duas minas autocolantes!|Utiliza-as para atacar ou defender (ou ambos)! É contigo!|Ataque: Deixa pressionado para disparar mais longe -04:48=Porque é que têm as toupeiras de ser|sempre as vitimas? Dar marteladas em ouriços pode ser igualmente|divertido! Uma boa martelada rapidamente|limpa um terço da vida de um ouriço e enterra-o no solo!|Ataque: Activar +04:47=Duplica a diversão com estas duas minas autocolantes!|Utiliza-as para atacar ou defender. É contigo!|Ataque: Deixa pressionado para disparar mais longe +04:48=Porque é que têm as toupeiras de ser sempre as vitimas?|Dar marteladas em ouriços pode ser igualmente divertido!|Uma boa martelada rapidamente remove um terço da vida|de um ouriço e ainda o enterra no solo!|Ataque: Activar ; Game goal strings 05:00=Modos de Jogo