Subversion Repositories spacemission

Rev

Rev 47 | Rev 54 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47 Rev 51
Line 7... Line 7...
7
  RasterW = 48;
7
  RasterW = 48;
8
  RasterH = 32;
8
  RasterH = 32;
9
  MaxPossibleEnemyLives = 999;
9
  MaxPossibleEnemyLives = 999;
10
  MaxPossibleLevels = 9999;
10
  MaxPossibleLevels = 9999;
11
  RegistrySettingsKey = 'SOFTWARE\ViaThinkSoft\SpaceMission\Settings';
11
  RegistrySettingsKey = 'SOFTWARE\ViaThinkSoft\SpaceMission\Settings';
-
 
12
  DefaultLevelLength = 1200;
12
 
13
 
13
type
14
type
14
  // DirectX\Music.dxm
15
  // DirectX\Music.dxm
15
  TSpaceMissionMusicTrack = (
16
  TSpaceMissionMusicTrack = (
16
    smmNone,
17
    smmNone,
Line 59... Line 60...
59
    smsLevIntro       // WaveList.Items.Item[7]
60
    smsLevIntro       // WaveList.Items.Item[7]
60
  );
61
  );
61
 
62
 
62
function OwnDirectory: string;
63
function OwnDirectory: string;
63
 
64
 
-
 
65
const
-
 
66
  FOLDERID_SavedGames: TGuid = '{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}';
-
 
67
 
-
 
68
function GetKnownFolderPath(const rfid: TGUID): string;
-
 
69
 
64
implementation
70
implementation
65
 
71
 
66
uses
72
uses
-
 
73
  SysUtils, ActiveX, ShlObj;
-
 
74
 
-
 
75
function GetKnownFolderPath(const rfid: TGUID): string;
-
 
76
var
-
 
77
  OutPath: PWideChar;
-
 
78
begin
-
 
79
  // https://www.delphipraxis.net/135471-unit-zur-verwendung-von-shgetknownfolderpath.html
-
 
80
  if ShGetKnownFolderPath(rfid, 0, 0, OutPath) {>= 0} = S_OK then
-
 
81
  begin
-
 
82
    Result := OutPath;
-
 
83
    // From MSDN
-
 
84
    // ppszPath [out]
-
 
85
    // Type: PWSTR*
-
 
86
    // When this method returns, contains the address of a pointer to a null-terminated Unicode string that specifies the path of the known folder
-
 
87
    // The calling process is responsible for freeing this resource once it is no longer needed by calling CoTaskMemFree.
-
 
88
    // The returned path does not include a trailing backslash. For example, "C:\Users" is returned rather than "C:\Users\".
-
 
89
    CoTaskMemFree(OutPath);
-
 
90
  end
67
  SysUtils;
91
  else
-
 
92
  begin
-
 
93
    Result := '';
-
 
94
  end;
-
 
95
end;
68
 
96
 
69
function OwnDirectory: string;
97
function OwnDirectory: string;
70
begin
98
begin
71
  result := extractfilepath(paramstr(0));
99
  result := extractfilepath(paramstr(0));
72
end;
100
end;