# HG changeset patch # User unc0rr # Date 1169907513 0 # Node ID 731ad6d27bd1f8e97b7dc05aa6d80832d4398852 # Parent c75410fe3133d6e8b5c7d24438f70f8885f31bca integer -> LongInt diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/CCHandlers.inc Sat Jan 27 14:18:33 2007 +0000 @@ -35,7 +35,7 @@ end; procedure chCheckProto(var s: shortstring); -var i, c: integer; +var i, c: LongInt; begin if isDeveloperMode then begin @@ -97,7 +97,7 @@ end; procedure chColor(var id: shortstring); -var c: integer; +var c: LongInt; begin if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/color"', true); val(id, CurrentTeam^.Color, c); @@ -107,7 +107,7 @@ procedure chAddHH(var id: shortstring); var s: shortstring; - c: integer; + c: LongInt; Gear: PGear; begin if (not isDeveloperMode)or(CurrentTeam=nil) then exit; @@ -133,7 +133,7 @@ procedure chBind(var id: shortstring); var s: shortstring; - b: integer; + b: LongInt; begin if CurrentTeam = nil then exit; SplitBySpace(id, s); diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/GSHandlers.inc Sat Jan 27 14:18:33 2007 +0000 @@ -112,7 +112,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepBomb(Gear: PGear); -var i: integer; +var i: LongInt; begin AllInactive:= false; doStepFallingGear(Gear); @@ -355,7 +355,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepPickHammerWork(Gear: PGear); -var i, ei: integer; +var i, ei: LongInt; HHGear: PGear; begin AllInactive:= false; @@ -370,8 +370,8 @@ end; if (Gear^.Timer and $3F) = 0 then begin - i:= hwRound(Gear^.X) - Gear^.Radius - integer(GetRandom(2)); - ei:= hwRound(Gear^.X) + Gear^.Radius + integer(GetRandom(2)); + i:= hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); + ei:= hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); while i <= ei do begin doMakeExplosion(i, hwRound(Gear^.Y) + 3, 3, 0); @@ -406,15 +406,15 @@ end; procedure doStepPickHammer(Gear: PGear); -var i, y: integer; +var i, y: LongInt; ar: TRangeArray; begin i:= 0; y:= hwRound(Gear^.Y) - cHHRadius*2; while y < hwRound(Gear^.Y) do begin - ar[i].Left := hwRound(Gear^.X) - Gear^.Radius - integer(GetRandom(2)); - ar[i].Right:= hwRound(Gear^.X) + Gear^.Radius + integer(GetRandom(2)); + ar[i].Left := hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); + ar[i].Right:= hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); inc(y, 2); inc(i) end; @@ -426,7 +426,7 @@ end; //////////////////////////////////////////////////////////////////////////////// -var BTPrevAngle, BTSteps: integer; +var BTPrevAngle, BTSteps: LongInt; procedure doStepBlowTorchWork(Gear: PGear); var HHGear: PGear; @@ -440,7 +440,7 @@ b:= false; -if abs(integer(HHGear^.Angle) - BTPrevAngle) > 7 then +if abs(LongInt(HHGear^.Angle) - BTPrevAngle) > 7 then begin Gear^.dX:= hwSign(HHGear^.dX) * AngleSin(HHGear^.Angle) * _0_5; Gear^.dY:= AngleCos(HHGear^.Angle) * ( - _0_5); @@ -488,7 +488,7 @@ procedure doStepBlowTorch(Gear: PGear); var HHGear: PGear; begin -BTPrevAngle:= High(integer); +BTPrevAngle:= High(LongInt); BTSteps:= 0; HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; HHGear^.Message:= 0; @@ -767,7 +767,7 @@ /////////////////////////////////////////////////////////////////////////////// procedure doStepCase(Gear: PGear); -var i, x, y: integer; +var i, x, y: LongInt; begin if (Gear^.Message and gm_Destroy) > 0 then begin @@ -807,14 +807,14 @@ //////////////////////////////////////////////////////////////////////////////// var thexchar: array[0..5] of record - oy, ny: integer; + oy, ny: LongInt; team: PTeam; end; thexchcnt: Longword; currsorter: PGear; procedure doStepTeamHealthSorterWork(Gear: PGear); -var i: integer; +var i: LongInt; begin AllInactive:= false; dec(Gear^.Timer); @@ -1019,7 +1019,7 @@ end; procedure doStepAirAttack(Gear: PGear); -var t: integer; +var t: LongInt; begin AllInactive:= false; Gear^.X:= -1024; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/HHHandlers.inc Sat Jan 27 14:18:33 2007 +0000 @@ -133,7 +133,7 @@ const StepTicks: LongWord = 0; procedure HedgehogStep(Gear: PGear); -var PrevdX: integer; +var PrevdX: LongInt; begin if ((Gear^.State and (gstAttacking or gstMoving or gstFalling)) = 0) then begin diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/hwengine.dpr --- a/hedgewars/hwengine.dpr Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/hwengine.dpr Sat Jan 27 14:18:33 2007 +0000 @@ -62,7 +62,7 @@ procedure OnDestroy; forward; //////////////////////////////// -procedure DoTimer(Lag: integer); +procedure DoTimer(Lag: LongInt); var s: string; begin case GameState of @@ -158,9 +158,9 @@ //////////////////// procedure GetParams; -var c: integer; +var c: LongInt; {$IFDEF DEBUGFILE} - i: integer; + i: LongInt; {$ENDIF} p: TPathType; begin diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uAI.pas Sat Jan 27 14:18:33 2007 +0000 @@ -41,8 +41,8 @@ procedure TestAmmos(var Actions: TActions; Me: PGear); var Time, BotLevel: Longword; - Angle, Power, Score, ExplX, ExplY, ExplR: integer; - i: integer; + Angle, Power, Score, ExplX, ExplY, ExplR: LongInt; + i: LongInt; a, aa: TAmmoType; begin BotLevel:= PHedgehog(Me^.Hedgehog)^.BotLevel; @@ -67,7 +67,7 @@ else if (Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0); if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then begin - Angle:= integer(Me^.Angle) - Abs(Angle); + Angle:= LongInt(Me^.Angle) - Abs(Angle); if Angle > 0 then begin AddAction(BestActions, aia_Up, aim_push, 500, 0, 0); @@ -95,7 +95,7 @@ var Actions: TActions; ticks, maxticks, steps, BotLevel: Longword; - BaseRate, Rate: integer; + BaseRate, Rate: LongInt; GoInfo: TGoInfo; CanGo: boolean; AltMe: TGear; @@ -203,7 +203,7 @@ procedure StartThink(Me: PGear); var a: TAmmoType; - tmp: integer; + tmp: LongInt; begin if ((Me^.State and gstAttacking) <> 0) or isInMultiShoot then exit; ThinkingHH:= Me; @@ -231,7 +231,7 @@ tmp:= random(2) + 1; Push(0, BestActions, Me^, tmp); Push(0, BestActions, Me^, tmp xor 3); -BestActions.Score:= Low(integer); +BestActions.Score:= Low(LongInt); Think(Me) end; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uAIActions.pas --- a/hedgewars/uAIActions.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uAIActions.pas Sat Jan 27 14:18:33 2007 +0000 @@ -45,17 +45,17 @@ ai_specmask = $8000; type TAction = record - Action, Param: Longword; - X, Y: integer; + Action: Longword; + X, Y, Param: LongInt; Time: Longword; end; TActions = record Count, Pos: Longword; actions: array[0..Pred(MAXACTIONS)] of TAction; - Score: integer; + Score: LongInt; end; -procedure AddAction(var Actions: TActions; Action, Param, TimeDelta: Longword; X, Y: integer); +procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt); procedure ProcessAction(var Actions: TActions; Me: PGear); implementation @@ -97,7 +97,7 @@ end; {$ENDIF} -procedure AddAction(var Actions: TActions; Action, Param, TimeDelta: Longword; X, Y: integer); +procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt); begin with Actions do begin @@ -116,7 +116,7 @@ var s: shortstring; procedure CheckHang; - const PrevX: integer = 0; + const PrevX: LongInt = 0; timedelta: Longword = 0; begin if hwRound(Me^.X) <> PrevX then diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uAIAmmoTests.pas Sat Jan 27 14:18:33 2007 +0000 @@ -20,14 +20,14 @@ interface uses SDLh, uGears, uConsts, uFloat; -function TestBazooka(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; -(*function TestGrenade(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; -function TestShotgun(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; -function TestDesertEagle(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; -function TestBaseballBat(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; -function TestFirePunch(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +function TestBazooka(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; +(*function TestGrenade(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; +function TestShotgun(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; +function TestDesertEagle(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; +function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; +function TestFirePunch(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; *) -type TAmmoTestProc = function (Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +type TAmmoTestProc = function (Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; const AmmoTests: array[TAmmoType] of TAmmoTestProc = ( {amGrenade} nil,//TestGrenade, @@ -49,27 +49,27 @@ {amBlowTorch} nil ); -const BadTurn = Low(integer); +const BadTurn = Low(LongInt); implementation uses uMisc, uAIMisc, uLand; -function Metric(x1, y1, x2, y2: integer): integer; +function Metric(x1, y1, x2, y2: LongInt): LongInt; begin Metric:= abs(x1 - x2) + abs(y1 - y2) end; -function TestBazooka(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +function TestBazooka(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; var Vx, Vy, r: hwFloat; rTime: hwFloat; - Score, EX, EY: integer; - Result: integer; + Score, EX, EY: LongInt; + Result: LongInt; - function CheckTrace: integer; + function CheckTrace: LongInt; var x, y, dX, dY: hwFloat; - t: integer; - Result: integer; + t: LongInt; + Result: LongInt; begin x:= Me^.X; y:= Me^.Y; @@ -117,15 +117,15 @@ TestBazooka:= Result end; { -function TestGrenade(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +function TestGrenade(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; const tDelta = 24; var Vx, Vy, r: hwFloat; - Score, EX, EY: integer; + Score, EX, EY: LongInt; TestTime: Longword; - function CheckTrace: integer; + function CheckTrace: LongInt; var x, y, dY: hwFloat; - t: integer; + t: LongInt; begin x:= Me.X; y:= Me.Y; @@ -140,7 +140,7 @@ EX:= round(x); EY:= round(y); if t < 50 then Result:= RateExplosion(Me, round(x), round(y), 101) - else Result:= Low(integer) + else Result:= Low(LongInt) end; begin @@ -170,7 +170,7 @@ until (TestTime = 5000) end; -function TestShotgun(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +function TestShotgun(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; var Vx, Vy, x, y: hwFloat; begin ExplR:= 0; @@ -200,7 +200,7 @@ Result:= BadTurn end; -function TestDesertEagle(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +function TestDesertEagle(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; var Vx, Vy, x, y, t: hwFloat; d: Longword; begin @@ -226,10 +226,10 @@ and (Land[round(y), round(x)] <> 0) then inc(d); until (abs(Targ.X - x) + abs(Targ.Y - y) < 2) or (x < 0) or (y < 0) or (x > 2048) or (y > 1024) or (d > 200); if abs(Targ.X - x) + abs(Targ.Y - y) < 2 then Result:= max(0, (4 - d div 50) * 7 * 1024) - else Result:= Low(integer) + else Result:= Low(LongInt) end; -function TestBaseballBat(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; +function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; begin ExplR:= 0; if (Level > 2) and (abs(Me.X - Targ.X) + abs(Me.Y - Targ.Y) >= 25) then @@ -244,8 +244,8 @@ if Result <= 0 then Result:= BadTurn end; -function TestFirePunch(Me: PGear; Targ: TPoint; Level: Integer; var Time: Longword; var Angle, Power: integer; var ExplX, ExplY, ExplR: integer): integer; -var i: integer; +function TestFirePunch(Me: PGear; Targ: TPoint; Level: LongInt; var Time: Longword; var Angle, Power: LongInt; var ExplX, ExplY, ExplR: LongInt): LongInt; +var i: LongInt; begin ExplR:= 0; if (abs(Me.X - Targ.X) > 25) or (abs(Me.Y - 50 - Targ.Y) > 50) then diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uAIMisc.pas --- a/hedgewars/uAIMisc.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uAIMisc.pas Sat Jan 27 14:18:33 2007 +0000 @@ -23,7 +23,7 @@ type TTarget = record Point: TPoint; - Score: integer; + Score: LongInt; end; TTargets = record Count: Longword; @@ -38,13 +38,13 @@ procedure FillTargets; procedure FillBonuses(isAfterAttack: boolean); -procedure AwareOfExplosion(x, y, r: integer); -function RatePlace(Gear: PGear): integer; -function TestColl(x, y, r: integer): boolean; -function RateExplosion(Me: PGear; x, y, r: integer): integer; -function RateShove(Me: PGear; x, y, r, power: integer): integer; +procedure AwareOfExplosion(x, y, r: LongInt); +function RatePlace(Gear: PGear): LongInt; +function TestColl(x, y, r: LongInt): boolean; +function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; +function RateShove(Me: PGear; x, y, r, power: LongInt): LongInt; function HHGo(Gear, AltGear: PGear; var GoInfo: TGoInfo): boolean; -function AIrndSign(num: integer): integer; +function AIrndSign(num: LongInt): LongInt; var ThinkingHH: PGear; Targets: TTargets; @@ -55,16 +55,16 @@ MAXBONUS = 1024; type TBonus = record - X, Y: integer; - Radius: integer; - Score: integer; + X, Y: LongInt; + Radius: LongInt; + Score: LongInt; end; var bonuses: record Count: Longword; ar: array[0..Pred(MAXBONUS)] of TBonus; end; KnownExplosion: record - X, Y, Radius: integer + X, Y, Radius: LongInt end = (X: 0; Y: 0; Radius: 0); procedure FillTargets; @@ -96,7 +96,7 @@ var Gear: PGear; MyColor: Longword; - procedure AddBonus(x, y: integer; r: Longword; s: integer); + procedure AddBonus(x, y: LongInt; r: Longword; s: LongInt); begin bonuses.ar[bonuses.Count].x:= x; bonuses.ar[bonuses.Count].y:= y; @@ -131,16 +131,16 @@ AddBonus(X, Y, Radius + 10, -Radius); end; -procedure AwareOfExplosion(x, y, r: integer); +procedure AwareOfExplosion(x, y, r: LongInt); begin KnownExplosion.X:= x; KnownExplosion.Y:= y; KnownExplosion.Radius:= r end; -function RatePlace(Gear: PGear): integer; -var i, r: integer; - Result: integer; +function RatePlace(Gear: PGear): LongInt; +var i, r: LongInt; + Result: LongInt; begin Result:= 0; for i:= 0 to Pred(bonuses.Count) do @@ -153,7 +153,7 @@ RatePlace:= Result end; -function TestColl(x, y, r: integer): boolean; +function TestColl(x, y, r: LongInt): boolean; var b: boolean; begin b:= (((x-r) and $FFFFF800) = 0)and(((y-r) and $FFFFFC00) = 0) and (Land[y-r, x-r] <> 0); @@ -165,8 +165,8 @@ TestColl:=(((x+r) and $FFFFF800) = 0)and(((y+r) and $FFFFFC00) = 0) and (Land[y+r, x+r] <> 0) end; -function RateExplosion(Me: PGear; x, y, r: integer): integer; -var i, dmg, Result: integer; +function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; +var i, dmg, Result: LongInt; begin Result:= 0; // add our virtual position @@ -195,8 +195,8 @@ RateExplosion:= Result * 1024 end; -function RateShove(Me: PGear; x, y, r, power: integer): integer; -var i, dmg, Result: integer; +function RateShove(Me: PGear; x, y, r, power: LongInt): LongInt; +var i, dmg, Result: LongInt; begin Result:= 0; for i:= 0 to Targets.Count do @@ -217,7 +217,7 @@ end; function HHJump(Gear: PGear; JumpType: TJumpType; var GoInfo: TGoInfo): boolean; -var bX, bY: integer; +var bX, bY: LongInt; Result: boolean; begin Result:= false; @@ -290,7 +290,7 @@ end; function HHGo(Gear, AltGear: PGear; var GoInfo: TGoInfo): boolean; -var pX, pY: integer; +var pX, pY: LongInt; Result: boolean; begin Result:= false; @@ -388,7 +388,7 @@ HHJump(AltGear, jmpHJump, GoInfo) end; -function AIrndSign(num: integer): integer; +function AIrndSign(num: LongInt): LongInt; begin if random(2) = 0 then AIrndSign:= num else AIrndSign:= - num diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uAIThinkStack.pas --- a/hedgewars/uAIThinkStack.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uAIThinkStack.pas Sat Jan 27 14:18:33 2007 +0000 @@ -32,14 +32,14 @@ States: array[0..Pred(cBranchStackSize)] of TStackEntry; end; -function Push(Ticks: Longword; const Actions: TActions; const Me: TGear; Dir: integer): boolean; +function Push(Ticks: Longword; const Actions: TActions; const Me: TGear; Dir: LongInt): boolean; function Pop(var Ticks: Longword; var Actions: TActions; var Me: TGear): boolean; function PosInThinkStack(Me: PGear): boolean; procedure ClearThinkStack; implementation -function Push(Ticks: Longword; const Actions: TActions; const Me: TGear; Dir: integer): boolean; +function Push(Ticks: Longword; const Actions: TActions; const Me: TGear; Dir: LongInt): boolean; var Result: boolean; begin Result:= (ThinkStack.Count < cBranchStackSize) and (Actions.Count < MAXACTIONS - 5); diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uAmmos.pas Sat Jan 27 14:18:33 2007 +0000 @@ -9,7 +9,7 @@ procedure AssignStores; procedure AddAmmo(Hedgehog: pointer; ammo: TAmmoType); function HHHasAmmo(Hedgehog: pointer; Ammo: TAmmoType): boolean; -procedure PackAmmo(Ammo: PHHAmmo; Slot: integer); +procedure PackAmmo(Ammo: PHHAmmo; Slot: LongInt); procedure OnUsedAmmo(Ammo: PHHAmmo); implementation @@ -78,7 +78,7 @@ procedure AddAmmo(Hedgehog: pointer; ammo: TAmmoType); var ammos: TAmmoCounts; - slot, ami: integer; + slot, ami: LongInt; hhammo: PHHAmmo; begin FillChar(ammos, sizeof(ammos), 0); @@ -93,8 +93,8 @@ FillAmmoStore(hhammo, ammos) end; -procedure PackAmmo(Ammo: PHHAmmo; Slot: integer); -var ami: integer; +procedure PackAmmo(Ammo: PHHAmmo; Slot: LongInt); +var ami: LongInt; b: boolean; begin repeat @@ -129,7 +129,7 @@ end; function HHHasAmmo(Hedgehog: pointer; Ammo: TAmmoType): boolean; -var slot, ami: integer; +var slot, ami: LongInt; begin Slot:= Ammoz[Ammo].Slot; ami:= 0; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uCollisions.pas Sat Jan 27 14:18:33 2007 +0000 @@ -31,17 +31,17 @@ procedure AddGearCI(Gear: PGear); procedure DeleteCI(Gear: PGear); function CheckGearsCollision(Gear: PGear): PGearArray; -function TestCollisionXwithGear(Gear: PGear; Dir: integer): boolean; -function TestCollisionYwithGear(Gear: PGear; Dir: integer): boolean; -function TestCollisionY(Gear: PGear; Dir: integer): boolean; -function TestCollisionXwithXYShift(Gear: PGear; ShiftX, ShiftY: hwFloat; Dir: integer): boolean; -function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: integer; Dir: integer): boolean; +function TestCollisionXwithGear(Gear: PGear; Dir: LongInt): boolean; +function TestCollisionYwithGear(Gear: PGear; Dir: LongInt): boolean; +function TestCollisionY(Gear: PGear; Dir: LongInt): boolean; +function TestCollisionXwithXYShift(Gear: PGear; ShiftX, ShiftY: hwFloat; Dir: LongInt): boolean; +function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt): boolean; implementation uses uMisc, uConsts, uLand, uLandGraphics; type TCollisionEntry = record - X, Y, Radius: integer; + X, Y, Radius: LongInt; cGear: PGear; end; @@ -79,7 +79,7 @@ end; function CheckGearsCollision(Gear: PGear): PGearArray; -var mx, my: integer; +var mx, my: LongInt; i: Longword; Result: PGearArray; begin @@ -100,8 +100,8 @@ CheckGearsCollision:= Result end; -function TestCollisionXwithGear(Gear: PGear; Dir: integer): boolean; -var x, y, i: integer; +function TestCollisionXwithGear(Gear: PGear; Dir: LongInt): boolean; +var x, y, i: LongInt; begin x:= hwRound(Gear^.X); if Dir < 0 then x:= x - Gear^.Radius @@ -119,7 +119,7 @@ TestCollisionXwithGear:= false end; -function TestCollisionXwithXYShift(Gear: PGear; ShiftX, ShiftY: hwFloat; Dir: integer): boolean; +function TestCollisionXwithXYShift(Gear: PGear; ShiftX, ShiftY: hwFloat; Dir: LongInt): boolean; begin Gear^.X:= Gear^.X + ShiftX; Gear^.Y:= Gear^.Y + ShiftY; @@ -128,8 +128,8 @@ Gear^.Y:= Gear^.Y - ShiftY end; -function TestCollisionYwithGear(Gear: PGear; Dir: integer): boolean; -var x, y, i: integer; +function TestCollisionYwithGear(Gear: PGear; Dir: LongInt): boolean; +var x, y, i: LongInt; begin y:= hwRound(Gear^.Y); if Dir < 0 then y:= y - Gear^.Radius @@ -147,8 +147,8 @@ TestCollisionYwithGear:= false end; -function TestCollisionY(Gear: PGear; Dir: integer): boolean; -var x, y, i: integer; +function TestCollisionY(Gear: PGear; Dir: LongInt): boolean; +var x, y, i: LongInt; begin y:= hwRound(Gear^.Y); if Dir < 0 then y:= y - Gear^.Radius @@ -166,7 +166,7 @@ TestCollisionY:= false end; -function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: integer; Dir: integer): boolean; +function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt): boolean; begin Gear^.X:= Gear^.X + ShiftX; Gear^.Y:= Gear^.Y + ShiftY; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uConsole.pas Sat Jan 27 14:18:33 2007 +0000 @@ -21,7 +21,7 @@ uses SDLh, uFloat; {$INCLUDE options.inc} const isDeveloperMode: boolean = true; -type TVariableType = (vtCommand, vtInteger, vthwFloat, vtBoolean); +type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean); TCommandHandler = procedure (var params: shortstring); procedure DrawConsole(Surface: PSDL_Surface); @@ -35,7 +35,7 @@ {$J+} uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uLand, uRandom, uAmmos; -const cLineWidth: integer = 0; +const cLineWidth: LongInt = 0; cLinesCount = 256; type PVariable = ^TVariable; @@ -48,7 +48,7 @@ end; var ConsoleLines: array[byte] of ShortString; - CurrLine: integer = 0; + CurrLine: LongInt = 0; InputStr: shortstring; Variables: PVariable = nil; @@ -86,7 +86,7 @@ end; procedure SplitBySpace(var a, b: shortstring); -var i, t: integer; +var i, t: LongInt; begin i:= Pos(' ', a); if i>0 then @@ -100,7 +100,7 @@ end; procedure DrawConsole(Surface: PSDL_Surface); -var x, y: integer; +var x, y: LongInt; r: TSDL_Rect; begin with r do @@ -120,7 +120,7 @@ end; procedure WriteToConsole(s: shortstring); -var Len: integer; +var Len: LongInt; begin {$IFDEF DEBUGFILE}AddFileLog('Console write: ' + s);{$ENDIF} Write(s); @@ -147,7 +147,7 @@ end; procedure InitConsole; -var i: integer; +var i: LongInt; begin cLineWidth:= cScreenWidth div 10; if cLineWidth > 255 then cLineWidth:= 255; @@ -156,7 +156,7 @@ procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); type PhwFloat = ^hwFloat; -var i, ii: integer; +var i, ii: LongInt; s: shortstring; t: PVariable; c: char; @@ -178,12 +178,12 @@ begin TCommandHandler(t^.Handler)(s); end; - vtInteger: if c='$' then + vtLongInt: if c='$' then if s[0]=#0 then begin - str(PInteger(t^.Handler)^, s); + str(PLongInt(t^.Handler)^, s); WriteLnToConsole('$' + CmdStr + ' is "' + s + '"'); - end else val(s, PInteger(t^.Handler)^, i); + end else val(s, PLongInt(t^.Handler)^, i); vthwFloat: if c='$' then if s[0]=#0 then begin @@ -272,9 +272,9 @@ RegisterVariable('map' , vtCommand, @chSetMap , false); RegisterVariable('theme' , vtCommand, @chSetTheme , false); RegisterVariable('seed' , vtCommand, @chSetSeed , false); -RegisterVariable('c_height', vtInteger, @cConsoleHeight , false); -RegisterVariable('gmflags' , vtInteger, @GameFlags , false); -RegisterVariable('turntime', vtInteger, @cHedgehogTurnTime, false); +RegisterVariable('c_height', vtLongInt, @cConsoleHeight , false); +RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); +RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); RegisterVariable('name' , vtCommand, @chName , false); RegisterVariable('fort' , vtCommand, @chFort , false); RegisterVariable('grave' , vtCommand, @chGrave , false); diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uConsts.pas Sat Jan 27 14:18:33 2007 +0000 @@ -66,8 +66,8 @@ THHFont = record Handle: PTTF_Font; - Height: integer; - style: integer; + Height: LongInt; + style: LongInt; Name: string[15]; end; @@ -175,7 +175,7 @@ posCaseAmmo = $00000001; posCaseHealth = $00000002; - NoPointX = Low(Integer); + NoPointX = Low(LongInt); cHHFileName = 'Hedgehog'; cCHFileName = 'Crosshair'; @@ -238,7 +238,7 @@ FileName: String[31]; Path, AltPath: TPathType; Surface : PSDL_Surface; - Width, Height: integer; + Width, Height: LongInt; hasAlpha: boolean; end = ( (FileName: 'BlueWater'; Path: ptGraphics; AltPath: ptNone; Surface: nil; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uFloat.pas Sat Jan 27 14:18:33 2007 +0000 @@ -50,7 +50,7 @@ operator > (z1, z2: hwFloat) b : boolean; function cstr(z: hwFloat): string; -function hwRound(t: hwFloat): integer; +function hwRound(t: hwFloat): LongInt; function hwAbs(t: hwFloat): hwFloat; function hwSqr(t: hwFloat): hwFloat; function hwSqrt(t: hwFloat): hwFloat; @@ -231,7 +231,7 @@ if z.isNegative then cstr:= '-' + cstr end; -function hwRound(t: hwFloat): integer; +function hwRound(t: hwFloat): LongInt; begin if t.isNegative then hwRound:= -t.Round else hwRound:= t.Round diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uGame.pas --- a/hedgewars/uGame.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uGame.pas Sat Jan 27 14:18:33 2007 +0000 @@ -21,16 +21,16 @@ uses uFloat; {$INCLUDE options.inc} -procedure DoGameTick(Lag: integer); +procedure DoGameTick(Lag: LongInt); //////////////////// implementation //////////////////// uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole; -procedure DoGameTick(Lag: integer); +procedure DoGameTick(Lag: LongInt); const SendEmptyPacketTicks: LongWord = 0; -var i: integer; +var i: LongInt; begin if isPaused then exit; if not CurrentTeam^.ExtDriven then diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uGears.pas Sat Jan 27 14:18:33 2007 +0000 @@ -35,7 +35,7 @@ Kind: TGearType; Pos: Longword; doStep: TGearStepProcedure; - Radius: integer; + Radius: LongInt; Angle, Power : Longword; DirAngle: hwFloat; Timer : LongWord; @@ -43,14 +43,14 @@ Friction : hwFloat; Message : Longword; Hedgehog: pointer; - Health, Damage: integer; + Health, Damage: LongInt; CollIndex: Longword; - Tag: integer; + Tag: LongInt; Surf: PSDL_Surface; Z: Longword; end; -function AddGear(X, Y: integer; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; +function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; procedure ProcessGears; procedure SetAllToActive; procedure SetAllHHToActive; @@ -71,7 +71,7 @@ uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI, uAmmos; var RopePoints: record Count: Longword; - HookAngle: integer; + HookAngle: LongInt; ar: array[0..300] of record X, Y: hwFloat; dLen: hwFloat; @@ -81,13 +81,13 @@ StepDamage: Longword = 0; procedure DeleteGear(Gear: PGear); forward; -procedure doMakeExplosion(X, Y, Radius: integer; Mask: LongWord); forward; -procedure AmmoShove(Ammo: PGear; Damage, Power: integer); forward; +procedure doMakeExplosion(X, Y, Radius: LongInt; Mask: LongWord); forward; +procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); forward; procedure AmmoFlameWork(Ammo: PGear); forward; -function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: integer): PGear; forward; +function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear; forward; procedure SpawnBoxOfSmth; forward; procedure AfterAttack; forward; -procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: integer); forward; +procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: LongInt); forward; procedure HedgehogStep(Gear: PGear); forward; procedure HedgehogChAngle(Gear: PGear); forward; @@ -155,7 +155,7 @@ end; end; -function AddGear(X, Y: integer; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; +function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; const Counter: Longword = 0; var Result: PGear; begin @@ -337,7 +337,7 @@ end; procedure ProcessGears; -const delay: integer = cInactDelay; +const delay: LongInt = cInactDelay; step: (stDelay, stChDmg, stChWin, stSpawn, stNTurn) = stDelay; var Gear, t: PGear; {$IFDEF COUNTTICKS} @@ -448,7 +448,7 @@ end; procedure DrawHH(Gear: PGear; Surface: PSDL_Surface); -var t: integer; +var t: LongInt; begin DrawHedgehog(hwRound(Gear^.X) - 14 + WorldDx, hwRound(Gear^.Y) - 18 + WorldDy, hwSign(Gear^.dX), 0, @@ -477,7 +477,7 @@ if ShowCrosshair and ((Gear^.State and gstAttacked) = 0) then DrawSurfSprite(Round(hwRound(Gear^.X) + hwSign(Gear^.dX) * Sin(Gear^.Angle*pi/cMaxAngle)*60) + WorldDx - 11, Round(hwRound(Gear^.Y) - Cos(Gear^.Angle*pi/cMaxAngle)*60) + WorldDy - 12, - 24, (18 + hwSign(Gear^.dX) * integer(((Gear^.Angle * 72 div cMaxAngle) + 1) div 2) mod 18) mod 18, + 24, (18 + hwSign(Gear^.dX) * LongInt(((Gear^.Angle * 72 div cMaxAngle) + 1) div 2) mod 18) mod 18, Team^.CrosshairSurf, Surface); end; end; @@ -485,11 +485,11 @@ procedure DrawGears(Surface: PSDL_Surface); var Gear: PGear; i: Longword; - roplen: integer; + roplen: LongInt; - procedure DrawRopeLine(X1, Y1, X2, Y2: integer); - var eX, eY, dX, dY: integer; - i, sX, sY, x, y, d: integer; + procedure DrawRopeLine(X1, Y1, X2, Y2: LongInt); + var eX, eY, dX, dY: LongInt; + i, sX, sY, x, y, d: LongInt; b: boolean; begin if (X1 = X2) and (Y1 = Y2) then @@ -618,7 +618,7 @@ end; procedure AddMiscGears; -var i: integer; +var i: LongInt; begin AddGear(0, 0, gtATStartGame, 0, 0, 0, 2000); if (GameFlags and gfForts) = 0 then @@ -627,7 +627,7 @@ end; procedure AddClouds; -var i: integer; +var i: LongInt; dx, dy: hwFloat; begin for i:= 0 to cCloudsNumber do @@ -641,9 +641,9 @@ end end; -procedure doMakeExplosion(X, Y, Radius: integer; Mask: LongWord); +procedure doMakeExplosion(X, Y, Radius: LongInt; Mask: LongWord); var Gear: PGear; - dmg: integer; + dmg: LongInt; begin TargetPoint.X:= NoPointX; {$IFDEF DEBUGFILE}if Radius > 3 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');{$ENDIF} @@ -684,9 +684,9 @@ //uAIMisc.AwareOfExplosion(0, 0, 0) end; -procedure AmmoShove(Ammo: PGear; Damage, Power: integer); +procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); var t: PGearArray; - i: integer; + i: LongInt; hh: PHedgehog; begin t:= CheckGearsCollision(Ammo); @@ -715,7 +715,7 @@ procedure AssignHHCoords; var Team: PTeam; - i, t: integer; + i, t: LongInt; begin Team:= TeamsList; t:= 0; @@ -731,7 +731,7 @@ end end; -function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: integer): PGear; +function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear; var t: PGear; begin t:= GearsList; @@ -767,7 +767,7 @@ end; end; -function CheckGearsNear(mX, mY: integer; Kind: TGearsType; rX, rY: integer): PGear; +function CheckGearsNear(mX, mY: LongInt; Kind: TGearsType; rX, rY: LongInt): PGear; var t: PGear; begin t:= GearsList; @@ -814,11 +814,11 @@ FindPlace(FollowGear, true, 0, 2048) end; -procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: integer); +procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: LongInt); - function CountNonZeroz(x, y, r: integer): integer; - var i: integer; - Result: integer; + function CountNonZeroz(x, y, r: LongInt): LongInt; + var i: LongInt; + Result: LongInt; begin Result:= 0; if (y and $FFFFFC00) <> 0 then exit; @@ -827,12 +827,12 @@ CountNonZeroz:= Result end; -var fx, x: integer; - y, sy: integer; +var fx, x: LongInt; + y, sy: LongInt; ar: array[0..512] of TPoint; cnt, delta: Longword; begin -fx:= Left + integer(GetRandom(Right - Left)); +fx:= Left + LongInt(GetRandom(Right - Left)); x:= fx; delta:= 130; repeat diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uIO.pas Sat Jan 27 14:18:33 2007 +0000 @@ -47,8 +47,8 @@ X, Y: SmallInt); 2: (str: shortstring); end; - cmdcurpos: integer = 0; - cmdendpos: integer = -1; + cmdcurpos: LongInt = 0; + cmdendpos: LongInt = -1; procedure InitIPC; var ipaddr: TIPAddress; @@ -98,7 +98,7 @@ procedure IPCCheckSock; const ss: string = ''; -var i: integer; +var i: LongInt; buf: array[0..255] of byte; s: shortstring absolute buf; begin diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uKeys.pas --- a/hedgewars/uKeys.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uKeys.pas Sat Jan 27 14:18:33 2007 +0000 @@ -51,7 +51,7 @@ end; procedure ProcessKbd; -var i: integer; +var i: LongInt; s: shortstring; pkbd: PByteArray; Trusted: boolean; @@ -86,7 +86,7 @@ end; procedure ResetKbd; -var i, t: integer; +var i, t: LongInt; pkbd: PByteArray; begin pkbd:= PByteArray(SDL_GetKeyState(@i)); @@ -96,7 +96,7 @@ end; procedure InitKbdKeyTable; -var i, t: integer; +var i, t: LongInt; s: string[15]; begin KeyNames[1]:= 'mousel'; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uLand.pas Sat Jan 27 14:18:33 2007 +0000 @@ -68,10 +68,10 @@ TryDo(s = digest, 'Different maps generated, sorry', true) end; -procedure DrawLine(X1, Y1, X2, Y2: integer; Color: Longword); +procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword); var - eX, eY, dX, dY: integer; - i, sX, sY, x, y, d: integer; + eX, eY, dX, dY: LongInt; + i, sX, sY, x, y, d: LongInt; begin eX:= 0; eY:= 0; @@ -121,11 +121,11 @@ end; procedure DrawEdge(var pa: TPixAr; Color: Longword); -var i: integer; +var i: LongInt; begin i:= 0; with pa do -while i < integer(Count) - 1 do +while i < LongInt(Count) - 1 do if (ar[i + 1].X = NTPX) then inc(i, 2) else begin DrawLine(ar[i].x, ar[i].y, ar[i + 1].x, ar[i + 1].y, Color); @@ -159,12 +159,12 @@ end end; -procedure AddLoopPoints(var pa, opa: TPixAr; StartI, EndI: integer; Delta: hwFloat); -var i, pi, ni: integer; +procedure AddLoopPoints(var pa, opa: TPixAr; StartI, EndI: LongInt; Delta: hwFloat); +var i, pi, ni: LongInt; NVx, NVy, PVx, PVy: hwFloat; x1, x2, y1, y2, cx1, cx2, cy1, cy2: hwFloat; tsq, tcb, t, r1, r2, r3, r4: hwFloat; - X, Y: integer; + X, Y: LongInt; begin pi:= EndI; i:= StartI; @@ -217,14 +217,14 @@ end; procedure BezierizeEdge(var pa: TPixAr; Delta: hwFloat); -var x, y, i, StartLoop: integer; +var x, y, i, StartLoop: LongInt; opa: TPixAr; begin opa:= pa; pa.Count:= 0; i:= 0; StartLoop:= 0; -while i < integer(opa.Count) do +while i < LongInt(opa.Count) do if (opa.ar[i + 1].X = NTPX) then begin AddLoopPoints(pa, opa, StartLoop, i, Delta); @@ -235,15 +235,15 @@ end else inc(i) end; -procedure FillLand(x, y: integer); +procedure FillLand(x, y: LongInt); var Stack: record Count: Longword; points: array[0..8192] of record - xl, xr, y, dir: integer; + xl, xr, y, dir: LongInt; end end; - procedure Push(_xl, _xr, _y, _dir: integer); + procedure Push(_xl, _xr, _y, _dir: LongInt); begin TryDo(Stack.Count <= 8192, 'FillLand: stack overflow', true); _y:= _y + _dir; @@ -258,7 +258,7 @@ inc(Stack.Count) end; - procedure Pop(var _xl, _xr, _y, _dir: integer); + procedure Pop(var _xl, _xr, _y, _dir: LongInt); begin dec(Stack.Count); with Stack.points[Stack.Count] do @@ -270,7 +270,7 @@ end end; -var xl, xr, dir: integer; +var xl, xr, dir: LongInt; begin Stack.Count:= 0; xl:= x - 1; @@ -328,7 +328,7 @@ procedure AddBorder(Surface: PSDL_Surface); var tmpsurf: PSDL_Surface; r, rr: TSDL_Rect; - x, yd, yu: integer; + x, yd, yu: LongInt; begin tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Border', false, true, true); for x:= 0 to 2047 do @@ -368,15 +368,15 @@ end; procedure SetPoints(var Template: TEdgeTemplate; var pa: TPixAr); -var i: integer; +var i: LongInt; begin with Template do begin pa.Count:= BasePointsCount; for i:= 0 to pred(pa.Count) do begin - pa.ar[i].x:= BasePoints^[i].x + integer(GetRandom(BasePoints^[i].w)); - pa.ar[i].y:= BasePoints^[i].y + integer(GetRandom(BasePoints^[i].h)) + pa.ar[i].x:= BasePoints^[i].x + LongInt(GetRandom(BasePoints^[i].w)); + pa.ar[i].y:= BasePoints^[i].y + LongInt(GetRandom(BasePoints^[i].h)) end; if canMirror then @@ -400,11 +400,11 @@ end end; -procedure RandomizePoints(var pa: TPixAr; MaxRad: integer); +procedure RandomizePoints(var pa: TPixAr; MaxRad: LongInt); const cEdge = 55; cMinDist = 0; -var radz: array[0..Pred(cMaxEdgePoints)] of integer; - i, k, dist: integer; +var radz: array[0..Pred(cMaxEdgePoints)] of LongInt; + i, k, dist: LongInt; begin radz[0]:= 0; for i:= 0 to Pred(pa.Count) do @@ -426,8 +426,8 @@ with pa.ar[i] do if ((x and $FFFFF800) = 0) and ((y and $FFFFFC00) = 0) then begin - x:= x + integer(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3; - y:= y + integer(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3 + x:= x + LongInt(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3; + y:= y + LongInt(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3 end end; @@ -458,7 +458,7 @@ DrawEdge(pa, COLOR_LAND) end; -function SelectTemplate: integer; +function SelectTemplate: LongInt; begin SelectTemplate:= getrandom(Succ(High(EdgeTemplates))) end; @@ -564,7 +564,7 @@ end; procedure GenPreview; -var x, y, xx, yy, t, bit: integer; +var x, y, xx, yy, t, bit: LongInt; begin WriteLnToConsole('Generating preview...'); GenBlank(EdgeTemplates[SelectTemplate]); diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uLandGraphics.pas Sat Jan 27 14:18:33 2007 +0000 @@ -5,19 +5,19 @@ type PRangeArray = ^TRangeArray; TRangeArray = array[0..31] of record - Left, Right: integer; + Left, Right: LongInt; end; -procedure DrawExplosion(X, Y, Radius: integer); -procedure DrawHLinesExplosions(ar: PRangeArray; Radius: integer; y, dY: integer; Count: Byte); -procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: integer); -procedure FillRoundInLand(X, Y, Radius: integer; Value: Longword); +procedure DrawExplosion(X, Y, Radius: LongInt); +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); implementation uses SDLh, uMisc, uLand, uConsts; -procedure FillCircleLines(x, y, dx, dy: integer; Value: Longword); -var i: integer; +procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); +var i: LongInt; begin if ((y + dy) and $FFFFFC00) = 0 then for i:= max(x - dx, 0) to min(x + dx, 2047) do Land[y + dy, i]:= Value; @@ -29,8 +29,8 @@ for i:= max(x - dy, 0) to min(x + dy, 2047) do Land[y - dx, i]:= Value; end; -procedure FillRoundInLand(X, Y, Radius: integer; Value: Longword); -var dx, dy, d: integer; +procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); +var dx, dy, d: LongInt; begin dx:= 0; dy:= Radius; @@ -49,7 +49,7 @@ if (dx = dy) then FillCircleLines(x, y, dx, dy, Value); end; -procedure ClearLandPixel(y, x: integer); +procedure ClearLandPixel(y, x: LongInt); var p: PByteArray; begin p:= @PByteArray(LandSurface^.pixels)^[LandSurface^.pitch * y]; @@ -65,7 +65,7 @@ end end; -procedure SetLandPixel(y, x: integer); +procedure SetLandPixel(y, x: LongInt); var p: PByteArray; begin p:= @PByteArray(LandSurface^.pixels)^[LandSurface^.pitch * y]; @@ -81,8 +81,8 @@ end end; -procedure FillLandCircleLines0(x, y, dx, dy: integer); -var i: integer; +procedure FillLandCircleLines0(x, y, dx, dy: LongInt); +var i: LongInt; begin if ((y + dy) and $FFFFFC00) = 0 then for i:= max(x - dx, 0) to min(x + dx, 2047) do ClearLandPixel(y + dy, i); @@ -94,8 +94,8 @@ for i:= max(x - dy, 0) to min(x + dy, 2047) do ClearLandPixel(y - dx, i); end; -procedure FillLandCircleLinesEBC(x, y, dx, dy: integer); -var i: integer; +procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); +var i: LongInt; begin if ((y + dy) and $FFFFFC00) = 0 then for i:= max(x - dx, 0) to min(x + dx, 2047) do @@ -111,8 +111,8 @@ if Land[y - dx, i] = COLOR_LAND then SetLandPixel(y - dx, i); end; -procedure DrawExplosion(X, Y, Radius: integer); -var dx, dy, d: integer; +procedure DrawExplosion(X, Y, Radius: LongInt); +var dx, dy, d: LongInt; begin FillRoundInLand(X, Y, Radius, 0); @@ -155,7 +155,7 @@ SDL_UnlockSurface(LandSurface); end; -procedure DrawHLinesExplosions(ar: PRangeArray; Radius: integer; y, dY: integer; Count: Byte); +procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); var tx, ty, i: LongInt; begin if SDL_MustLock(LandSurface) then @@ -188,7 +188,7 @@ // // - (dX, dY) - direction, vector of length = 0.5 // -procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: integer); +procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt); var nx, ny, dX8, dY8: hwFloat; i, t, tx, ty: Longint; begin // (-dY, dX) is (dX, dY) rotated by PI/2 diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uLandObjects.pas Sat Jan 27 14:18:33 2007 +0000 @@ -41,7 +41,7 @@ Maxcnt: Longword; end; TThemeObjects = record - Count: integer; + Count: LongInt; objs: array[0..Pred(MAXTHEMEOBJECTS)] of TThemeObject; end; TSprayObject = record @@ -50,7 +50,7 @@ Maxcnt: Longword; end; TSprayObjects = record - Count: integer; + Count: LongInt; objs: array[0..Pred(MAXTHEMEOBJECTS)] of TSprayObject end; @@ -60,7 +60,7 @@ procedure BlitImageAndGenerateCollisionInfo(cpX, cpY: Longword; Image, Surface: PSDL_Surface); var p: PByteArray; x, y: Longword; - bpp: integer; + bpp: LongInt; r: TSDL_Rect; begin r.x:= cpX; @@ -102,7 +102,7 @@ WriteLnToConsole(msgOK) end; -procedure AddRect(x1, y1, w1, h1: integer); +procedure AddRect(x1, y1, w1, h1: LongInt); begin with Rects^[RectCount] do begin @@ -126,7 +126,7 @@ Dispose(rects) end; -function CheckIntersect(x1, y1, w1, h1: integer): boolean; +function CheckIntersect(x1, y1, w1, h1: LongInt): boolean; var i: Longword; Result: boolean; begin @@ -142,14 +142,14 @@ CheckIntersect:= Result end; -function AddGirder(gX: integer; Surface: PSDL_Surface): boolean; +function AddGirder(gX: LongInt; Surface: PSDL_Surface): boolean; var tmpsurf: PSDL_Surface; - x1, x2, y, k, i: integer; + x1, x2, y, k, i: LongInt; r, rr: TSDL_Rect; Result: boolean; - function CountNonZeroz(x, y: integer): Longword; - var i: integer; + function CountNonZeroz(x, y: LongInt): Longword; + var i: LongInt; Result: Longword; begin Result:= 0; @@ -352,7 +352,7 @@ procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects); var s: string; f: textfile; - i, ii: integer; + i, ii: LongInt; begin s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename; WriteLnToConsole('Reading objects info...'); @@ -395,8 +395,8 @@ TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true) end; -procedure AddThemeObjects(Surface: PSDL_Surface; var ThemeObjects: TThemeObjects; MaxCount: integer); -var i, ii, t: integer; +procedure AddThemeObjects(Surface: PSDL_Surface; var ThemeObjects: TThemeObjects; MaxCount: LongInt); +var i, ii, t: LongInt; b: boolean; begin if ThemeObjects.Count = 0 then exit; @@ -416,7 +416,7 @@ procedure AddSprayObjects(Surface: PSDL_Surface; var SprayObjects: TSprayObjects; MaxCount: Longword); var i: Longword; - ii, t: integer; + ii, t: LongInt; b: boolean; begin if SprayObjects.Count = 0 then exit; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uLocale.pas Sat Jan 27 14:18:33 2007 +0000 @@ -37,7 +37,7 @@ procedure LoadLocale(FileName: string); var s: shortstring; f: textfile; - a, b, c: integer; + a, b, c: LongInt; begin {$I-} Assign(f, FileName); @@ -66,7 +66,7 @@ end; function Format(fmt: shortstring; var arg: shortstring): shortstring; -var i: integer; +var i: LongInt; begin i:= Pos('%1', fmt); if i = 0 then Format:= fmt diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uMisc.pas Sat Jan 27 14:18:33 2007 +0000 @@ -35,19 +35,19 @@ cHedgehogTurnTime: Longword = 45000; cMaxAIThinkTime : Longword = 5000; - cCloudsNumber : integer = 9; - cConsoleHeight : integer = 320; - cConsoleYAdd : integer = 0; - cScreenWidth : integer = 1024; - cScreenHeight : integer = 768; - cBits : integer = 16; + cCloudsNumber : LongInt = 9; + cConsoleHeight : LongInt = 320; + cConsoleYAdd : LongInt = 0; + cScreenWidth : LongInt = 1024; + cScreenHeight : LongInt = 768; + cBits : LongInt = 16; cBitsStr : string[2] = '16'; - cWaterLine : integer = 1024; - cVisibleWater : integer = 128; - cGearScrEdgesDist: integer = 240; - cCursorEdgesDist : integer = 40; - cTeamHealthWidth : integer = 128; + cWaterLine : LongInt = 1024; + cVisibleWater : LongInt = 128; + cGearScrEdgesDist: LongInt = 240; + cCursorEdgesDist : LongInt = 40; + cTeamHealthWidth : LongInt = 128; GameTicks : LongWord = 0; @@ -63,8 +63,8 @@ cFullScreen : boolean = true; cLocaleFName : shortstring = 'en.txt'; cSeed : shortstring = ''; - cInitVolume : integer = 128; - cVolumeDelta : integer = 0; + cInitVolume : LongInt = 128; + cVolumeDelta : LongInt = 0; cTimerInterval : Longword = 5; cHasFocus : boolean = true; @@ -81,19 +81,19 @@ InitStepsFlags: Longword = 0; - AttackBar: integer = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP + AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP -function hwSign(r: hwFloat): integer; -function Min(a, b: integer): integer; -function Max(a, b: integer): integer; +function hwSign(r: hwFloat): LongInt; +function Min(a, b: LongInt): LongInt; +function Max(a, b: LongInt): LongInt; function rndSign(num: hwFloat): hwFloat; procedure OutError(Msg: String; isFatalError: boolean); procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean); procedure SDLTry(Assert: boolean; isFatal: boolean); function IntToStr(n: LongInt): shortstring; function FloatToStr(n: hwFloat): shortstring; -function DxDy2Angle32(const _dY, _dX: hwFloat): integer; -function DxDy2AttackAngle(const _dY, _dX: hwFloat): integer; +function DxDy2Angle32(const _dY, _dX: hwFloat): LongInt; +function DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt; procedure AdjustColor(var Color: Longword); {$IFDEF DEBUGFILE} procedure AddFileLog(s: shortstring); @@ -115,17 +115,17 @@ var f: textfile; {$ENDIF} -function hwSign(r: hwFloat): integer; +function hwSign(r: hwFloat): LongInt; begin if r.isNegative then hwSign:= -1 else hwSign:= 1 end; -function Min(a, b: integer): integer; +function Min(a, b: LongInt): LongInt; begin if a < b then Min:= a else Min:= b end; -function Max(a, b: integer): integer; +function Max(a, b: LongInt): LongInt; begin if a > b then Max:= a else Max:= b end; @@ -177,7 +177,7 @@ end; {$ENDIF} -function DxDy2Angle32(const _dY, _dX: hwFloat): integer; +function DxDy2Angle32(const _dY, _dX: hwFloat): LongInt; const _16divPI: Extended = 16/pi; var dY, dX: Extended; begin @@ -188,7 +188,7 @@ DxDy2Angle32:= trunc(arctan2(dY, dX) * _16divPI) and $1f end; -function DxDy2AttackAngle(const _dY, _dX: hwFloat): integer; +function DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt; const MaxAngleDivPI: Extended = cMaxAngle/pi; var dY, dX: Extended; begin @@ -252,7 +252,7 @@ end; -var i: integer; +var i: LongInt; initialization cDrownSpeed.QWordValue:= 257698038;// 0.06 diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uSound.pas --- a/hedgewars/uSound.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uSound.pas Sat Jan 27 14:18:33 2007 +0000 @@ -27,13 +27,13 @@ procedure PlaySound(snd: TSound; infinite: boolean); procedure PlayMusic; procedure StopSound(snd: TSound); -function ChangeVolume(voldelta: integer): integer; +function ChangeVolume(voldelta: LongInt): LongInt; implementation uses uMisc, uConsole; const chanTPU = 12; var Mus: PMixMusic; - Volume: integer; + Volume: LongInt; procedure InitSound; begin @@ -83,7 +83,7 @@ end; procedure PlaySound(snd: TSound; infinite: boolean); -var loops: integer; +var loops: LongInt; begin if not isSoundEnabled then exit; if infinite then loops:= -1 else loops:= 0; @@ -104,7 +104,7 @@ Mix_PlayMusic(Mus, -1) end; -function ChangeVolume(voldelta: integer): integer; +function ChangeVolume(voldelta: LongInt): LongInt; begin if not isSoundEnabled then exit(0); diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uStore.pas Sat Jan 27 14:18:33 2007 +0000 @@ -24,17 +24,17 @@ procedure StoreInit; procedure StoreLoad; procedure StoreRelease; -procedure DrawGear(Stuff : TStuff; X, Y: integer; Surface: PSDL_Surface); -procedure DrawSpriteFromRect(r: TSDL_Rect; X, Y, Height, Position: integer; Surface: PSDL_Surface); -procedure DrawSprite (Sprite: TSprite; X, Y, Frame: integer; Surface: PSDL_Surface); -procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: integer; Surface: PSDL_Surface); -procedure DrawSurfSprite(X, Y, Height, Frame: integer; Source, Surface: PSDL_Surface); -procedure DrawLand (X, Y: integer; Surface: PSDL_Surface); -procedure DXOutText(X, Y: Integer; Font: THWFont; s: string; Surface: PSDL_Surface); -procedure DrawCaption(X, Y: integer; Rect: TSDL_Rect; Surface: PSDL_Surface); -procedure DrawCentered(X, Top: integer; Source, Surface: PSDL_Surface); -procedure DrawFromStoreRect(X, Y: integer; Rect: PSDL_Rect; Surface: PSDL_Surface); -procedure DrawHedgehog(X, Y: integer; Dir: integer; Pos, Step: LongWord; Surface: PSDL_Surface); +procedure DrawGear(Stuff : TStuff; X, Y: LongInt; Surface: PSDL_Surface); +procedure DrawSpriteFromRect(r: TSDL_Rect; X, Y, Height, Position: LongInt; Surface: PSDL_Surface); +procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt; Surface: PSDL_Surface); +procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt; Surface: PSDL_Surface); +procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source, Surface: PSDL_Surface); +procedure DrawLand (X, Y: LongInt; Surface: PSDL_Surface); +procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface); +procedure DrawCaption(X, Y: LongInt; Rect: TSDL_Rect; Surface: PSDL_Surface); +procedure DrawCentered(X, Top: LongInt; Source, Surface: PSDL_Surface); +procedure DrawFromStoreRect(X, Y: LongInt; Rect: PSDL_Rect; Surface: PSDL_Surface); +procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Surface: PSDL_Surface); function RenderString(s: string; Color: Longword; font: THWFont): PSDL_Surface; procedure RenderHealth(var Hedgehog: THedgehog); procedure AddProgress; @@ -59,7 +59,7 @@ TryDo(SDL_SetColorKey( StoreSurface, SDL_SRCCOLORKEY or SDL_RLEACCEL, 0) = 0, errmsgTransparentSet, true); end; -procedure LoadToSurface(Filename: String; Surface: PSDL_Surface; X, Y: integer); +procedure LoadToSurface(Filename: String; Surface: PSDL_Surface; X, Y: LongInt); var tmpsurf: PSDL_Surface; rr: TSDL_Rect; begin @@ -95,7 +95,7 @@ SDL_FillRect(Surface, @r, FillColor) end; -function WriteInRoundRect(Surface: PSDL_Surface; X, Y: integer; Color: LongWord; Font: THWFont; s: string): TSDL_Rect; +function WriteInRoundRect(Surface: PSDL_Surface; X, Y: LongInt; Color: LongWord; Font: THWFont; s: string): TSDL_Rect; var w, h: LongInt; tmpsurf: PSDL_Surface; clr: TSDL_Color; @@ -132,9 +132,9 @@ procedure WriteNames(Font: THWFont); var Team: PTeam; - i: integer; + i: LongInt; r, rr: TSDL_Rect; - drY: integer; + drY: LongInt; begin r.x:= 0; r.y:= 272; @@ -186,7 +186,7 @@ procedure InitHealth; var p: PTeam; - i: integer; + i: LongInt; begin p:= TeamsList; while p <> nil do @@ -200,7 +200,7 @@ procedure LoadGraves; var p: PTeam; - l: integer; + l: LongInt; begin p:= TeamsList; l:= 512; @@ -235,7 +235,7 @@ procedure GetExplosionBorderColor; var f: textfile; - c: integer; + c: LongInt; begin s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename; WriteToConsole(msgLoading + s + ' '); @@ -319,7 +319,7 @@ {$ENDIF} end; -procedure DrawFromRect(X, Y: integer; r: PSDL_Rect; SourceSurface, DestSurface: PSDL_Surface); +procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceSurface, DestSurface: PSDL_Surface); var rr: TSDL_Rect; begin rr.x:= X; @@ -333,24 +333,24 @@ end; end; -procedure DrawGear(Stuff: TStuff; X, Y: integer; Surface: PSDL_Surface); +procedure DrawGear(Stuff: TStuff; X, Y: LongInt; Surface: PSDL_Surface); begin DrawFromRect(X, Y, @StuffPoz[Stuff], StoreSurface, Surface) end; -procedure DrawSpriteFromRect(r: TSDL_Rect; X, Y, Height, Position: integer; Surface: PSDL_Surface); +procedure DrawSpriteFromRect(r: TSDL_Rect; X, Y, Height, Position: LongInt; Surface: PSDL_Surface); begin r.y:= r.y + Height * Position; r.h:= Height; DrawFromRect(X, Y, @r, StoreSurface, Surface) end; -procedure DrawSprite (Sprite: TSprite; X, Y, Frame: integer; Surface: PSDL_Surface); +procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt; Surface: PSDL_Surface); begin DrawSurfSprite(X, Y, SpritesData[Sprite].Height, Frame, SpritesData[Sprite].Surface, Surface) end; -procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: integer; Surface: PSDL_Surface); +procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt; Surface: PSDL_Surface); var r: TSDL_Rect; begin r.x:= FrameX * SpritesData[Sprite].Width; @@ -360,7 +360,7 @@ DrawFromRect(X, Y, @r, SpritesData[Sprite].Surface, Surface) end; -procedure DrawSurfSprite(X, Y, Height, Frame: integer; Source, Surface: PSDL_Surface); +procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source, Surface: PSDL_Surface); var r: TSDL_Rect; begin r.x:= 0; @@ -370,7 +370,7 @@ DrawFromRect(X, Y, @r, Source, Surface) end; -procedure DXOutText(X, Y: Integer; Font: THWFont; s: string; Surface: PSDL_Surface); +procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface); var clr: TSDL_Color; tmpsurf: PSDL_Surface; r: TSDL_Rect; @@ -390,23 +390,23 @@ SDL_FreeSurface(tmpsurf) end; -procedure DrawLand(X, Y: integer; Surface: PSDL_Surface); +procedure DrawLand(X, Y: LongInt; Surface: PSDL_Surface); const r: TSDL_Rect = (x: 0; y: 0; w: 2048; h: 1024); begin DrawFromRect(X, Y, @r, LandSurface, Surface) end; -procedure DrawFromStoreRect(X, Y: integer; Rect: PSDL_Rect; Surface: PSDL_Surface); +procedure DrawFromStoreRect(X, Y: LongInt; Rect: PSDL_Rect; Surface: PSDL_Surface); begin DrawFromRect(X, Y, Rect, StoreSurface, Surface) end; -procedure DrawCaption(X, Y: integer; Rect: TSDL_Rect; Surface: PSDL_Surface); +procedure DrawCaption(X, Y: LongInt; Rect: TSDL_Rect; Surface: PSDL_Surface); begin DrawFromRect(X - (Rect.w) div 2, Y, @Rect, StoreSurface, Surface) end; -procedure DrawCentered(X, Top: integer; Source, Surface: PSDL_Surface); +procedure DrawCentered(X, Top: LongInt; Source, Surface: PSDL_Surface); var r: TSDL_Rect; begin r.x:= X - Source^.w div 2; @@ -416,7 +416,7 @@ SDL_UpperBlit(Source, nil, Surface, @r) end; -procedure DrawHedgehog(X, Y: integer; Dir: integer; Pos, Step: LongWord; Surface: PSDL_Surface); +procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Surface: PSDL_Surface); var r: TSDL_Rect; begin r.x:= Step * 32; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uTeams.pas Sat Jan 27 14:18:33 2007 +0000 @@ -44,15 +44,15 @@ ExtDriven: boolean; Binds: TBinds; Hedgehogs: array[0..cMaxHHIndex] of THedgehog; - CurrHedgehog: integer; + CurrHedgehog: LongInt; NameTag: PSDL_Surface; CrosshairSurf: PSDL_Surface; GraveRect, HealthRect: TSDL_Rect; GraveName: string; FortName: string; - TeamHealth: integer; - TeamHealthBarWidth: integer; - DrawHealthY: integer; + TeamHealth: LongInt; + TeamHealthBarWidth: LongInt; + DrawHealthY: LongInt; AttackBar: LongWord; HedgehogsNumber: byte; end; @@ -74,7 +74,7 @@ implementation uses uMisc, uWorld, uAI, uLocale, uConsole; -const MaxTeamHealth: integer = 0; +const MaxTeamHealth: LongInt = 0; procedure FreeTeamsList; forward; @@ -117,7 +117,7 @@ procedure SwitchHedgehog; var tteam: PTeam; - th: integer; + th: LongInt; g: PGear; begin FreeActionsList; @@ -211,8 +211,8 @@ procedure InitTeams; var p: PTeam; - i: integer; - th: integer; + i: LongInt; + th: LongInt; begin p:= TeamsList; while p <> nil do @@ -281,7 +281,7 @@ end; procedure RecountTeamHealth(team: PTeam); -var i: integer; +var i: LongInt; begin with team^ do begin @@ -312,7 +312,7 @@ end; procedure SetWeapon(weap: TAmmoType); -var t: integer; +var t: LongInt; begin t:= cMaxSlotAmmoIndex; with CurrentTeam^ do @@ -326,7 +326,7 @@ procedure SendStats; var p: PTeam; - i: integer; + i: LongInt; msd: Longword; msdhh: PHedgehog; begin msd:= 0; msdhh:= nil; diff -r c75410fe3133 -r 731ad6d27bd1 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sat Jan 27 14:06:29 2007 +0000 +++ b/hedgewars/uWorld.pas Sat Jan 27 14:18:33 2007 +0000 @@ -20,18 +20,18 @@ interface uses SDLh, uGears, uConsts, uFloat; {$INCLUDE options.inc} -const WorldDx: integer = -512; - WorldDy: integer = -256; +const WorldDx: LongInt = -512; + WorldDy: LongInt = -256; procedure InitWorld; -procedure DrawWorld(Lag: integer; Surface: PSDL_Surface); +procedure DrawWorld(Lag: LongInt; Surface: PSDL_Surface); procedure AddCaption(s: string; Color: Longword; Group: TCapGroup); {$IFDEF COUNTTICKS} var cntTicks: LongWord; {$ENDIF} var FollowGear: PGear = nil; - WindBarWidth: integer = 0; + WindBarWidth: LongInt = 0; bShowAmmoMenu: boolean = false; bSelected: boolean = false; bShowFinger: boolean = false; @@ -50,9 +50,9 @@ EndTime: LongWord; end; -var cWaterSprCount: integer; +var cWaterSprCount: LongInt; Captions: array[TCapGroup] of TCaptionStr; - AMxLeft, AMxCurr, SlotsNum: integer; + AMxLeft, AMxCurr, SlotsNum: LongInt; fpsSurface: PSDL_Surface; procedure InitWorld; @@ -70,8 +70,8 @@ procedure ShowAmmoMenu(Surface: PSDL_Surface); const MENUSPEED = 15; -var x, y, i, t: integer; - Slot, Pos: integer; +var x, y, i, t: LongInt; + Slot, Pos: LongInt; begin if (TurnTimeLeft = 0) or KbdKeyPressed then bShowAmmoMenu:= false; if bShowAmmoMenu then @@ -116,7 +116,7 @@ t:= 0; while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do begin - DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, integer(Ammo^[i, t].AmmoType), Surface); + DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType), Surface); if (Slot = i) and (CursorPoint.X >= x + t * 33 + 35) and (CursorPoint.X < x + t * 33 + 68) then begin DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0, Surface); @@ -150,16 +150,16 @@ procedure MoveCamera; forward; -procedure DrawWorld(Lag: integer; Surface: PSDL_Surface); -var i, t: integer; +procedure DrawWorld(Lag: LongInt; Surface: PSDL_Surface); +var i, t: LongInt; r: TSDL_Rect; team: PTeam; tdx, tdy: Double; grp: TCapGroup; s: string[15]; - procedure DrawRepeated(spr: TSprite; Shift: integer); - var i, w: integer; + procedure DrawRepeated(spr: TSprite; Shift: LongInt); + var i, w: LongInt; begin w:= SpritesData[spr].Width; i:= Shift mod w; @@ -379,7 +379,7 @@ procedure MoveCamera; const PrevSentPointTime: LongWord = 0; -var EdgesDist: integer; +var EdgesDist: LongInt; begin if not (CurrentTeam^.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y); if (FollowGear <> nil) then