ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/DataAccess/Access_OniArchive.pas
(Generate patch)

Comparing oup/current/DataAccess/Access_OniArchive.pas (file contents):
Revision 112 by alloc, Thu Feb 22 00:37:39 2007 UTC vs.
Revision 113 by alloc, Sun Feb 25 17:20:22 2007 UTC

# Line 33 | Line 33 | type
33      procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TStream); overload; override;
34      procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; override;
35  
36 +    function GetDatLinks(FileID: Integer): TDatLinkList; override;
37      function GetRawList(FileID: Integer): TRawDataList; override;
38      function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override;
39  
# Line 59 | Line 60 | uses
60  
61  
62   constructor TAccess_OniArchive.Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages);
62 const
63  header_ident1_pc: array[0..$13] of Byte =
64    ($1F, $27, $DC, $33, $DF, $BC, $03, $00, $31, $33, $52, $56, $40, $00,
65    $14, $00, $10, $00, $08, $00);
66  header_ident1_mac: array[0..$13] of Byte =
67    ($61, $30, $C1, $23, $DF, $BC, $03, $00, $31, $33, $52, $56, $40, $00,
68    $14, $00, $10, $00, $08, $00);
69  header_ident1_macbeta: array[0..$13] of Byte =
70    ($81, $11, $8D, $23, $DF, $BC, $03, $00, $31, $33, $52, $56, $40, $00,
71    $14, $00, $10, $00, $08, $00);
72  header_ident2: array[0..$F] of Byte =
73    ($99, $CF, $40, $00, $90, $4F, $63, $00, $F4, $55, $5F, $00, $90, $4F, $63, $00);
63   var
64    i: Integer;
65    header_pc, header_mac, header_macbeta: Boolean;
# Line 93 | Line 82 | begin
82    header_pc  := True;
83    header_mac := True;
84    header_macbeta := True;
85 <  for i := 0 to High(Fdat_header.Ident) do
85 >  for i := 0 to High(Fdat_header.GlobalIdent) do
86 >    if Fdat_header.GlobalIdent[i] <> HeaderGlobalIdent[i] then
87 >    begin
88 >      Msg := SM_IncompatibleFile;
89 >      Exit;
90 >    end;
91 >
92 >  for i := 0 to High(Fdat_header.OSIdent) do
93    begin
94 < //    FLevelInfo.Ident[i] := Fdat_header.Ident[i];
99 <    if Fdat_header.Ident[i] <> header_ident1_pc[i] then
94 >    if Fdat_header.OSIdent[i] <> HeaderOSIdentWin[i] then
95        header_pc := False;
96 <    if Fdat_header.Ident[i] <> header_ident1_mac[i] then
96 >    if Fdat_header.OSIdent[i] <> HeaderOSIdentMac[i] then
97        header_mac := False;
98 <    if Fdat_header.Ident[i] <> header_ident1_macbeta[i] then
98 >    if Fdat_header.OSIdent[i] <> HeaderOSIdentMacBeta[i] then
99        header_macbeta := False;
100    end;
101    if not (header_pc xor header_mac xor header_macbeta) then
# Line 258 | Line 253 | begin
253        end;
254      end;
255    end;
256 <  Result := TStringList.Create;
256 >  if not Assigned(Result) then
257 >    Result := TStringList.Create;
258    if list.Count > 0 then
259    begin
260      fields := TStringList.Create;
# Line 294 | Line 290 | function TAccess_OniArchive.GetExtension
290   var
291    i: Integer;
292   begin
293 <  Result := TStringList.Create;
293 >  if not Assigned(Result) then
294 >    Result := TStringList.Create;
295 >  if Result is TStringList then
296 >    TStringList(Result).Sorted := True;
297    for i := 0 to Length(Fdat_extensionsmap) - 1 do
298    begin
299      with Fdat_extensionsmap[i] do

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)