--- a/hedgewars/uPhysFSLayer.pas Sun Jan 15 19:35:41 2017 -0500
+++ b/hedgewars/uPhysFSLayer.pas Wed Jan 25 00:17:32 2017 +0300
@@ -58,6 +58,7 @@
function PHYSFS_seek(f: PFSFile; pos: QWord): LongBool; cdecl; external PhysfsLibName;
function PHYSFS_flush(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
+function PHYSFS_setBuffer(f: PFSFile; pos: QWord): LongBool; cdecl; external PhysfsLibName;
function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName;
function PHYSFS_mkdir(path: PChar): LongBool; cdecl; external PhysfsLibName;
function PHYSFS_getLastError(): PChar; cdecl; external PhysfsLibName;
@@ -81,8 +82,12 @@
end;
function pfsOpenRead(fname: shortstring): PFSFile;
+var f: PFSFile;
begin
- exit(PHYSFS_openRead(Str2PChar(fname)));
+ f:= PHYSFS_openRead(Str2PChar(fname));
+ if f <> nil then
+ PHYSFS_setBuffer(f, 4096);
+ exit(f);
end;
function pfsOpenWrite(fname: shortstring): PFSFile;