equal
deleted
inserted
replaced
29 function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; |
29 function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; |
30 function pfsEOF(f: PFSFile): boolean; |
30 function pfsEOF(f: PFSFile): boolean; |
31 |
31 |
32 function pfsExists(fname: shortstring): boolean; |
32 function pfsExists(fname: shortstring): boolean; |
33 |
33 |
|
34 {$IFNDEF PAS2C} |
34 function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName; |
35 function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName; |
35 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName; |
36 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName; |
36 procedure hedgewarsMountPackage(filename: PChar); cdecl; external PhyslayerLibName; |
37 procedure hedgewarsMountPackage(filename: PChar); cdecl; external PhyslayerLibName; |
|
38 {$ENDIF} |
37 |
39 |
38 implementation |
40 implementation |
39 uses uUtils, uVariables, sysutils; |
41 uses uUtils, uVariables, sysutils; |
40 |
42 |
|
43 {$IFNDEF PAS2C} |
41 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; |
44 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; |
42 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; |
45 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; |
43 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
46 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
44 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
47 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
45 |
48 |
50 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
53 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
51 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName; |
54 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName; |
52 function PHYSFS_getLastError(): PChar; cdecl; external PhysfsLibName; |
55 function PHYSFS_getLastError(): PChar; cdecl; external PhysfsLibName; |
53 |
56 |
54 procedure hedgewarsMountPackages(); cdecl; external PhyslayerLibName; |
57 procedure hedgewarsMountPackages(); cdecl; external PhyslayerLibName; |
|
58 {$ENDIF} |
55 |
59 |
56 function rwopsOpenRead(fname: shortstring): PSDL_RWops; |
60 function rwopsOpenRead(fname: shortstring): PSDL_RWops; |
57 begin |
61 begin |
58 exit(PHYSFSRWOPS_openRead(Str2PChar(fname))); |
62 exit(PHYSFSRWOPS_openRead(Str2PChar(fname))); |
59 end; |
63 end; |