hedgewars/uPhysFSLayer.pas
changeset 12122 cc2d2f910d5a
parent 11832 f2ab65d97242
child 12855 1b2b84315d27
child 13506 36f3f77e9b1b
equal deleted inserted replaced
12121:1dbdf05b01ee 12122:cc2d2f910d5a
    56 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName;
    56 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName;
    57 function PHYSFS_writeBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName;
    57 function PHYSFS_writeBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName;
    58 function PHYSFS_seek(f: PFSFile; pos: QWord): LongBool; cdecl; external PhysfsLibName;
    58 function PHYSFS_seek(f: PFSFile; pos: QWord): LongBool; cdecl; external PhysfsLibName;
    59 function PHYSFS_flush(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    59 function PHYSFS_flush(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    60 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    60 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
       
    61 function PHYSFS_setBuffer(f: PFSFile; pos: QWord): LongBool; cdecl; external PhysfsLibName;
    61 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName;
    62 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName;
    62 function PHYSFS_mkdir(path: PChar): LongBool; cdecl; external PhysfsLibName;
    63 function PHYSFS_mkdir(path: PChar): LongBool; cdecl; external PhysfsLibName;
    63 function PHYSFS_getLastError(): PChar; cdecl; external PhysfsLibName;
    64 function PHYSFS_getLastError(): PChar; cdecl; external PhysfsLibName;
    64 function PHYSFS_enumerateFiles(dir: PChar): PPChar; cdecl; external PhysfsLibName;
    65 function PHYSFS_enumerateFiles(dir: PChar): PPChar; cdecl; external PhysfsLibName;
    65 procedure PHYSFS_freeList(list: PPChar); cdecl; external PhysfsLibName;
    66 procedure PHYSFS_freeList(list: PPChar); cdecl; external PhysfsLibName;
    79 begin
    80 begin
    80     exit(PHYSFSRWOPS_openWrite(Str2PChar(fname)));
    81     exit(PHYSFSRWOPS_openWrite(Str2PChar(fname)));
    81 end;
    82 end;
    82 
    83 
    83 function pfsOpenRead(fname: shortstring): PFSFile;
    84 function pfsOpenRead(fname: shortstring): PFSFile;
    84 begin
    85 var f: PFSFile;
    85     exit(PHYSFS_openRead(Str2PChar(fname)));
    86 begin
       
    87     f:= PHYSFS_openRead(Str2PChar(fname));
       
    88     if f <> nil then
       
    89         PHYSFS_setBuffer(f, 4096);
       
    90     exit(f);
    86 end;
    91 end;
    87 
    92 
    88 function pfsOpenWrite(fname: shortstring): PFSFile;
    93 function pfsOpenWrite(fname: shortstring): PFSFile;
    89 begin
    94 begin
    90     exit(PHYSFS_openWrite(Str2PChar(fname)));
    95     exit(PHYSFS_openWrite(Str2PChar(fname)));