hedgewars/uPhysFSLayer.pas
branchphysfslayer
changeset 8052 845b5ae03841
parent 8046 4d3415927d2c
child 8062 abbcdf73327a
equal deleted inserted replaced
8049:133e22b5c410 8052:845b5ae03841
    35 function PHYSFS_openRead(fname: PChar): PFSFile; cdecl; external;
    35 function PHYSFS_openRead(fname: PChar): PFSFile; cdecl; external;
    36 function PHYSFS_eof(f: PFSFile): LongBool; cdecl; external;
    36 function PHYSFS_eof(f: PFSFile): LongBool; cdecl; external;
    37 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external;
    37 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external;
    38 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external;
    38 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external;
    39 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external;
    39 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external;
       
    40 
       
    41 procedure hedgewarsMountPackages(); cdecl; external;
    40 
    42 
    41 function rwopsOpenRead(fname: shortstring): PSDL_RWops;
    43 function rwopsOpenRead(fname: shortstring): PSDL_RWops;
    42 begin
    44 begin
    43     exit(PHYSFSRWOPS_openRead(Str2PChar(fname)));
    45     exit(PHYSFSRWOPS_openRead(Str2PChar(fname)));
    44 end;
    46 end;
   101 
   103 
   102     i:= PHYSFS_mount(Str2PChar(PathPrefix), nil, true);
   104     i:= PHYSFS_mount(Str2PChar(PathPrefix), nil, true);
   103     AddFileLog('[PhysFS] mount ' + PathPrefix + ': ' + inttostr(i));
   105     AddFileLog('[PhysFS] mount ' + PathPrefix + ': ' + inttostr(i));
   104     i:= PHYSFS_mount(Str2PChar(UserPathPrefix + '/Data'), nil, true);
   106     i:= PHYSFS_mount(Str2PChar(UserPathPrefix + '/Data'), nil, true);
   105     AddFileLog('[PhysFS] mount ' + UserPathPrefix + '/Data: ' + inttostr(i));
   107     AddFileLog('[PhysFS] mount ' + UserPathPrefix + '/Data: ' + inttostr(i));
       
   108 
       
   109     hedgewarsMountPackages;
   106 end;
   110 end;
   107 
   111 
   108 procedure freeModule;
   112 procedure freeModule;
   109 begin
   113 begin
   110     PHYSFS_deinit;
   114     PHYSFS_deinit;