27 function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; |
27 function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; |
28 function pfsEOF(f: PFSFile): boolean; |
28 function pfsEOF(f: PFSFile): boolean; |
29 |
29 |
30 function pfsExists(fname: shortstring): boolean; |
30 function pfsExists(fname: shortstring): boolean; |
31 |
31 |
|
32 { $IFNDEF PAS2C} |
32 function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName; |
33 function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName; |
33 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName; |
34 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName; |
34 procedure hedgewarsMountPackage(filename: PChar); cdecl; external PhyslayerLibName; |
35 procedure hedgewarsMountPackage(filename: PChar); cdecl; external PhyslayerLibName; |
|
36 { $ENDIF} |
|
37 |
|
38 implementation |
|
39 uses uUtils, uVariables; |
35 |
40 |
36 {$IFNDEF PAS2C} |
41 {$IFNDEF PAS2C} |
37 //apparently pas2c doesn't render the functions below if it finds 'implementation' first |
|
38 implementation |
|
39 uses uUtils, uVariables, sysutils; |
|
40 {$ENDIF} |
|
41 |
|
42 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; |
42 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; |
43 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; |
43 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; |
44 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
44 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
45 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
45 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName; |
46 |
46 |
50 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName; |
50 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName; |
51 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
51 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName; |
52 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName; |
52 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName; |
53 |
53 |
54 procedure hedgewarsMountPackages(); cdecl; external PhyslayerLibName; |
54 procedure hedgewarsMountPackages(); cdecl; external PhyslayerLibName; |
55 |
|
56 {$IFDEF PAS2C} |
|
57 implementation |
|
58 uses uUtils, uVariables; |
|
59 {$ENDIF} |
55 {$ENDIF} |
60 |
56 |
61 (*****************************************************************) |
57 (*****************************************************************) |
62 |
58 |
63 function rwopsOpenRead(fname: shortstring): PSDL_RWops; |
59 function rwopsOpenRead(fname: shortstring): PSDL_RWops; |