# HG changeset patch # User koda # Date 1296570608 -3600 # Node ID 8ad0e23e6d63457424c92746513a3f2de3b45b1a # Parent 8163c9aaad0cc3be843d900734443b32f3fc9ecf addfilelog <3 debugfile diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/hwengine.pas Tue Feb 01 15:30:08 2011 +0100 @@ -201,9 +201,7 @@ {$ENDIF} var p: TPathType; s: shortstring; -{$IFDEF DEBUGFILE} i: LongInt; -{$ENDIF} begin {$IFDEF HWLIBRARY} cBits:= 32; @@ -233,11 +231,9 @@ initEverything(true); WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')'); -{$IFDEF DEBUGFILE} AddFileLog('Prefix: "' + PathPrefix +'"'); for i:= 0 to ParamCount do AddFileLog(inttostr(i) + ': ' + ParamStr(i)); -{$ENDIF} for p:= Succ(Low(TPathType)) to High(TPathType) do if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p]; diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uAI.pas Tue Feb 01 15:30:08 2011 +0100 @@ -41,10 +41,10 @@ procedure FreeActionsList; begin -{$IFDEF DEBUGFILE}AddFileLog('FreeActionsList called');{$ENDIF} +AddFileLog('FreeActionsList called'); if hasThread <> 0 then begin - {$IFDEF DEBUGFILE}AddFileLog('Waiting AI thread to finish');{$ENDIF} + AddFileLog('Waiting AI thread to finish'); StopThinking:= true; repeat SDL_Delay(10) @@ -323,7 +323,7 @@ FillBonuses((Me^.State and gstAttacked) <> 0); for a:= Low(TAmmoType) to High(TAmmoType) do CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(Me^.Hedgehog^, a); -{$IFDEF DEBUGFILE}AddFileLog('Enter Think Thread');{$ENDIF} +AddFileLog('Enter Think Thread'); BeginThread(@Think, Me, ThinkThread) end; diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uCommandHandlers.pas Tue Feb 01 15:30:08 2011 +0100 @@ -306,7 +306,7 @@ bShowFinger:= false; with CurrentHedgehog^.Gear^ do begin - {$IFDEF DEBUGFILE}AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));{$ENDIF} + AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State)); if ((State and gstHHDriven) <> 0) then begin FollowGear:= CurrentHedgehog^.Gear; @@ -347,9 +347,7 @@ TryDo(AllInactive, '/nextturn called when not all gears are inactive', true); if not CurrentTeam^.ExtDriven then SendIPC('N'); -{$IFDEF DEBUGFILE} AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks)); -{$ENDIF} end; procedure chTimer(var s: shortstring); diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uCommands.pas --- a/hedgewars/uCommands.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uCommands.pas Tue Feb 01 15:30:08 2011 +0100 @@ -60,7 +60,7 @@ if c in ['/', '$'] then Delete(CmdStr, 1, 1) else c:= '/'; s:= ''; SplitBySpace(CmdStr, s); -{$IFDEF DEBUGFILE}AddFileLog('[Cmd] ' + c + CmdStr + ' (' + inttostr(length(s)) + ')');{$ENDIF} +AddFileLog('[Cmd] ' + c + CmdStr + ' (' + inttostr(length(s)) + ')'); t:= Variables; while t <> nil do begin diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uConsole.pas Tue Feb 01 15:30:08 2011 +0100 @@ -52,7 +52,7 @@ done: boolean; begin {$IFNDEF NOCONSOLE} -{$IFDEF DEBUGFILE}AddFileLog('[Con] ' + s);{$ENDIF} +AddFileLog('[Con] ' + s); Write(s); done:= false; diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uDebug.pas --- a/hedgewars/uDebug.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uDebug.pas Tue Feb 01 15:30:08 2011 +0100 @@ -32,4 +32,4 @@ if not Assert then OutError(SDL_GetError, isFatal) end; -end. \ No newline at end of file +end. diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uFloat.pas Tue Feb 01 15:30:08 2011 +0100 @@ -352,9 +352,7 @@ function AngleSin(const Angle: Longword): hwFloat; begin -{$IFDEF DEBUGFILE} //TryDo((Angle >= 0) and (Angle <= 2048), 'Sin param exceeds limits', true); -{$ENDIF} AngleSin.isNegative:= false; if Angle < 1024 then AngleSin.QWordValue:= SinTable[Angle] else AngleSin.QWordValue:= SinTable[2048 - Angle] @@ -362,9 +360,7 @@ function AngleCos(const Angle: Longword): hwFloat; begin -{$IFDEF DEBUGFILE} //TryDo((Angle >= 0) and (Angle <= 2048), 'Cos param exceeds limits', true); -{$ENDIF} AngleCos.isNegative:= Angle > 1024; if Angle < 1024 then AngleCos.QWordValue:= SinTable[1024 - Angle] else AngleCos.QWordValue:= SinTable[Angle - 1024] diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uGears.pas Tue Feb 01 15:30:08 2011 +0100 @@ -182,9 +182,7 @@ var gear: PGear; begin inc(Counter); -{$IFDEF DEBUGFILE} AddFileLog('AddGear: #' + inttostr(Counter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); -{$ENDIF} New(gear); FillChar(gear^, sizeof(TGear), 0); @@ -602,9 +600,8 @@ Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16); end end; -{$IFDEF DEBUGFILE} -with Gear^ do AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); -{$ENDIF} +with Gear^ do + AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); if CurAmmoGear = Gear then CurAmmoGear:= nil; if FollowGear = Gear then FollowGear:= nil; @@ -1046,9 +1043,7 @@ end; end else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure begin - {$IFDEF DEBUGFILE} AddFileLog('Assigning hedgehog ' + inttostr(LongInt(AttackerHog)) + ' to gear ' + inttostr(Gear^.uid)); - {$ENDIF} Gear^.Hedgehog:= AttackerHog; end; inc(Gear^.Damage, Damage); @@ -1170,7 +1165,7 @@ i, cnt: LongInt; begin TargetPoint.X:= NoPointX; -{$IFDEF DEBUGFILE}if Radius > 4 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');{$ENDIF} +if Radius > 4 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')'); if Radius > 25 then KickFlakes(Radius, X, Y); if ((Mask and EXPLNoGfx) = 0) then @@ -1213,7 +1208,7 @@ if dmg > 1 then begin dmg:= ModifyDamage(min(dmg div 2, Radius), Gear); - //{$IFDEF DEBUGFILE}AddFileLog('Damage: ' + inttostr(dmg));{$ENDIF} + //AddFileLog('Damage: ' + inttostr(dmg)); if (Mask and EXPLNoDamage) = 0 then begin if not Gear^.Invulnerable then @@ -1775,9 +1770,7 @@ begin Gear^.X:= int2hwFloat(x); Gear^.Y:= int2hwFloat(y); - {$IFDEF DEBUGFILE} AddFileLog('Assigned Gear coordinates (' + inttostr(x) + ',' + inttostr(y) + ')'); - {$ENDIF} end else begin diff -r 8163c9aaad0c -r 8ad0e23e6d63 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Tue Feb 01 08:15:01 2011 +0100 +++ b/hedgewars/uIO.pas Tue Feb 01 15:30:08 2011 +0100 @@ -121,7 +121,7 @@ var loTicks: Word; begin case s[1] of - '!': begin {$IFDEF DEBUGFILE}AddFileLog('Ping? Pong!');{$ENDIF}isPonged:= true; end; + '!': begin AddFileLog('Ping? Pong!'); isPonged:= true; end; '?': SendIPC('!'); 'e': ParseCommand(copy(s, 2, Length(s) - 1), true); 'E': OutError(copy(s, 2, Length(s) - 1), true); @@ -136,7 +136,7 @@ else loTicks:= SDLNet_Read16(@s[byte(s[0]) - 1]); AddCmd(loTicks, s); - {$IFDEF DEBUGFILE}AddFileLog('[IPC in] '+s[1]+' ticks '+IntToStr(lastcmd^.loTime));{$ENDIF} + AddFileLog('[IPC in] '+s[1]+' ticks '+IntToStr(lastcmd^.loTime)); end end; @@ -217,7 +217,7 @@ SendEmptyPacketTicks:= 0; if s[0]>#251 then s[0]:= #251; SDLNet_Write16(GameTicks, @s[Succ(byte(s[0]))]); - {$IFDEF DEBUGFILE}AddFileLog('[IPC out] '+ s[1]);{$ENDIF} + AddFileLog('[IPC out] '+ s[1]); inc(s[0], 2); SDLNet_TCP_Send(IPCSock, @s, Succ(byte(s[0]))) end @@ -244,7 +244,7 @@ procedure SendIPCTimeInc; const timeinc: shortstring = '#'; begin -{$IFDEF DEBUGFILE}AddFileLog('[IPC out]