Changeset 148 for oup/current/DataAccess
- Timestamp:
- Apr 1, 2007, 6:37:25 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OniArchive.pas
r116 r148 39 39 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; 40 40 41 procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer); 41 procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; var target: TStream); overload; 42 procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer); overload; 42 43 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; override; 43 44 procedure UpdateRawFile(FileID, DatOffset: Integer; Src: TStream); overload; override; … … 445 446 446 447 447 448 procedure TAccess_OniArchive.LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer); 449 begin 448 procedure TAccess_OniArchive.LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; var target: TStream); 449 begin 450 if not Assigned(Target) then 451 Target := TMemoryStream.Create; 450 452 if not LocSep then 451 453 begin … … 456 458 begin 457 459 Fraw_file.Seek(RawAddr, soFromBeginning); 458 Fraw_file.Read(target^, size); 460 Target.CopyFrom(Fraw_file, size); 461 Target.Seek(0, soFromBeginning); 459 462 end; 460 463 if UnloadWhenUnused then … … 474 477 begin 475 478 Fsep_file.Seek(RawAddr, soFromBeginning); 476 Fsep_file.Read(target^, size); 479 Target.CopyFrom(Fsep_file, size); 480 Target.Seek(0, soFromBeginning); 477 481 end; 478 482 if UnloadWhenUnused then … … 484 488 FSepOpened := True; 485 489 end; 490 end; 491 492 procedure TAccess_OniArchive.LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer); 493 var 494 data: TStream; 495 begin 496 data := nil; 497 LoadRawOffset(LocSep, RawAddr, Size, data); 498 data.Read(Target^, Size); 499 data.Free; 486 500 end; 487 501 … … 591 605 end; 592 606 607 593 608 procedure TAccess_OniArchive.UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream); 594 609 var
Note:
See TracChangeset
for help on using the changeset viewer.