diff options
-rw-r--r-- | Game/Code/Classes/UPlatform.pas | 2 | ||||
-rw-r--r-- | Game/Code/Classes/UPlatformLinux.pas | 56 | ||||
-rw-r--r-- | Game/Code/Classes/UPlatformMacOSX.pas | 6 | ||||
-rw-r--r-- | Game/Code/Classes/UPlatformWindows.pas | 6 |
4 files changed, 9 insertions, 61 deletions
diff --git a/Game/Code/Classes/UPlatform.pas b/Game/Code/Classes/UPlatform.pas index bfb03d54..d3227611 100644 --- a/Game/Code/Classes/UPlatform.pas +++ b/Game/Code/Classes/UPlatform.pas @@ -29,7 +29,7 @@ type Function DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; function TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; function FindSongFile(Dir, Mask: widestring): widestring; - procedure halt; + procedure Halt; function GetLogPath : WideString; function GetGameSharedPath : WideString; function GetGameUserPath : WideString; 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; diff --git a/Game/Code/Classes/UPlatformMacOSX.pas b/Game/Code/Classes/UPlatformMacOSX.pas index 7b081607..789fc816 100644 --- a/Game/Code/Classes/UPlatformMacOSX.pas +++ b/Game/Code/Classes/UPlatformMacOSX.pas @@ -29,7 +29,7 @@ type public Function DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; function TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; - procedure halt(); + procedure Halt(); function GetLogPath : WideString; function GetGameSharedPath : WideString; function GetGameUserPath : WideString; @@ -122,9 +122,9 @@ begin end; -procedure TPlatformMacOSX.halt; +procedure TPlatformMacOSX.Halt; begin - halt; + System.Halt; end; function TPlatformMacOSX.FindSongFile(Dir, Mask: widestring): widestring; diff --git a/Game/Code/Classes/UPlatformWindows.pas b/Game/Code/Classes/UPlatformWindows.pas index a0192b57..18cbebcb 100644 --- a/Game/Code/Classes/UPlatformWindows.pas +++ b/Game/Code/Classes/UPlatformWindows.pas @@ -20,7 +20,7 @@ type function GetGamePath: WideString;
function FindSongFile(Dir, Mask: widestring): widestring;
- procedure halt;
+ procedure Halt;
function GetLogPath : WideString;
function GetGameSharedPath : WideString;
@@ -191,9 +191,9 @@ begin Result := ExtractFilePath(ParamStr(0));
end;
-procedure TPlatformWindows.halt;
+procedure TPlatformWindows.Halt;
begin
- halt(); // Application.terminate does NOT do the same thing..
+ System.Halt; // Application.terminate does NOT do the same thing..
end;
function TPlatformWindows.GetLogPath : WideString;
|