aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UPlatformLinux.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-12-20 03:33:14 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-12-20 03:33:14 +0000
commit7d61a98f807803a337fd12342c29eb0f5f69fc76 (patch)
treecbd759f06ca19ec49d95af10ea5362798d4d38a4 /Game/Code/Classes/UPlatformLinux.pas
parentcdfdd0ea3fa2eb92893db46c158cf61b7a9411d7 (diff)
downloadusdx-7d61a98f807803a337fd12342c29eb0f5f69fc76.tar.gz
usdx-7d61a98f807803a337fd12342c29eb0f5f69fc76.tar.xz
usdx-7d61a98f807803a337fd12342c29eb0f5f69fc76.zip
made USDX function when file paths differ from previous expectations..
( most of the software was still using hard coded paths ) also added ability to have multiple song directories. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@735 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UPlatformLinux.pas')
-rw-r--r--Game/Code/Classes/UPlatformLinux.pas38
1 files changed, 38 insertions, 0 deletions
diff --git a/Game/Code/Classes/UPlatformLinux.pas b/Game/Code/Classes/UPlatformLinux.pas
index 8119346e..03e04560 100644
--- a/Game/Code/Classes/UPlatformLinux.pas
+++ b/Game/Code/Classes/UPlatformLinux.pas
@@ -13,13 +13,20 @@ uses Classes, UPlatform;
type
TPlatformLinux = class(TPlatform)
+ function get_homedir(): string;
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
+ libc,
{$IFNDEF FPC_V220}
oldlinux,
{$ELSE}
@@ -113,4 +120,35 @@ begin
end;
{$ENDIF}
+
+function TPlatformLinux.GetLogPath : WideString;
+begin
+ result := '/var/log/UltraStarDeluxe/';
+end;
+
+function TPlatformLinux.GetGameSharedPath : WideString;
+begin
+ result := '/usr/share/UltraStarDeluxe/';
+end;
+
+function TPlatformLinux.GetGameUserPath : WideString;
+begin
+ result := get_homedir()+'/.UltraStarDeluxe/';
+end;
+
+function TPlatformLinux.get_homedir(): string;
+var
+ pPasswdEntry : Ppasswd;
+ lUserName : String;
+begin
+ pPasswdEntry := getpwuid( getuid() );
+ result := pPasswdEntry^.pw_dir;
+end;
+
+function TPlatformLinux.TerminateIfAlreadyRunning(var WndTitle : String) : Boolean;
+begin
+ // Linux and Mac don't check for running apps at the moment
+ Result := false;
+end;
+
end.