diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-07-17 16:46:58 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-07-17 16:46:58 +0000 |
commit | 329e2b8eabd0f4ecb6e6a9bdc66d595c988d399a (patch) | |
tree | 0edc4be7cae34b876bc7cc2104c5d49f96b28c8a /Game/Code/Classes/UPlatformWindows.pas | |
parent | 9a393bf11f43ba649fa28c17408ea91c43c97a93 (diff) | |
download | usdx-329e2b8eabd0f4ecb6e6a9bdc66d595c988d399a.tar.gz usdx-329e2b8eabd0f4ecb6e6a9bdc66d595c988d399a.tar.xz usdx-329e2b8eabd0f4ecb6e6a9bdc66d595c988d399a.zip |
- UPlatformXYZ.pas clean-up
- TPlatform now implements common behaviour
- added TPlatform.Init()
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1207 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UPlatformWindows.pas | 51 |
1 files changed, 16 insertions, 35 deletions
diff --git a/Game/Code/Classes/UPlatformWindows.pas b/Game/Code/Classes/UPlatformWindows.pas index 3f9eb56b..eb4e4189 100644 --- a/Game/Code/Classes/UPlatformWindows.pas +++ b/Game/Code/Classes/UPlatformWindows.pas @@ -8,32 +8,30 @@ interface {$I switches.inc} -uses Classes, - UPlatform; +uses + Classes, + UPlatform; type - - TPlatformWindows = class( TInterfacedObject, IPlatform) - public - Function DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; - function TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; - function GetGamePath: WideString; - function FindSongFile(Dir, Mask: widestring): widestring; - - procedure Halt; - - function GetLogPath : WideString; - function GetGameSharedPath : WideString; - function GetGameUserPath : WideString; + TPlatformWindows = class(TPlatform) + private + function GetGamePath: WideString; + public + function DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; override; + function TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; override; + + function GetLogPath : WideString; override; + function GetGameSharedPath : WideString; override; + function GetGameUserPath : WideString; override; end; implementation -uses SysUtils, - Windows; +uses + SysUtils, + Windows; type - TSearchRecW = record Time: Integer; Size: Integer; @@ -191,11 +189,6 @@ begin Result := ExtractFilePath(ParamStr(0)); end; -procedure TPlatformWindows.Halt; -begin - System.Halt; // Application.terminate does NOT do the same thing.. -end; - function TPlatformWindows.GetLogPath : WideString; begin result := ExtractFilePath(ParamStr(0)); @@ -211,16 +204,4 @@ begin result := ExtractFilePath(ParamStr(0)); end; -function TPlatformWindows.FindSongFile(Dir, Mask: widestring): widestring; -var - SR: TSearchRec; // for parsing song directory -begin - Result := ''; - if SysUtils.FindFirst(Dir + Mask, faDirectory, SR) = 0 then begin - Result := SR.Name; - end; // if - SysUtils.FindClose(SR); -end; - - end. |