From 94b9441d2ec4fba0c65a25296f3693b727eea799 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 2 Jul 2008 08:23:35 +0000 Subject: indenting and cleanup git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1158 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/ULight.pas | 5 --- Game/Code/Classes/ULog.pas | 75 ++++++++++++++++++++++---------------------- 2 files changed, 38 insertions(+), 42 deletions(-) (limited to 'Game/Code/Classes') diff --git a/Game/Code/Classes/ULight.pas b/Game/Code/Classes/ULight.pas index a4bebfd2..a0a399ab 100644 --- a/Game/Code/Classes/ULight.pas +++ b/Game/Code/Classes/ULight.pas @@ -123,19 +123,14 @@ end; procedure TLight.Refresh; var Time: real; -// TimeSkip: real; L: integer; begin if Enabled then begin Time := GetTime; -// TimeSkip := Time - LastTime; for L := 0 to 7 do begin if Light[L] = true then begin if LightTime[L] > Time then begin - // jest jeszcze zapas - bez zmian - //LightTime[L] := LightTime[L] - TimeSkip; end else begin - // czas minal Light[L] := false; end; end; diff --git a/Game/Code/Classes/ULog.pas b/Game/Code/Classes/ULog.pas index 95502df8..8394d73e 100644 --- a/Game/Code/Classes/ULog.pas +++ b/Game/Code/Classes/ULog.pas @@ -190,51 +190,52 @@ begin end; end; - if BenchmarkFileOpened then - begin - Miliseconds := Trunc(Frac(BenchmarkTimeLength[Number]) * 1000); - Seconds := Trunc(BenchmarkTimeLength[Number]) mod 60; - Minutes := Trunc((BenchmarkTimeLength[Number] - Seconds) / 60); -// ValueText := FloatToStr(BenchmarkTimeLength[Number]); - -{ ValueText := FloatToStr( - SecondOf(BenchmarkTimeLength[Number]) + MilliSecondOf(BenchmarkTimeLength[Number])/1000 - ); - if MinuteOf(BenchmarkTimeLength[Number]) >= 1 then - ValueText := IntToStr(MinuteOf(BenchmarkTimeLength[Number])) + ':' + ValueText; - WriteLn(FileBenchmark, Text + ': ' + ValueText + ' seconds');} - - if (Minutes = 0) and (Seconds = 0) then begin - MilisecondsS := IntToStr(Miliseconds); - ValueText := MilisecondsS + ' miliseconds'; - end; + if BenchmarkFileOpened then + begin + Miliseconds := Trunc(Frac(BenchmarkTimeLength[Number]) * 1000); + Seconds := Trunc(BenchmarkTimeLength[Number]) mod 60; + Minutes := Trunc((BenchmarkTimeLength[Number] - Seconds) / 60); + //ValueText := FloatToStr(BenchmarkTimeLength[Number]); + + { + ValueText := FloatToStr(SecondOf(BenchmarkTimeLength[Number]) + + MilliSecondOf(BenchmarkTimeLength[Number])/1000); + if MinuteOf(BenchmarkTimeLength[Number]) >= 1 then + ValueText := IntToStr(MinuteOf(BenchmarkTimeLength[Number])) + ':' + ValueText; + WriteLn(FileBenchmark, Text + ': ' + ValueText + ' seconds'); + } + + if (Minutes = 0) and (Seconds = 0) then begin + MilisecondsS := IntToStr(Miliseconds); + ValueText := MilisecondsS + ' miliseconds'; + end; - if (Minutes = 0) and (Seconds >= 1) then begin - MilisecondsS := IntToStr(Miliseconds); - while Length(MilisecondsS) < 3 do - MilisecondsS := '0' + MilisecondsS; + if (Minutes = 0) and (Seconds >= 1) then begin + MilisecondsS := IntToStr(Miliseconds); + while Length(MilisecondsS) < 3 do + MilisecondsS := '0' + MilisecondsS; - SecondsS := IntToStr(Seconds); + SecondsS := IntToStr(Seconds); - ValueText := SecondsS + ',' + MilisecondsS + ' seconds'; - end; + ValueText := SecondsS + ',' + MilisecondsS + ' seconds'; + end; - if Minutes >= 1 then begin - MilisecondsS := IntToStr(Miliseconds); - while Length(MilisecondsS) < 3 do - MilisecondsS := '0' + MilisecondsS; + if Minutes >= 1 then begin + MilisecondsS := IntToStr(Miliseconds); + while Length(MilisecondsS) < 3 do + MilisecondsS := '0' + MilisecondsS; - SecondsS := IntToStr(Seconds); - while Length(SecondsS) < 2 do - SecondsS := '0' + SecondsS; + SecondsS := IntToStr(Seconds); + while Length(SecondsS) < 2 do + SecondsS := '0' + SecondsS; - MinutesS := IntToStr(Minutes); + MinutesS := IntToStr(Minutes); - ValueText := MinutesS + ':' + SecondsS + ',' + MilisecondsS + ' minutes'; - end; + ValueText := MinutesS + ':' + SecondsS + ',' + MilisecondsS + ' minutes'; + end; - WriteLn(BenchmarkFile, Text + ': ' + ValueText); - Flush(BenchmarkFile); + WriteLn(BenchmarkFile, Text + ': ' + ValueText); + Flush(BenchmarkFile); end; end; end; -- cgit v1.2.3