From 329e2b8eabd0f4ecb6e6a9bdc66d595c988d399a Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 17 Jul 2008 16:46:58 +0000 Subject: - 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 --- Game/Code/Classes/UPlatformWindows.pas | 51 +++++++++++----------------------- 1 file changed, 16 insertions(+), 35 deletions(-) (limited to 'Game/Code/Classes/UPlatformWindows.pas') 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. -- cgit v1.2.3