aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UPlatformWindows.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-01-12 12:31:43 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-01-12 12:31:43 +0000
commite74bd57c12f470257111c1c0530fb38f0fd34414 (patch)
treeea55446e8faa73e164d53521c108d748095a9f80 /Game/Code/Classes/UPlatformWindows.pas
parent79c5b96f49412541efdd51bca62ce5912b864c08 (diff)
downloadusdx-e74bd57c12f470257111c1c0530fb38f0fd34414.tar.gz
usdx-e74bd57c12f470257111c1c0530fb38f0fd34414.tar.xz
usdx-e74bd57c12f470257111c1c0530fb38f0fd34414.zip
bunch of smaller changes...
some changes to song loading... Record global changed to singleton object started implementing mic volume display in Settings-Record hope this dosnt break anything.. :P git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@789 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UPlatformWindows.pas59
1 files changed, 54 insertions, 5 deletions
diff --git a/Game/Code/Classes/UPlatformWindows.pas b/Game/Code/Classes/UPlatformWindows.pas
index 93e72e7a..d4ba757a 100644
--- a/Game/Code/Classes/UPlatformWindows.pas
+++ b/Game/Code/Classes/UPlatformWindows.pas
@@ -8,19 +8,30 @@ interface
{$I switches.inc}
-uses Classes, UPlatform;
+uses Classes,
+ UPlatform;
type
- TPlatformWindows = class(TPlatform)
+ TPlatformWindows = class( TInterfacedObject, IPlatform)
public
- Function DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; override;
- function TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; override;
+ 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;
end;
implementation
-uses SysUtils, Windows;
+uses SysUtils,
+ Windows,
+ Forms;
type
@@ -175,4 +186,42 @@ begin
FindCloseW(SR);
end;
+function TPlatformWindows.GetGamePath: WideString;
+begin
+ // Windows and Linux use this:
+ Result := ExtractFilePath(ParamStr(0));
+end;
+
+procedure TPlatformWindows.halt;
+begin
+ application.terminate;
+end;
+
+function TPlatformWindows.GetLogPath : WideString;
+begin
+ result := ExtractFilePath(ParamStr(0));
+end;
+
+function TPlatformWindows.GetGameSharedPath : WideString;
+begin
+ result := ExtractFilePath(ParamStr(0));
+end;
+
+function TPlatformWindows.GetGameUserPath : WideString;
+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.