# HG changeset patch # User Medo # Date 1340813057 -7200 # Node ID d1db8aaa8edca727342337083268bb7877a922be # Parent 15f722e0b96fdb0d510c9368c24e708942b541c0# Parent 7f8d62b869bdbf36e3a6a8b854821245d81615ba Merge diff -r 15f722e0b96f -r d1db8aaa8edc QTfrontend/drawmapscene.cpp --- a/QTfrontend/drawmapscene.cpp Wed Jun 27 18:02:45 2012 +0200 +++ b/QTfrontend/drawmapscene.cpp Wed Jun 27 18:04:17 2012 +0200 @@ -224,8 +224,11 @@ qint16 px = qToBigEndian((qint16)point.x()); qint16 py = qToBigEndian((qint16)point.y()); quint8 flags = 0; - if(!cnt) flags = 0x80 + params.width; - if(params.erasing) flags |= 0x40; + if(!cnt) + { + flags = 0x80 + params.width; + if(params.erasing) flags |= 0x40; + } b.append((const char *)&px, 2); b.append((const char *)&py, 2); b.append((const char *)&flags, 1); diff -r 15f722e0b96f -r d1db8aaa8edc QTfrontend/ui/widget/about.cpp --- a/QTfrontend/ui/widget/about.cpp Wed Jun 27 18:02:45 2012 +0200 +++ b/QTfrontend/ui/widget/about.cpp Wed Jun 27 18:04:17 2012 +0200 @@ -128,7 +128,7 @@ "Greek: <talos_kriti@yahoo.gr>
" "Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani
" "Japanese: ADAM Etienne <etienne.adam@gmail.com>
" - "Korean: Anthony Bellew <webmaster@anthonybellew.com>
" + "Korean: Anthony Bellew <anthonyreflected@gmail.com>
" "Lithuanian: Lukas Urbonas <lukasu08@gmail.com>
" "Polish: Maciej Mroziński <mynick2@o2.pl>, Wojciech Latkowski <magik17l@gmail.com>, Piotr Mitana, Maciej Górny
" "Portuguese: Fábio Canário <inufabie@gmail.com>
" diff -r 15f722e0b96f -r d1db8aaa8edc gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Wed Jun 27 18:02:45 2012 +0200 +++ b/gameServer/HWProtoInRoomState.hs Wed Jun 27 18:04:17 2012 +0200 @@ -158,8 +158,8 @@ cl <- thisClient chans <- roomClientsChans return [ + ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}), ModifyClient (\c -> c{isReady = not $ isReady cl}), - ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}), AnswerClients chans $ if clientProto cl < 38 then [if isReady cl then "NOT_READY" else "READY", nick cl] else diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/GSHandlers.inc Wed Jun 27 18:04:17 2012 +0200 @@ -2114,19 +2114,37 @@ end else begin - if Gear^.Timer = 0 then - begin + if Gear^.Timer = 500 then + begin (* Can't make sparkles team coloured without working out what the next team is going to be. This should be solved, really, since it also screws up voices. Reinforcements voices is heard for active team, not team-to-be. Either that or change crate spawn from end of turn to start, although that has its own complexities. *) - sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); - if sparkles <> nil then + // Abuse a couple of gear values to track origin + Gear^.Angle:= hwRound(Gear^.X); + Gear^.Power:= hwRound(Gear^.Y); + Gear^.Tag:= random(2); + inc(Gear^.Timer) + end; + if Gear^.Timer < 1833 then inc(Gear^.Timer); + if Gear^.Timer = 1000 then begin - sparkles^.Tint:= $FAB22CFF + sparkles:= AddVisualGear(Gear^.Angle, Gear^.Power, vgtDust, 1); + if sparkles <> nil then + begin + sparkles^.dX:= 0; + sparkles^.dY:= 0; + sparkles^.Angle:= 270; + if Gear^.Tag = 1 then + sparkles^.Tint:= $3744D7FF + else sparkles^.Tint:= $FAB22CFF + end; + end; + if Gear^.Timer < 1000 then + begin + AllInactive:= false; + exit end end; - if (GameTicks and $1 = 0) and (Gear^.Timer < 255) then inc(Gear^.Timer) - end; if (Gear^.Damage > 0) or exBoom then begin @@ -2768,7 +2786,7 @@ CurrentTeam^.CurrHedgehog := Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber); until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0); - CurrentHedgehog := @CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]; + SwitchCurrentHedgehog(@CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]); AmmoMenuInvalidated:= true; HHGear := CurrentHedgehog^.Gear; @@ -3087,7 +3105,7 @@ begin Gear^.Tag := 0; Gear^.X := Gear^.X + int2hwFloat(xx); - if not TestCollisionY(Gear, yyn) then + if TestCollisionYwithGear(Gear, yyn) = 0 then begin Gear^.Y := Gear^.Y + int2hwFloat(yyn); NextAngle(Gear, dA) @@ -3165,8 +3183,7 @@ HHGear := Gear^.Hedgehog^.Gear; HHGear^.Message := HHGear^.Message and (not gmAttack); - DeleteCI(HHGear); - Gear^.IntersectGear:= nil; + Gear^.CollisionMask:= $FF7F; FollowGear := Gear; @@ -3420,7 +3437,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepBallgunWork(Gear: PGear); var - HHGear: PGear; + HHGear, ball: PGear; rx, ry: hwFloat; gX, gY: LongInt; begin @@ -3435,7 +3452,8 @@ rx := rndSign(getRandomf * _0_1); ry := rndSign(getRandomf * _0_1); - AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0); + ball:= AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0); + ball^.CollisionMask:= $FF7F; PlaySound(sndGun); end; @@ -4026,12 +4044,12 @@ gear^.RenderTimer := true; // abort if there is no other portal connected to this one - if (Gear^.IntersectGear = nil) then + if (Gear^.LinkedGear = nil) then exit; - if ((Gear^.IntersectGear^.Tag and 1) = 0) then // or if it's still moving; + if ((Gear^.LinkedGear^.Tag and 1) = 0) then // or if it's still moving; exit; - conPortal := Gear^.IntersectGear; + conPortal := Gear^.LinkedGear; // check all gears for stuff to port through iterator := nil; @@ -4398,7 +4416,8 @@ Gear^.State := Gear^.State or gstCollision; Gear^.State := Gear^.State and (not gstMoving); - if not CalcSlopeTangent(Gear, x, y, tx, ty, 255) + if (Land[y, x] and lfBouncy <> 0) + or not CalcSlopeTangent(Gear, x, y, tx, ty, 255) or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain begin loadNewPortalBall(Gear, true); @@ -4414,8 +4433,8 @@ if not Gear^.dX.isNegative then Gear^.DirAngle := 180-Gear^.DirAngle; - if ((Gear^.IntersectGear = nil) - or (hwRound(Distance(Gear^.X - Gear^.IntersectGear^.X,Gear^.Y-Gear^.IntersectGear^.Y)) >=Gear^.Radius*2)) then + if ((Gear^.LinkedGear = nil) + or (hwRound(Distance(Gear^.X - Gear^.LinkedGear^.X,Gear^.Y-Gear^.LinkedGear^.Y)) >=Gear^.Radius*2)) then begin loadNewPortalBall(Gear, false); inc(Gear^.Tag); @@ -4457,7 +4476,7 @@ newPortal^.dX := newPortal^.dX * s; newPortal^.dY := newPortal^.dY * s; - newPortal^.IntersectGear := nil; + newPortal^.LinkedGear := nil; if CurrentHedgehog <> nil then with CurrentHedgehog^ do @@ -4486,8 +4505,8 @@ else begin // link portals with each other - newPortal^.IntersectGear := iterator; - iterator^.IntersectGear := newPortal; + newPortal^.LinkedGear := iterator; + iterator^.LinkedGear := newPortal; iterator^.Health := newPortal^.Health; end; end; @@ -4740,7 +4759,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepFlamethrowerWork(Gear: PGear); var - HHGear: PGear; + HHGear, flame: PGear; rx, ry, speed: hwFloat; i, gX, gY: LongInt; begin @@ -4778,14 +4797,18 @@ ry := rndSign(getRandomf * _0_1); speed := _0_5 * (_10 / Gear^.Tag); - AddGear(gx, gy, gtFlame, gstTmpFlag, + flame:= AddGear(gx, gy, gtFlame, gstTmpFlag, SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - speed) + ry, 0); + flame^.CollisionMask:= $FF7F; if (Gear^.Health mod 30) = 0 then - AddGear(gx, gy, gtFlame, 0, + begin + flame:= AddGear(gx, gy, gtFlame, 0, SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - speed) + ry, 0); + flame^.CollisionMask:= $FF7F; + end end; Gear^.Timer:= Gear^.Tag end; @@ -4821,7 +4844,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepLandGunWork(Gear: PGear); var - HHGear: PGear; + HHGear, land: PGear; rx, ry, speed: hwFloat; i, gX, gY: LongInt; begin @@ -4858,9 +4881,10 @@ ry := rndSign(getRandomf * _0_1); speed := (_3 / Gear^.Tag); - AddGear(gx, gy, gtFlake, gstTmpFlag, + land:= AddGear(gx, gy, gtFlake, gstTmpFlag, SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - speed) + ry, 0); + land^.CollisionMask:= $FF7F; Gear^.Timer:= Gear^.Tag end; @@ -4940,7 +4964,7 @@ ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown); //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3); tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0); - tmp2^.IntersectGear:= tmp; + tmp2^.LinkedGear:= tmp; SetAllToActive end else @@ -4959,7 +4983,7 @@ HitGear: PGear; begin AllInactive := false; - HitGear := Gear^.IntersectGear; + HitGear := Gear^.LinkedGear; dec(Gear^.Timer); if (HitGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gmDestroy) <> 0) then begin @@ -5354,7 +5378,7 @@ end; Gear^.Pos:= 4; // This condition might need tweaking - Gear^.Timer:= GetRandom(cHedgehogTurnTime*TeamsCount)+cHedgehogTurnTime + Gear^.Timer:= GetRandom(cHedgehogTurnTime*TeamsCount*2)+cHedgehogTurnTime*2 end; if (Gear^.Pos = 4) then diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uAIAmmoTests.pas Wed Jun 27 18:04:17 2012 +0200 @@ -161,7 +161,8 @@ dX:= dX + windSpeed; dY:= dY + cGravityf; dec(t) - until TestCollExcludingMe(Me, trunc(x), trunc(y), 5) or (t <= 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t <= 0); EX:= trunc(x); EY:= trunc(y); @@ -219,7 +220,8 @@ dX:= dX + windSpeed; dY:= dY + cGravityf; dec(t) - until TestCollExcludingMe(Me, trunc(x), trunc(y), 5) or (t <= 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t <= 0); EX:= trunc(x); EY:= trunc(y); @@ -269,7 +271,8 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until TestCollExcludingMe(Me, trunc(x), trunc(y), 7) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 6))) or (t = 0); EX:= trunc(x); EY:= trunc(y); if t < 50 then @@ -321,7 +324,8 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until TestCollExcludingMe(Me, trunc(x), trunc(y), 5) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t = 0); EX:= trunc(x); EY:= trunc(y); if t < 50 then @@ -380,7 +384,8 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until TestCollExcludingMe(Me, trunc(x), trunc(y), 5) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t = 0); EX:= trunc(x); EY:= trunc(y); if t < 50 then @@ -432,7 +437,8 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until TestCollExcludingMe(Me, trunc(x), trunc(y), 7) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 6))) or (t = 0); EX:= trunc(x); EY:= trunc(y); @@ -511,7 +517,8 @@ dY:= dY + cGravityf; EX:= trunc(x); EY:= trunc(y); - until TestCollExcludingMe(Me, EX, EY, 5) or (EY > cWaterLine); + until (((Me = CurrentHedgehog^.Gear) and TestColl(EX, EY, 4)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, EX, EY, 4))) or (EY > cWaterLine); if (EY < cWaterLine) and (dY >= 0) then begin @@ -564,7 +571,8 @@ y:= y + vY; rx:= trunc(x); ry:= trunc(y); - if TestCollExcludingMe(Me, rx, ry, 2) then + if ((Me = CurrentHedgehog^.Gear) and TestColl(rx, ry, 2)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, rx, ry, 2)) then begin x:= x + vX * 8; y:= y + vY * 8; diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uAIMisc.pas --- a/hedgewars/uAIMisc.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uAIMisc.pas Wed Jun 27 18:04:17 2012 +0200 @@ -262,19 +262,19 @@ function TestColl(x, y, r: LongInt): boolean; inline; var b: boolean; begin - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] <> 0); + b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and $FF7F <> 0); if b then exit(true); - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] <> 0); + b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and $FF7F <> 0); if b then exit(true); - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] <> 0); + b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and $FF7F <> 0); if b then exit(true); - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] <> 0); + b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and $FF7F <> 0); if b then exit(true); @@ -534,17 +534,17 @@ for i:= 0 to Pred(Targets.Count) do with Targets.ar[i] do - begin // hammer hit radius is 8, shift is 10 if abs(Point.x - x) + abs(Point.y - y) < 18 then + begin r:= trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))); - if r <= 18 then - if Score > 0 then - inc(rate, Score div 3) - else - inc(rate, Score div 3 * friendlyfactor div 100) - end; + if r <= 18 then + if Score > 0 then + inc(rate, Score div 3) + else + inc(rate, Score div 3 * friendlyfactor div 100) + end; RateHammer:= rate * 1024; end; diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uCollisions.pas Wed Jun 27 18:04:17 2012 +0200 @@ -82,7 +82,7 @@ X:= hwRound(Gear^.X); Y:= hwRound(Gear^.Y); Radius:= Gear^.Radius; - ChangeRoundInLand(X, Y, Radius - 1, true); + ChangeRoundInLand(X, Y, Radius - 1, true, Gear = CurrentHedgehog^.Gear); cGear:= Gear end; Gear^.CollisionIndex:= Count; @@ -103,7 +103,7 @@ if Gear^.CollisionIndex >= 0 then begin with cinfos[Gear^.CollisionIndex] do - ChangeRoundInLand(X, Y, Radius - 1, false); + ChangeRoundInLand(X, Y, Radius - 1, false, Gear = CurrentHedgehog^.Gear); cinfos[Gear^.CollisionIndex]:= cinfos[Pred(Count)]; cinfos[Gear^.CollisionIndex].cGear^.CollisionIndex:= Gear^.CollisionIndex; Gear^.CollisionIndex:= -1; @@ -136,19 +136,12 @@ function TestCollisionXwithGear(Gear: PGear; Dir: LongInt): boolean; var x, y, i: LongInt; - TestWord: LongWord; begin -if Gear^.IntersectGear <> nil then - with Gear^ do - if (hwRound(IntersectGear^.X) + IntersectGear^.Radius < hwRound(X) - Radius) - or (hwRound(IntersectGear^.X) - IntersectGear^.Radius > hwRound(X) + Radius) then - begin - IntersectGear:= nil; - TestWord:= 0 - end - else - TestWord:= 255 - else TestWord:= 0; +// Special case to emulate the old intersect gear clearing, but with a bit of slop for pixel overlap +if (Gear^.CollisionMask = $FF7F) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and + ((hwRound(Gear^.Hedgehog^.Gear^.X) + Gear^.Hedgehog^.Gear^.Radius + 4 < hwRound(Gear^.X) - Gear^.Radius) or + (hwRound(Gear^.Hedgehog^.Gear^.X) - Gear^.Hedgehog^.Gear^.Radius - 4 > hwRound(Gear^.X) + Gear^.Radius)) then + Gear^.CollisionMask:= $FFFF; x:= hwRound(Gear^.X); if Dir < 0 then @@ -163,7 +156,7 @@ i:= y + Gear^.Radius * 2 - 2; repeat if (y and LAND_HEIGHT_MASK) = 0 then - if Land[y, x] > TestWord then + if Land[y, x] and Gear^.CollisionMask <> 0 then exit; inc(y) until (y > i); @@ -173,38 +166,31 @@ function TestCollisionYwithGear(Gear: PGear; Dir: LongInt): Word; var x, y, i: LongInt; - TestWord: LongWord; begin -if Gear^.IntersectGear <> nil then - with Gear^ do - if (hwRound(IntersectGear^.Y) + IntersectGear^.Radius < hwRound(Y) - Radius) or - (hwRound(IntersectGear^.Y) - IntersectGear^.Radius > hwRound(Y) + Radius) then - begin - IntersectGear:= nil; - TestWord:= 0 - end - else - TestWord:= 255 -else - TestWord:= 0; +// Special case to emulate the old intersect gear clearing, but with a bit of slop for pixel overlap +if (Gear^.CollisionMask = $FF7F) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and + ((hwRound(Gear^.Hedgehog^.Gear^.Y) + Gear^.Hedgehog^.Gear^.Radius + 4 < hwRound(Gear^.Y) - Gear^.Radius) or + (hwRound(Gear^.Hedgehog^.Gear^.Y) - Gear^.Hedgehog^.Gear^.Radius - 4 > hwRound(Gear^.Y) + Gear^.Radius)) then + Gear^.CollisionMask:= $FFFF; y:= hwRound(Gear^.Y); if Dir < 0 then y:= y - Gear^.Radius else y:= y + Gear^.Radius; + if (y and LAND_HEIGHT_MASK) = 0 then begin x:= hwRound(Gear^.X) - Gear^.Radius + 1; i:= x + Gear^.Radius * 2 - 2; repeat if (x and LAND_WIDTH_MASK) = 0 then - if Land[y, x] > TestWord then - begin + if Land[y, x] and Gear^.CollisionMask <> 0 then + begin TestCollisionYwithGear:= Land[y, x]; exit; - end; - inc(x) + end; + inc(x) until (x > i); end; TestCollisionYwithGear:= 0 diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uConsts.pas Wed Jun 27 18:04:17 2012 +0200 @@ -94,6 +94,7 @@ lfObject = $2000; lfDamaged = $1000; // lfIce = $0800; // blue + lfBouncy = $0400; // green cMaxPower = 1500; cMaxAngle = 2048; diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uGearsHedgehog.pas Wed Jun 27 18:04:17 2012 +0200 @@ -395,6 +395,7 @@ newGear^.Target.X:= TargetPoint.X; newGear^.Target.Y:= TargetPoint.Y end; + if newGear <> nil then newGear^.CollisionMask:= $FF7F; // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement if altUse then diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uGearsList.pas Wed Jun 27 18:04:17 2012 +0200 @@ -100,15 +100,14 @@ gear^.Density:= _1; // Define ammo association, if any. gear^.AmmoType:= GearKindAmmoTypeMap[Kind]; +gear^.CollisionMask:= $FFFF; + +if CurrentHedgehog <> nil then gear^.Hedgehog:= CurrentHedgehog; + if Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then gear^.Z:= cHHZ+1 else gear^.Z:= cUsualZ; -if CurrentHedgehog <> nil then - begin - gear^.Hedgehog:= CurrentHedgehog; - gear^.IntersectGear:= CurrentHedgehog^.Gear - end; case Kind of gtGrenade, @@ -247,7 +246,7 @@ gear^.nImpactSounds:= 1; gear^.Radius:= 16; gear^.Elasticity:= _0_3; - gear^.Timer:= 0 + gear^.Timer:= 500 end; gtExplosives: begin gear^.ImpactSound:= sndGrenadeImpact; @@ -483,9 +482,9 @@ // make sure that portals have their link removed before deletion if (Gear^.Kind = gtPortal) then begin - if (Gear^.IntersectGear <> nil) then - if (Gear^.IntersectGear^.IntersectGear = Gear) then - Gear^.IntersectGear^.IntersectGear:= nil; + if (Gear^.LinkedGear <> nil) then + if (Gear^.LinkedGear^.LinkedGear = Gear) then + Gear^.LinkedGear^.LinkedGear:= nil; end else if Gear^.Kind = gtHedgehog then (* diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uGearsRender.pas Wed Jun 27 18:04:17 2012 +0200 @@ -948,8 +948,8 @@ gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? - or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? - or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? + or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked? + or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving? DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); @@ -990,30 +990,36 @@ else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); gtCase: begin - if Gear^.Timer < 255 then Tint($FF, $FF, $FF, Gear^.Timer); - if ((Gear^.Pos and posCaseAmmo) <> 0) then - begin - i:= (GameTicks shr 6) mod 64; - if i > 18 then - i:= 0; - DrawSprite(sprCase, x - 24, y - 24, i); - end - else if ((Gear^.Pos and posCaseHealth) <> 0) then + if Gear^.Timer > 1000 then begin - i:= ((GameTicks shr 6) + 38) mod 64; - if i > 13 then - i:= 0; - DrawSprite(sprFAid, x - 24, y - 24, i); - end - else if ((Gear^.Pos and posCaseUtility) <> 0) then + if ((Gear^.Pos and posCaseAmmo) <> 0) then + begin + i:= (GameTicks shr 6) mod 64; + if i > 18 then + i:= 0; + DrawSprite(sprCase, x - 24, y - 24, i); + end + else if ((Gear^.Pos and posCaseHealth) <> 0) then + begin + i:= ((GameTicks shr 6) + 38) mod 64; + if i > 13 then + i:= 0; + DrawSprite(sprFAid, x - 24, y - 24, i); + end + else if ((Gear^.Pos and posCaseUtility) <> 0) then + begin + i:= (GameTicks shr 6) mod 70; + if i > 23 then + i:= 0; + i:= i mod 12; + DrawSprite(sprUtility, x - 24, y - 24, i); + end; + end; + if Gear^.Timer <= 1833 then begin - i:= (GameTicks shr 6) mod 70; - if i > 23 then - i:= 0; - i:= i mod 12; - DrawSprite(sprUtility, x - 24, y - 24, i); - end; - if Gear^.Timer < 255 then Tint($FF, $FF, $FF, $FF); + DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0, + Gear^.Angle+WorldDx, Gear^.Power+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270); + end end; gtExplosives: begin if ((Gear^.State and gstDrowning) <> 0) then diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uGearsUtils.pas Wed Jun 27 18:04:17 2012 +0200 @@ -107,7 +107,7 @@ tdX:= Gear^.X-fX; tdY:= Gear^.Y-fY; if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then - dmg:= dmgBase - max(hwRound(Distance(tdX, tdY)),Gear^.Radius); + dmg:= dmgBase - hwRound(Distance(tdX, tdY)); if dmg > 1 then begin dmg:= ModifyDamage(min(dmg div 2, Radius), Gear); diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uLand.pas --- a/hedgewars/uLand.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uLand.pas Wed Jun 27 18:04:17 2012 +0200 @@ -434,19 +434,22 @@ begin for x:= 0 to Pred(tmpsurf^.w) do begin - if ((AMask and p^[x]) = 0) then + // this an if instead of masking colours to avoid confusing map creators + if ((AMask and p^[x]) = 0) then Land[cpY + y, cpX + x]:= 0 - else if p^[x] = $FFFFFFFF then + else if p^[x] = $FFFFFFFF then // white Land[cpY + y, cpX + x]:= lfObject - else if p^[x] = (AMask or RMask) then - Land[cpY + y, cpX + x]:= lfIndestructible - else if p^[x] = AMask then + else if p^[x] = AMask then // black begin Land[cpY + y, cpX + x]:= lfBasic; disableLandBack:= false end - else if p^[x] = (AMask or BMask) then + else if p^[x] = (AMask or RMask) then // red + Land[cpY + y, cpX + x]:= lfIndestructible + else if p^[x] = (AMask or BMask) then // blue Land[cpY + y, cpX + x]:= lfObject or lfIce + else if p^[x] = (AMask or GMask) then // green + Land[cpY + y, cpX + x]:= lfObject or lfBouncy end; p:= @(p^[tmpsurf^.pitch div 4]); end; diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uLandGraphics.pas Wed Jun 27 18:04:17 2012 +0200 @@ -36,10 +36,11 @@ procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt); procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); -procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean); +procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); function LandBackPixel(x, y: LongInt): LongWord; procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword); procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword); +procedure DumpLandToLog(x, y, r: LongInt); function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean; @@ -98,46 +99,62 @@ Land[y - dx, i]:= Value; end; -procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet: boolean); +procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean); var i: LongInt; begin if not doSet then begin if ((y + dy) and LAND_HEIGHT_MASK) = 0 then for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if (Land[y + dy, i] > 0) and (Land[y + dy, i] < 256) then - dec(Land[y + dy, i]); // check > 0 because explosion can erase collision data + if isCurrent then + Land[y + dy, i]:= Land[y + dy, i] and $FF7F + else if Land[y + dy, i] and $007F > 0 then + Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) - 1); if ((y - dy) and LAND_HEIGHT_MASK) = 0 then for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if (Land[y - dy, i] > 0) and (Land[y - dy, i] < 256) then - dec(Land[y - dy, i]); + if isCurrent then + Land[y - dy, i]:= Land[y - dy, i] and $FF7F + else if Land[y - dy, i] and $007F > 0 then + Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) - 1); if ((y + dx) and LAND_HEIGHT_MASK) = 0 then for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if (Land[y + dx, i] > 0) and (Land[y + dx, i] < 256) then - dec(Land[y + dx, i]); + if isCurrent then + Land[y + dx, i]:= Land[y + dx, i] and $FF7F + else if Land[y + dx, i] and $007F > 0 then + Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) - 1); if ((y - dx) and LAND_HEIGHT_MASK) = 0 then for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if (Land[y - dx, i] > 0) and (Land[y - dx, i] < 256) then - dec(Land[y - dx, i]); + if isCurrent then + Land[y - dx, i]:= Land[y - dx, i] and $FF7F + else if Land[y - dx, i] and $007F > 0 then + Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) - 1) end else begin if ((y + dy) and LAND_HEIGHT_MASK) = 0 then for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if (Land[y + dy, i] < 256) then - inc(Land[y + dy, i]); - if ((y - dy) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if (Land[y - dy, i] < 256) then - inc(Land[y - dy, i]); - if ((y + dx) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if (Land[y + dx, i] < 256) then - inc(Land[y + dx, i]); - if ((y - dx) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if (Land[y - dx, i] < 256) then - inc(Land[y - dx, i]); + if isCurrent then + Land[y + dy, i]:= Land[y + dy, i] or $80 + else if Land[y + dy, i] and $007F < 127 then + Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) + 1); + if ((y - dy) and LAND_HEIGHT_MASK) = 0 then + for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do + if isCurrent then + Land[y - dy, i]:= Land[y - dy, i] or $80 + else if Land[y - dy, i] and $007F < 127 then + Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) + 1); + if ((y + dx) and LAND_HEIGHT_MASK) = 0 then + for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do + if isCurrent then + Land[y + dx, i]:= Land[y + dx, i] or $80 + else if Land[y + dx, i] and $007F < 127 then + Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) + 1); + if ((y - dx) and LAND_HEIGHT_MASK) = 0 then + for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do + if isCurrent then + Land[y - dx, i]:= Land[y - dx, i] or $80 + else if Land[y - dx, i] and $007F < 127 then + Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) + 1) end end; @@ -163,7 +180,7 @@ FillCircleLines(x, y, dx, dy, Value); end; -procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean); +procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); var dx, dy, d: LongInt; begin dx:= 0; @@ -171,7 +188,7 @@ d:= 3 - 2 * Radius; while (dx < dy) do begin - ChangeCircleLines(x, y, dx, dy, doSet); + ChangeCircleLines(x, y, dx, dy, doSet, isCurrent); if (d < 0) then d:= d + 4 * dx + 6 else @@ -182,7 +199,7 @@ inc(dx) end; if (dx = dy) then - ChangeCircleLines(x, y, dx, dy, doSet) + ChangeCircleLines(x, y, dx, dy, doSet, isCurrent) end; procedure FillLandCircleLines0(x, y, dx, dy: LongInt); @@ -1157,4 +1174,28 @@ DrawLines(x1, y1, x2, y2, dx, dy, color); end; + +procedure DumpLandToLog(x, y, r: LongInt); +var xx, yy, dx: LongInt; + s: shortstring; +begin + s[0]:= char(r * 2 + 1); + for yy:= y - r to y + r do + begin + for dx:= 0 to r*2 do + begin + xx:= dx - r + x; + if (xx = x) and (yy = y) then + s[dx + 1]:= 'X' + else if Land[yy, xx] > 255 then + s[dx + 1]:= 'O' + else if Land[yy, xx] > 0 then + s[dx + 1]:= '*' + else + s[dx + 1]:= '.' + end; + AddFileLog('Land dump: ' + s); + end; +end; + end. diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uLandPainted.pas --- a/hedgewars/uLandPainted.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uLandPainted.pas Wed Jun 27 18:04:17 2012 +0200 @@ -27,7 +27,7 @@ procedure freeModule; implementation -uses uLandGraphics, uConsts, uUtils, SDLh, uCommands, uDebug; +uses uLandGraphics, uConsts, uVariables, uUtils, SDLh, uCommands, uDebug; type PointRec = packed record X, Y: SmallInt; @@ -57,6 +57,10 @@ rec:= prec^; rec.X:= SDLNet_Read16(@rec.X); rec.Y:= SDLNet_Read16(@rec.Y); + if rec.X < -318 then rec.X:= -318; + if rec.X > LAND_WIDTH+318 then rec.X:= LAND_WIDTH+318; + if rec.Y < -318 then rec.Y:= -318; + if rec.Y > LAND_HEIGHT+318 then rec.Y:= LAND_HEIGHT+318; new(pe); if pointsListLast = nil then diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uScript.pas --- a/hedgewars/uScript.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uScript.pas Wed Jun 27 18:04:17 2012 +0200 @@ -184,10 +184,19 @@ end; function lc_parsecommand(L : Plua_State) : LongInt; Cdecl; +var t: PChar; + i,c: LongWord; + s: shortstring; begin if lua_gettop(L) = 1 then begin - ParseCommand(lua_tostring(L ,1), true); + t:= lua_tolstring(L,1,@c); + + for i:= 1 to c do s[i]:= t[i-1]; + s[0]:= char(c); + + ParseCommand(s, true); + end else LuaError('Lua: Wrong number of parameters passed to ParseCommand!'); @@ -973,10 +982,9 @@ prevgear^.Z := cHHZ; RemoveGearFromList(prevgear); InsertGearToList(prevgear); - - CurrentHedgehog := gear^.Hedgehog; -// yes, this will muck up turn sequence - CurrentTeam := gear^.Hedgehog^.Team; + + SwitchCurrentHedgehog(gear^.Hedgehog); + CurrentTeam:= CurrentHedgehog^.Team; gear^.State:= gear^.State or gstHHDriven; gear^.Active := true; diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uTeams.pas Wed Jun 27 18:04:17 2012 +0200 @@ -35,6 +35,7 @@ procedure RestoreTeamsFromSave; function CheckForWin: boolean; procedure TeamGoneEffect(var Team: TTeam); +procedure SwitchCurrentHedgehog(newHog: PHedgehog); implementation uses uLocale, uAmmos, uChat, uVariables, uUtils, uIO, uCaptions, uCommands, uDebug, uScript, @@ -184,7 +185,7 @@ end until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil); -CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]); +SwitchCurrentHedgehog(@(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog])); {$IFDEF USE_TOUCH_INTERFACE} if (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0 then begin @@ -488,7 +489,7 @@ with CurrentTeam^ do begin SplitBySpace(id, s); - CurrentHedgehog:= @Hedgehogs[HedgehogsNumber]; + SwitchCurrentHedgehog(@Hedgehogs[HedgehogsNumber]); val(id, CurrentHedgehog^.BotLevel, c); Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0); SplitBySpace(s, id); @@ -618,6 +619,21 @@ RecountAllTeamsHealth(); end; +procedure SwitchCurrentHedgehog(newHog: PHedgehog); +var oldCI, newCI: boolean; + oldHH: PHedgehog; +begin + oldCI:= (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.CollisionIndex >= 0); + newCI:= (newHog^.Gear <> nil) and (newHog^.Gear^.CollisionIndex >= 0); + if oldCI then DeleteCI(CurrentHedgehog^.Gear); + if newCI then DeleteCI(newHog^.Gear); + oldHH:= CurrentHedgehog; + CurrentHedgehog:= newHog; + if oldCI then AddGearCI(oldHH^.Gear); + if newCI then AddGearCI(newHog^.Gear) +end; + + procedure initModule; begin RegisterVariable('addhh', @chAddHH, false); diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uTypes.pas Wed Jun 27 18:04:17 2012 +0200 @@ -249,7 +249,8 @@ Tag: LongInt; Tex: PTexture; Z: Longword; - IntersectGear: PGear; + CollisionMask: Word; + LinkedGear: PGear; FlightTime: Longword; uid: Longword; ImpactSound: TSound; // first sound, others have to be after it in the sounds def. diff -r 15f722e0b96f -r d1db8aaa8edc hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Wed Jun 27 18:02:45 2012 +0200 +++ b/hedgewars/uVisualGears.pas Wed Jun 27 18:04:17 2012 +0200 @@ -642,7 +642,7 @@ vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 1, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height); vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); vgtDust: if Gear^.State = 1 then - DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame) + DrawSpriteRotatedF(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, 1, Gear^.Angle) else DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); vgtFire: if (Gear^.State and gstTmpFlag) = 0 then diff -r 15f722e0b96f -r d1db8aaa8edc project_files/HedgewarsMobile/Classes/HWUtils.m --- a/project_files/HedgewarsMobile/Classes/HWUtils.m Wed Jun 27 18:02:45 2012 +0200 +++ b/project_files/HedgewarsMobile/Classes/HWUtils.m Wed Jun 27 18:04:17 2012 +0200 @@ -22,7 +22,6 @@ #import #import #import -#import "SDL_uikitwindow.h" static NSString *cachedModel = nil; diff -r 15f722e0b96f -r d1db8aaa8edc project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h --- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h Wed Jun 27 18:02:45 2012 +0200 +++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h Wed Jun 27 18:04:17 2012 +0200 @@ -18,7 +18,7 @@ #import -#import "SDL_uikitappdelegate.h" +#import "../src/video/uikit/SDL_uikitappdelegate.h" @class MainMenuViewController; diff -r 15f722e0b96f -r d1db8aaa8edc project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Wed Jun 27 18:02:45 2012 +0200 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Wed Jun 27 18:04:17 2012 +0200 @@ -78,6 +78,7 @@ 615E76BE14E4421200FBA131 /* MGSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 615E76BB14E4421200FBA131 /* MGSplitViewController.m */; }; 615FEAE212A2A6640098EE92 /* localplayButton~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 615FEADF12A2A6640098EE92 /* localplayButton~ipad.png */; }; 615FEAE312A2A6640098EE92 /* localplayButton~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 615FEAE012A2A6640098EE92 /* localplayButton~iphone.png */; }; + 616065A8159A71FD00CFAEF4 /* hwclassic.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 616065A7159A71FD00CFAEF4 /* hwclassic.mp3 */; }; 616245D114E6160200CC97FB /* libFreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6162456714E6159C00CC97FB /* libFreetype.a */; }; 6163EE7E11CC2600001C0453 /* SingleWeaponViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */; }; 6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E111CA9BA200D6E256 /* FlagsViewController.m */; }; @@ -182,7 +183,7 @@ 619C5AF4124F7E3100D041AE /* LuaPas.pas in Sources */ = {isa = PBXBuildFile; fileRef = 619C5AF3124F7E3100D041AE /* LuaPas.pas */; }; 619C5BA2124FA59000D041AE /* MapPreviewButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */; }; 61A1188511683A8C00359010 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A117FE1168322700359010 /* CoreGraphics.framework */; settings = {ATTRIBUTES = (Required, ); }; }; - 61A19AFC14D20170004B1E6D /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19AEA14D2010A004B1E6D /* libSDL.a */; }; + 61A19AFC14D20170004B1E6D /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19AEA14D2010A004B1E6D /* libSDL2.a */; }; 61A19B7714D20B7A004B1E6D /* libSDL_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19B6614D20B6C004B1E6D /* libSDL_image.a */; }; 61A19BC714D20CE7004B1E6D /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19BC614D20CDA004B1E6D /* libSDL_ttf.a */; }; 61A19BFA14D20D95004B1E6D /* libSDL_net.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A19BF914D20D83004B1E6D /* libSDL_net.a */; }; @@ -402,6 +403,7 @@ 615FEADE12A2A6640098EE92 /* localplayButton@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "localplayButton@2x~iphone.png"; path = "Resources/Frontend/localplayButton@2x~iphone.png"; sourceTree = ""; }; 615FEADF12A2A6640098EE92 /* localplayButton~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "localplayButton~ipad.png"; path = "Resources/Frontend/localplayButton~ipad.png"; sourceTree = ""; }; 615FEAE012A2A6640098EE92 /* localplayButton~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "localplayButton~iphone.png"; path = "Resources/Frontend/localplayButton~iphone.png"; sourceTree = ""; }; + 616065A7159A71FD00CFAEF4 /* hwclassic.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = hwclassic.mp3; path = Resources/hwclassic.mp3; sourceTree = ""; }; 6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWeaponViewController.h; sourceTree = ""; }; 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingleWeaponViewController.m; sourceTree = ""; }; 61641FE31437CDAA006E049C /* DefinesAndMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefinesAndMacros.h; path = Classes/DefinesAndMacros.h; sourceTree = ""; }; @@ -641,7 +643,7 @@ 616245D114E6160200CC97FB /* libFreetype.a in Frameworks */, 619599451364C83D00B429B6 /* libLua.a in Frameworks */, 6195981F1364BCEF00B429B6 /* libTremor.a in Frameworks */, - 61A19AFC14D20170004B1E6D /* libSDL.a in Frameworks */, + 61A19AFC14D20170004B1E6D /* libSDL2.a in Frameworks */, 61A19B7714D20B7A004B1E6D /* libSDL_image.a in Frameworks */, 61A19C2414D20F5A004B1E6D /* libSDL_mixer.a in Frameworks */, 61A19BFA14D20D95004B1E6D /* libSDL_net.a in Frameworks */, @@ -808,6 +810,7 @@ 612CABCA1391D3D1005E9596 /* Sounds */ = { isa = PBXGroup; children = ( + 616065A7159A71FD00CFAEF4 /* hwclassic.mp3 */, 611EE973122A9C4100DF6938 /* clickSound.caf */, 611EE9D7122AA10A00DF6938 /* backSound.caf */, 611EE9D8122AA10A00DF6938 /* selSound.caf */, @@ -967,7 +970,7 @@ 61A19AE414D2010A004B1E6D /* Products */ = { isa = PBXGroup; children = ( - 61A19AEA14D2010A004B1E6D /* libSDL.a */, + 61A19AEA14D2010A004B1E6D /* libSDL2.a */, 61A19AEC14D2010A004B1E6D /* testsdl.app */, ); name = Products; @@ -1315,10 +1318,10 @@ remoteRef = 619599431364C82B00B429B6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 61A19AEA14D2010A004B1E6D /* libSDL.a */ = { + 61A19AEA14D2010A004B1E6D /* libSDL2.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL.a; + path = libSDL2.a; remoteRef = 61A19AE914D2010A004B1E6D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1455,6 +1458,7 @@ 61156521147F48B6006729A9 /* About.strings in Resources */, 61156523147F48B7006729A9 /* Localizable.strings in Resources */, 61156525147F48B8006729A9 /* Scheme.strings in Resources */, + 616065A8159A71FD00CFAEF4 /* hwclassic.mp3 in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1472,7 +1476,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\n\n#create config.inc\necho \"Updating config file...\"\nPROTO=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep HEDGEWARS_PROTO_VER | cut -d ' ' -f 2 | cut -d ')' -f 1`\nMAJN=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MAJOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nMINN=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MINOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nPATN=`cat ${PROJECT_DIR}/../../CMakeLists.txt | grep CPACK_PACKAGE_VERSION_PATCH | xargs | cut -d ' ' -f 2 |cut -d '$' -f 1`\nREVN=-`/usr/local/bin/hg id -n ${PROJECT_DIR}/../../`\necho \"const cNetProtoVersion = $PROTO; const cVersionString = '${MAJN}.${MINN}.${PATN}${REVN}'; const cLuaLibrary = '';\" > ${PROJECT_DIR}/config.inc\n\necho \"Copying Data...\"\ncp -R ${PROJECT_DIR}/../../share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some files from QTfrontend/res\necho \"Fetching additional graphics from QTfrontend...\"\nmkdir ${PROJECT_DIR}/Data/Graphics/Icons\ncp ${PROJECT_DIR}/../../QTfrontend/res/{btn*,icon*,StatsMedal*,ammopic*}.png ${PROJECT_DIR}/Data/Graphics/Icons/\n\necho \"Removing text and dummy files...\"\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 *.psd -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\nfind ${PROJECT_DIR}/Data -name *.ts -delete\n\n#delete dummy maps and hats, misc stuff\nrm -rf ${PROJECT_DIR}/Data/Maps/test*\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/{TeamCap,TeamHeadband,TeamHair}\nrm -rf ${PROJECT_DIR}/Data/misc/\n\n#delete forbidden maps and WIP themes (remember to check that no Map uses them)\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\nrm -rf ${PROJECT_DIR}/Data/Themes/{Beach,Digital}\n\n#delete all names, reserved hats and unused fonts\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\necho \"Handling audio files...\"\n#copy mono audio\ncp -R ${PROJECT_DIR}/../AudioMono/* ${PROJECT_DIR}/Data/\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n#delete the main theme file\nrm -rf ${PROJECT_DIR}/Data/Music/main_theme.ogg\n\n#remove unused voices\nfor i in {Amazing,Brilliant,Bugger,Bungee,Cutitout,Drat,Excellent,Fire,FlawlessPossibility,Gonnagetyou,Grenade,Hmm,Justyouwait,Leavemealone,Ohdear,Ouch,Perfect,Revenge,Runaway,Solong,Thisoneismine,VictoryPossibility,Watchthis,Whatthe,Whoopsee}; do find Data/Sounds/voices/ -name $i.ogg -delete; done\n\necho \"Tweaking Data contents...\"\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nfor i in `ls ${PROJECT_DIR}/Data/Maps/`;\ndo \n if [[ `ls -f ${PROJECT_DIR}/Data/Maps/$i/map.lua 2> /dev/null` != '' ]];\n then\n mv ${PROJECT_DIR}/Data/Maps/$i ${PROJECT_DIR}/Data/Missions/Maps/;\n fi;\ndone;\n\n#workaround for missing map in CTF_Blizzard\nln -s ../../../Maps/Blizzard/map.png ${PROJECT_DIR}/Data/Missions/Maps/CTF_Blizzard/map.png\n\n#reduce the number of flakes for City\nsed -i -e 's/1500/50/' ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\necho \"Done\""; + shellScript = "SOURCE_DIR=${PROJECT_DIR}/../../\n\n#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\n\n#create config.inc\necho \"Updating config file...\"\nPROTO=`cat ${SOURCE_DIR}/CMakeLists.txt | grep HEDGEWARS_PROTO_VER | cut -d ' ' -f 2 | cut -d ')' -f 1`\nMAJN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MAJOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nMINN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MINOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nPATN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_PATCH | xargs | cut -d ' ' -f 2 |cut -d '$' -f 1`\nREVN=-`/usr/local/bin/hg id -n ${SOURCE_DIR}`\necho \"const cNetProtoVersion = $PROTO; const cVersionString = '${MAJN}.${MINN}.${PATN}${REVN}'; const cLuaLibrary = '';\" > ${PROJECT_DIR}/config.inc\n\necho \"Copying Data...\"\ncp -R ${SOURCE_DIR}/share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some other files\necho \"Fetching additional graphics...\"\nmkdir -p ${PROJECT_DIR}/Data/Graphics/Icons\ncp ${SOURCE_DIR}/QTfrontend/res/{btn*,icon*,StatsMedal*,ammopic*}.png ${PROJECT_DIR}/Data/Graphics/Icons/\ncp -R ${SOURCE_DIR}/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons ${PROJECT_DIR}/Data/Graphics/\n\necho \"Removing text and dummy files...\"\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 *.psd -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\nfind ${PROJECT_DIR}/Data -name *.ts -delete\n\n#delete dummy maps and hats, misc stuff\nrm -rf ${PROJECT_DIR}/Data/Maps/test*\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/{TeamCap,TeamHeadband,TeamHair}\nrm -rf ${PROJECT_DIR}/Data/misc/\n\n#delete forbidden maps and WIP themes (remember to check that no Map uses them)\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\nrm -rf ${PROJECT_DIR}/Data/Themes/{Beach,Digital}\n\n#delete all names, reserved hats and unused fonts\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\necho \"Handling audio files...\"\n#copy mono audio\ncp -R ${SOURCE_DIR}/project_files/AudioMono/* ${PROJECT_DIR}/Data/\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n#delete the main theme file\nrm -rf ${PROJECT_DIR}/Data/Music/main_theme.ogg\n\n#remove unused voices\nfor i in {Amazing,Brilliant,Bugger,Bungee,Cutitout,Drat,Excellent,Fire,FlawlessPossibility,Gonnagetyou,Grenade,Hmm,Justyouwait,Leavemealone,Ohdear,Ouch,Perfect,Revenge,Runaway,Solong,Thisoneismine,VictoryPossibility,Watchthis,Whatthe,Whoopsee}; do find Data/Sounds/voices/ -name $i.ogg -delete; done\n\necho \"Tweaking Data contents...\"\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nfor i in `ls ${PROJECT_DIR}/Data/Maps/`;\ndo \n if [[ `ls -f ${PROJECT_DIR}/Data/Maps/$i/map.lua 2> /dev/null` != '' ]];\n then\n mv ${PROJECT_DIR}/Data/Maps/$i ${PROJECT_DIR}/Data/Missions/Maps/;\n fi;\ndone;\n\n#workaround for missing map in CTF_Blizzard\nln -s ../../../Maps/Blizzard/map.png ${PROJECT_DIR}/Data/Missions/Maps/CTF_Blizzard/map.png\n\n#reduce the number of flakes for City\nsed -i -e 's/1500/50/' ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\necho \"Done\""; showEnvVarsInLog = 0; }; 9283011B0F10CB2D00CC5A3C /* Build libfpc.a */ = { @@ -1756,7 +1760,6 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../Library/SDL/src/video\"/**", "\"$(SRCROOT)/../../../Library/SDL/include/\"", "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", @@ -1862,7 +1865,6 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../Library/SDL/src/video\"/**", "\"$(SRCROOT)/../../../Library/SDL/include/\"", "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", @@ -2010,7 +2012,6 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../Library/SDL/src/video\"/**", "\"$(SRCROOT)/../../../Library/SDL/include/\"", "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", @@ -2080,7 +2081,6 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../Library/SDL/src/video\"/**", "\"$(SRCROOT)/../../../Library/SDL/include/\"", "\"$(SRCROOT)/../../../Library/SDL_net/\"", "\"$(SRCROOT)/../../../Library/SDL_mixer/\"", diff -r 15f722e0b96f -r d1db8aaa8edc share/hedgewars/Data/Graphics/hedgewars.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Graphics/hedgewars.svg Wed Jun 27 18:04:17 2012 +0200 @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + +