7959
|
1 |
unit uPhysFSLayer;
|
|
2 |
|
|
3 |
{$LINKLIB ../bin/libphysfs.a}
|
8022
|
4 |
{$LINKLIB ../bin/libphysfsrwops.a}
|
7959
|
5 |
|
|
6 |
interface
|
8022
|
7 |
uses SDLh;
|
7959
|
8 |
|
|
9 |
procedure initModule;
|
|
10 |
procedure freeModule;
|
|
11 |
|
8022
|
12 |
function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external;
|
|
13 |
function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external;
|
|
14 |
|
7959
|
15 |
implementation
|
8022
|
16 |
uses uUtils, uVariables;
|
7959
|
17 |
|
|
18 |
function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external;
|
|
19 |
function PHYSFS_deinit() : LongInt; cdecl; external;
|
|
20 |
|
7963
|
21 |
function PHYSFS_mount(newDir, mountPoint: PChar; appendToPath: LongBool) : LongInt; cdecl; external;
|
7959
|
22 |
|
|
23 |
procedure initModule;
|
|
24 |
begin
|
|
25 |
PHYSFS_init(Str2PChar(ParamStr(0)));
|
8022
|
26 |
|
|
27 |
PHYSFS_mount(Str2PChar(PathPrefix), nil, true);
|
|
28 |
PHYSFS_mount(Str2PChar(UserPathPrefix), nil, true);
|
7959
|
29 |
end;
|
|
30 |
|
|
31 |
procedure freeModule;
|
|
32 |
begin
|
|
33 |
PHYSFS_deinit;
|
|
34 |
end;
|
|
35 |
|
|
36 |
end.
|