aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UTime.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-26 12:03:20 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-26 12:03:20 +0000
commitbbf6784e26b5f94c87c9deedb75711948d937f46 (patch)
tree61c758183bf12ee20677e21912c69e572bf00bd5 /Game/Code/Classes/UTime.pas
parent7968b0878c1c13f61dddbacb603e00997af38f63 (diff)
downloadusdx-bbf6784e26b5f94c87c9deedb75711948d937f46.tar.gz
usdx-bbf6784e26b5f94c87c9deedb75711948d937f46.tar.xz
usdx-bbf6784e26b5f94c87c9deedb75711948d937f46.zip
added "-debug" flag at run time and "CONSOLE" Define in switches.inc
also the default is to run with no debug info sent to the console git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@973 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UTime.pas51
1 files changed, 13 insertions, 38 deletions
diff --git a/Game/Code/Classes/UTime.pas b/Game/Code/Classes/UTime.pas
index 3b7749a2..2bc77a9c 100644
--- a/Game/Code/Classes/UTime.pas
+++ b/Game/Code/Classes/UTime.pas
@@ -5,14 +5,13 @@ interface
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
-{$I switches.inc}
-{$UNDEF DebugDisplay}
+{$I switches.inc}
type
TTime = class
constructor Create;
- function GetTime: real;
+ function GetTime: real;
end;
procedure CountSkipTimeSet;
@@ -20,18 +19,17 @@ procedure CountSkipTime;
procedure CountMidTime;
var
- USTime: TTime;
+ USTime : TTime;
- TimeNew: int64;
- TimeOld: int64;
- TimeSkip: real;
- TimeMid: real;
- TimeMidTemp: int64;
+ TimeNew : int64;
+ TimeOld : int64;
+ TimeSkip : real;
+ TimeMid : real;
+ TimeMidTemp : int64;
implementation
uses
-// sysutils,
sdl,
ucommon;
@@ -53,50 +51,27 @@ begin
CountSkipTimeSet;
end;
-
procedure CountSkipTimeSet;
begin
- TimeNew := SDL_GetTicks();
-
- {$IFDEF DebugDisplay}
- Writeln( 'CountSkipTimeSet : ' + inttostr(trunc(TimeNew)) );
- {$ENDIF}
+ TimeNew := SDL_GetTicks();
end;
-
procedure CountSkipTime;
begin
- TimeOld := TimeNew;
- TimeNew := SDL_GetTicks();
- TimeSkip := (TimeNew-TimeOld) / cSDLCorrectionRatio;
-
- {$IFDEF DebugDisplay}
- Writeln( 'TimeNew : ' + inttostr(trunc(TimeNew)) );
- Writeln( 'CountSkipTime : ' + inttostr(trunc(TimeSkip)) );
- {$ENDIF}
+ TimeOld := TimeNew;
+ TimeNew := SDL_GetTicks();
+ TimeSkip := (TimeNew-TimeOld) / cSDLCorrectionRatio;
end;
-
procedure CountMidTime;
begin
TimeMidTemp := SDL_GetTicks();
TimeMid := (TimeMidTemp - TimeNew) / cSDLCorrectionRatio;
-
- {$IFDEF DebugDisplay}
- Writeln( 'TimeNew : ' + inttostr(trunc(TimeNew)) );
- Writeln( 'CountMidTime : ' + inttostr(trunc(TimeMid)) );
- {$ENDIF}
end;
-
function TTime.GetTime: real;
begin
- Result := SDL_GetTicks() / cSDLCorrectionRatio;
-
- {$IFDEF DebugDisplay}
- Writeln( 'GetTime : ' + inttostr(trunc(Result)) );
- {$ENDIF}
+ Result := SDL_GetTicks() / cSDLCorrectionRatio;
end;
-
end.