# HG changeset patch # User koda # Date 1336241099 -3600 # Node ID 0f60591f3a16e66616c849e51aa362031b826d8c # Parent f264ad9d89659a1ae36c59dc25b39b3a0922d148 old typed const moved to their proper unit diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uAI.pas Sat May 05 19:04:59 2012 +0100 @@ -42,6 +42,7 @@ ThinkThread: TThreadID; {$ENDIF} hasThread: LongInt; + StartTicks: Longword; procedure FreeActionsList; begin diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uAIActions.pas --- a/hedgewars/uAIActions.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uAIActions.pas Sat May 05 19:04:59 2012 +0100 @@ -67,6 +67,9 @@ implementation uses uAIMisc, uAI, uAmmos, uVariables, uCommands, uUtils, uDebug, uIO{$IFDEF TRACEAIACTIONS}, uConsole{$ENDIF}; +var PrevX: LongInt = 0; + timedelta: Longword = 0; + const ActionIdToStr: array[0..7] of string[16] = ( {aia_none} '', {aia_Left} 'left', diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uCommandHandlers.pas Sat May 05 19:04:59 2012 +0100 @@ -28,6 +28,8 @@ implementation uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions; +var prevGState: TGameState = gsConfirm; + procedure chGenCmd(var s: shortstring); begin case s[1] of diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uGears.pas Sat May 05 19:04:59 2012 +0100 @@ -61,6 +61,7 @@ uCommands, uUtils, uTextures, uRenderUtils, uGearsRender, uCaptions, uDebug, uLandTexture, uGearsHedgehog, uGearsUtils, uGearsList; +var skipFlag: boolean; procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); forward; //procedure AmmoFlameWork(Ammo: PGear); forward; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uGearsHedgehog.pas Sat May 05 19:04:59 2012 +0100 @@ -35,6 +35,8 @@ uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, uGearsUtils; +var GHStepTicks: LongWord = 0; + // Shouldn't more of this ammo switching stuff be moved to uAmmos ? function ChangeAmmo(HHGear: PGear): boolean; var slot, i: Longword; @@ -654,7 +656,7 @@ Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount else exit; - StepTicks:= 200; + GHStepTicks:= 200; exit end; @@ -712,7 +714,7 @@ StepSoundTimer:= cHHStepTicks; end; - StepTicks:= cHHStepTicks; + GHStepTicks:= cHHStepTicks; if PrevdX <> hwSign(Gear^.dX) then begin FollowGear:= Gear; @@ -1038,7 +1040,7 @@ end; if ((HHGear^.State and gstMoving) <> 0) -or (StepTicks = cHHStepTicks) +or (GHStepTicks = cHHStepTicks) or (CurAmmoGear <> nil) then // we are moving begin with Hedgehog^ do @@ -1116,18 +1118,18 @@ begin AddGearCI(HHGear); if wasJumping then - StepTicks:= 410 + GHStepTicks:= 410 else - StepTicks:= 95 + GHStepTicks:= 95 end; exit end; if not isInMultiShoot and (Hedgehog^.Gear <> nil) then begin - if StepTicks > 0 then - dec(StepTicks); - if (StepTicks = 0) then + if GHStepTicks > 0 then + dec(GHStepTicks); + if (GHStepTicks = 0) then HedgehogStep(HHGear) end end; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uGearsList.pas Sat May 05 19:04:59 2012 +0100 @@ -33,6 +33,8 @@ uTextures, uScript, uRenderUtils, uAI, uCollisions, uGearsRender, uGearsUtils; +var GCounter: LongWord = 0; // this doesn't get re-initialized, but should be harmless + procedure InsertGearToList(Gear: PGear); var tmp, ptmp: PGear; begin @@ -74,8 +76,8 @@ function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; var gear: PGear; begin -inc(Counter); -AddFileLog('AddGear: #' + inttostr(Counter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); +inc(GCounter); +AddFileLog('AddGear: #' + inttostr(GCounter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); New(gear); FillChar(gear^, sizeof(TGear), 0); @@ -91,7 +93,7 @@ gear^.CollisionIndex:= -1; gear^.Timer:= Timer; gear^.FlightTime:= 0; -gear^.uid:= Counter; +gear^.uid:= GCounter; gear^.SoundChannel:= -1; gear^.ImpactSound:= sndNone; gear^.nImpactSounds:= 0; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uIO.pas Sat May 05 19:04:59 2012 +0100 @@ -56,6 +56,7 @@ var IPCSock: PTCPSocket; fds: PSDLNet_SocketSet; isPonged: boolean; + SocketString: shortstring; headcmd: PCmd; lastcmd: PCmd; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uLand.pas Sat May 05 19:04:59 2012 +0100 @@ -33,6 +33,7 @@ uVariables, uUtils, uCommands, adler32, uDebug, uLandPainted, uTextures, uLandGenMaze, uLandOutline; +var digest: shortstring; procedure ColorizeLand(Surface: PSDL_Surface); var tmpsurf: PSDL_Surface; @@ -473,7 +474,6 @@ f: textfile; mapName: shortstring = ''; begin -isMap:= true; WriteLnToConsole('Loading land from file...'); AddProgress; tmpsurf:= LoadImage(UserPathz[ptMapCurrent] + '/map', ifAlpha or ifTransparent or ifIgnoreCaps); @@ -553,7 +553,6 @@ hasBorder:= false; LoadThemeConfig; - isMap:= false; // is this not needed any more? lets hope setlength sets also 0s //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uRender.pas --- a/hedgewars/uRender.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uRender.pas Sat May 05 19:04:59 2012 +0100 @@ -55,6 +55,8 @@ implementation uses uVariables; +var LastTint: LongWord = 0; + procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt); begin r.y:= r.y + Height * Position; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uStore.pas Sat May 05 19:04:59 2012 +0100 @@ -47,6 +47,7 @@ //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple); var MaxTextureSize: LongInt; + SDLPrimSurface: PSDL_Surface; {$IFDEF SDL13}SDLGLcontext: PSDL_GLContext;{$ENDIF} // cGPUVendor: TGPUVendor; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uTeams.pas Sat May 05 19:04:59 2012 +0100 @@ -40,6 +40,7 @@ uGearsUtils, uGearsList{$IFDEF SDL13}, uTouch{$ENDIF}; var MaxTeamHealth: LongInt; + GameOver: boolean; function CheckForWin: boolean; var AliveClan: PClan; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uUtils.pas --- a/hedgewars/uUtils.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uUtils.pas Sat May 05 19:04:59 2012 +0100 @@ -75,6 +75,7 @@ {$IFDEF DEBUGFILE} var f: textfile; {$ENDIF} +var CharArray: array[byte] of Char; // should this include "strtolower()" for the split string? procedure SplitBySpace(var a, b: shortstring); @@ -259,7 +260,6 @@ end; -var CharArray: array[byte] of Char; function Str2PChar(const s: shortstring): PChar; begin CharArray:= s; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uVariables.pas Sat May 05 19:04:59 2012 +0100 @@ -100,19 +100,9 @@ cGearScrEdgesDist: LongInt; // originally typed consts - CharArray: array[byte] of Char; - LastTint: Longword; - SocketString: shortstring; - VGCounter: Longword; - PrevX: LongInt; - timedelta: Longword; - StartTicks: Longword; - Counter: Longword; - StepTicks: LongWord; ExplosionBorderColor: LongWord; WaterOpacity: byte; SDWaterOpacity: byte; - prevGState: TGameState; GrayScale: Boolean; // originally from uConsts @@ -141,7 +131,6 @@ bBetweenTurns : boolean; bWaterRising : boolean; - //ShowCrosshair : boolean; This variable is inconvenient to set. Easier to decide when rendering CrosshairX : LongInt; CrosshairY : LongInt; CursorMovementX : LongInt; @@ -216,7 +205,6 @@ firebutton, jumpWidget, AMWidget : TOnScreenWidget; pauseButton, utilityWidget : TOnScreenWidget; {$ENDIF} - AMAnimType : LongInt; const @@ -2392,10 +2380,8 @@ LandDirty: TDirtyTag; hasBorder: boolean; hasGirders: boolean; - isMap: boolean; playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword; // idea is that a template can specify height/width. Or, a map, a height/width by the dimensions of the image. If the map has pixels near top of image, it triggers border. LandBackSurface: PSDL_Surface; - digest: shortstring; CurAmmoGear: PGear; lastGearByUID: PGear; GearsList: PGear; @@ -2406,7 +2392,6 @@ SuddenDeathDmg: Boolean; SpeechType: Longword; SpeechText: shortstring; - skipFlag: boolean; PlacingHogs: boolean; // a convenience flag to indicate placement of hogs is still in progress StepSoundTimer: LongInt; StepSoundChannel: LongInt; @@ -2422,7 +2407,6 @@ LocalTeam: LongInt; // last non-bot, non-extdriven clan first team LocalAmmo: LongInt; // last non-bot, non-extdriven clan's first team's ammo index, updated to next upcoming hog for per-hog-ammo CurMinAngle, CurMaxAngle: Longword; - GameOver: boolean; NextClan: boolean; FollowGear: PGear; @@ -2443,7 +2427,6 @@ bAFRRight: Boolean; - SDLPrimSurface: PSDL_Surface; PauseTexture, SyncTexture, ConfirmTexture: PTexture; @@ -2631,14 +2614,9 @@ vobSDVelocity:= 15; vobSDFallSpeed:= 250; - PrevX:= 0; - timedelta:= 0; - Counter:= 0; - StepTicks:= 0; ExplosionBorderColor:= $FF808080; WaterOpacity:= $80; SDWaterOpacity:= $80; - prevGState:= gsConfirm; GrayScale:= false; LuaGoals:= ''; diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uVisualGears.pas Sat May 05 19:04:59 2012 +0100 @@ -56,6 +56,7 @@ uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils, uStore, uUtils; const cExplFrameTicks = 110; +var VGCounter: LongWord; // For better maintainability the step handlers of visual gears are stored // in a separate file. diff -r f264ad9d8965 -r 0f60591f3a16 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sat May 05 18:10:41 2012 +0100 +++ b/hedgewars/uWorld.pas Sat May 05 19:04:59 2012 +0100 @@ -79,6 +79,7 @@ missionTimer: LongInt; stereoDepth: GLfloat; isFirstFrame: boolean; + AMAnimType: LongInt; const cStereo_Sky = 0.0500; cStereo_Horizon = 0.0250;