35 function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; |
34 function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; |
36 function pfsEOF(f: PFSFile): boolean; |
35 function pfsEOF(f: PFSFile): boolean; |
37 |
36 |
38 function pfsExists(fname: shortstring): boolean; |
37 function pfsExists(fname: shortstring): boolean; |
39 |
38 |
40 function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhysfsLibName; |
39 function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName; |
41 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhysfsLibName; |
40 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName; |
42 |
41 |
43 implementation |
42 implementation |
44 uses uUtils, uVariables, sysutils; |
43 uses uUtils, uVariables, sysutils; |
45 |
44 |
46 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; |
45 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; |
47 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; |
46 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; |
48 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl ; external PhysfsLibName; |
47 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl ; external PhyslayerLibName; |
49 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhysfsLibName; |
48 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
50 |
49 |
51 function PHYSFS_mount(newDir, mountPoint: PChar; appendToPath: LongBool) : LongInt; cdecl; external PhysfsLibName; |
50 function PHYSFS_mount(newDir, mountPoint: PChar; appendToPath: LongBool) : LongInt; cdecl; external PhysfsLibName; |
52 function PHYSFS_openRead(fname: PChar): PFSFile; cdecl; external PhysfsLibName; |
51 function PHYSFS_openRead(fname: PChar): PFSFile; cdecl; external PhysfsLibName; |
53 function PHYSFS_eof(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
52 function PHYSFS_eof(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
54 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName; |
53 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName; |
55 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
54 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
56 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName; |
55 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName; |
57 |
56 |
58 procedure hedgewarsMountPackages(); cdecl; external PhysfsLibName; |
57 procedure hedgewarsMountPackages(); cdecl; external PhyslayerLibName; |
59 |
58 |
60 function rwopsOpenRead(fname: shortstring): PSDL_RWops; |
59 function rwopsOpenRead(fname: shortstring): PSDL_RWops; |
61 begin |
60 begin |
62 exit(PHYSFSRWOPS_openRead(Str2PChar(fname))); |
61 exit(PHYSFSRWOPS_openRead(Str2PChar(fname))); |
63 end; |
62 end; |