From ad4c54706eaab157d975f832aecc836adbef827c Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 3 May 2008 12:14:10 +0000 Subject: - fixed recursive calling of TPlatform.Halt. - removed oldlinux stuff git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1059 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UPlatformLinux.pas | 56 ++---------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'Game/Code/Classes/UPlatformLinux.pas') diff --git a/Game/Code/Classes/UPlatformLinux.pas b/Game/Code/Classes/UPlatformLinux.pas index ff4834fe..b323c608 100644 --- a/Game/Code/Classes/UPlatformLinux.pas +++ b/Game/Code/Classes/UPlatformLinux.pas @@ -38,23 +38,17 @@ implementation uses libc, uCommandLine, -{$IFDEF FPC_VERSION_2_2_0_PLUS} BaseUnix, -{$ELSE} - oldlinux, -{$ENDIF} SysUtils, ULog, UConfig; -{$IFDEF FPC_VERSION_2_2_0_PLUS} -Function TPlatformLinux.DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; +function TPlatformLinux.DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; var i : Integer; TheDir : pDir; ADirent : pDirent; Entry : Longint; - //info : oldlinux.stat; lAttrib : integer; begin i := 0; @@ -91,52 +85,6 @@ begin FpCloseDir(TheDir^); end; end; -{$ELSE} -Function TPlatformLinux.DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; -var - i : Integer; - TheDir : oldlinux.pdir; - ADirent : oldlinux.pDirent; - Entry : Longint; - info : oldlinux.stat; - lAttrib : integer; -begin - i := 0; - Filter := LowerCase(Filter); - - TheDir := oldlinux.opendir( Dir ); - if Assigned(TheDir) then - begin - repeat - ADirent := oldlinux.ReadDir(TheDir); - - If Assigned(ADirent) and (ADirent^.name <> '.') and (ADirent^.name <> '..') then - begin - lAttrib := FileGetAttr(Dir + ADirent^.name); - if ReturnAllSubDirs and ((lAttrib and faDirectory) <> 0) then - begin - SetLength( Result, i + 1); - Result[i].Name := ADirent^.name; - Result[i].IsDirectory := true; - Result[i].IsFile := false; - i := i + 1; - end - else if (Length(Filter) = 0) or (Pos( Filter, LowerCase(ADirent^.name)) > 0) then - begin - SetLength( Result, i + 1); - Result[i].Name := ADirent^.name; - Result[i].IsDirectory := false; - Result[i].IsFile := true; - i := i + 1; - end; - end; - until (ADirent = nil); - - oldlinux.CloseDir(TheDir); - end; -end; -{$ENDIF} - function TPlatformLinux.GetLogPath : WideString; begin @@ -198,7 +146,7 @@ end; // Maybe this should be TPlatformBase.Halt() procedure TPlatformLinux.Halt; begin - halt(); + System.Halt; end; function TPlatformLinux.TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; -- cgit v1.2.3