hedgewars/uPhysFSLayer.pas
branchwebgl
changeset 8099 a7f02b902b6f
parent 8080 a6fc5396b3d6
child 8105 d088be5ecdcb
equal deleted inserted replaced
8096:453917e94e55 8099:a7f02b902b6f
    20 
    20 
    21 procedure initModule;
    21 procedure initModule;
    22 procedure freeModule;
    22 procedure freeModule;
    23 
    23 
    24 type PFSFile = pointer;
    24 type PFSFile = pointer;
       
    25 {$IFDEF PAS2C}
       
    26      Int64 = LongInt; //FIXME!!!!!!!!!
       
    27      LongBool = boolean;
       
    28 {$ENDIF}
    25 
    29 
    26 function rwopsOpenRead(fname: shortstring): PSDL_RWops;
    30 function rwopsOpenRead(fname: shortstring): PSDL_RWops;
    27 function rwopsOpenWrite(fname: shortstring): PSDL_RWops;
    31 function rwopsOpenWrite(fname: shortstring): PSDL_RWops;
    28 
    32 
    29 function pfsOpenRead(fname: shortstring): PFSFile;
    33 function pfsOpenRead(fname: shortstring): PFSFile;
    39 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhysfsLibName;
    43 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhysfsLibName;
    40 
    44 
    41 implementation
    45 implementation
    42 uses uUtils, uVariables;
    46 uses uUtils, uVariables;
    43 
    47 
       
    48 {$IFNDEF PAS2C}
       
    49 // pas2c unable to parse this section???
       
    50 
    44 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName;
    51 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName;
    45 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName;
    52 function PHYSFS_deinit: LongInt; cdecl; external PhysfsLibName;
    46 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl ; external PhysfsLibName;
    53 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external PhysfsLibName;
    47 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhysfsLibName;
    54 function PHYSFSRWOPS_openWrite(fname: PChar): PSDL_RWops; cdecl; external PhysfsLibName;
    48 
    55 
    49 function PHYSFS_mount(newDir, mountPoint: PChar; appendToPath: LongBool) : LongInt; cdecl; external PhysfsLibName;
    56 function PHYSFS_mount(newDir, mountPoint: PChar; appendToPath: LongBool) : LongInt; cdecl; external PhysfsLibName;
    50 function PHYSFS_openRead(fname: PChar): PFSFile; cdecl; external PhysfsLibName;
    57 function PHYSFS_openRead(fname: PChar): PFSFile; cdecl; external PhysfsLibName;
    51 function PHYSFS_eof(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    58 function PHYSFS_eof(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    52 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName;
    59 function PHYSFS_readBytes(f: PFSFile; buffer: pointer; len: Int64): Int64; cdecl; external PhysfsLibName;
    53 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    60 function PHYSFS_close(f: PFSFile): LongBool; cdecl; external PhysfsLibName;
    54 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName;
    61 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName;
    55 
    62 
    56 procedure hedgewarsMountPackages(); cdecl; external PhysfsLibName;
    63 procedure hedgewarsMountPackages; cdecl; external PhysfsLibName;
       
    64 
       
    65 (*****************************************************************)
    57 
    66 
    58 function rwopsOpenRead(fname: shortstring): PSDL_RWops;
    67 function rwopsOpenRead(fname: shortstring): PSDL_RWops;
    59 begin
    68 begin
    60     exit(PHYSFSRWOPS_openRead(Str2PChar(fname)));
    69     exit(PHYSFSRWOPS_openRead(Str2PChar(fname)));
    61 end;
    70 end;
   126 
   135 
   127 procedure freeModule;
   136 procedure freeModule;
   128 begin
   137 begin
   129     PHYSFS_deinit;
   138     PHYSFS_deinit;
   130 end;
   139 end;
       
   140 {$ENDIF}
   131 
   141 
   132 end.
   142 end.