diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-09-18 13:19:20 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-09-18 13:19:20 +0000 |
commit | 433a1b7339e2bf96f3b0bb4c98b8c799c6540027 (patch) | |
tree | a448ca19c45319152f3d9a33f53a419c59908ede /Game/Code/Classes/ULight.pas | |
parent | 067444c467e9f3e4dca07ecf10818023140c2873 (diff) | |
download | usdx-433a1b7339e2bf96f3b0bb4c98b8c799c6540027.tar.gz usdx-433a1b7339e2bf96f3b0bb4c98b8c799c6540027.tar.xz usdx-433a1b7339e2bf96f3b0bb4c98b8c799c6540027.zip |
changes in order to compile in lazarus...
minor tidy ups and removal of big old comment blocks..
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@394 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/ULight.pas | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Game/Code/Classes/ULight.pas b/Game/Code/Classes/ULight.pas index b9c7af9e..74681a85 100644 --- a/Game/Code/Classes/ULight.pas +++ b/Game/Code/Classes/ULight.pas @@ -36,6 +36,32 @@ uses zlportio,
{$ENDIF}
UTime;
+
+{$IFDEF FPC}
+ function GetTime: TDateTime;
+ {$IFDEF MSWINDOWS}
+ var
+ SystemTime: TSystemTime;
+ begin
+ GetLocalTime(SystemTime);
+ with SystemTime do
+ Result := EncodeTime(wHour, wMinute, wSecond, wMilliSeconds);
+ end;
+ {$ENDIF}
+ {$IFDEF LINUX}
+ var
+ T: TTime_T;
+ TV: TTimeVal;
+ UT: TUnixTime;
+ begin
+ gettimeofday(TV, nil);
+ T := TV.tv_sec;
+ localtime_r(@T, UT);
+ Result := EncodeTime(UT.tm_hour, UT.tm_min, UT.tm_sec, TV.tv_usec div 1000);
+ end;
+ {$ENDIF}
+{$ENDIF}
+
constructor TLight.Create;
begin
@@ -44,7 +70,7 @@ end; procedure TLight.Enable;
begin
- Enabled := true;
+ Enabled := true;
LastTime := GetTime;
end;
|