From 7d61a98f807803a337fd12342c29eb0f5f69fc76 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Dec 2007 03:33:14 +0000 Subject: 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 --- Game/Code/Classes/UPlatformLinux.pas | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'Game/Code/Classes/UPlatformLinux.pas') 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. -- cgit v1.2.3