--- oup/current/Global/RawList.pas 2007/04/01 15:40:16 146 +++ oup/current/Global/RawList.pas 2007/05/12 13:22:11 177 @@ -116,7 +116,7 @@ var datasize: Integer; begin SetLength(Result, 1); - if ConManager.Connection[ConnectionID].DataOS = DOS_MAC then + if ConManager.Connection[ConnectionID].DataOS in [DOS_MACBETA, DOS_MAC] then begin ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @datasize); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $14, 4, @link); @@ -141,45 +141,41 @@ var baselink, lastlink: Integer; links: Integer; Data: TStream; + read: Integer; + char: Byte; + foundzeros: Byte; begin + SetLength(Result, 0); + ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $18, 4, @baselink); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @links); if links > 0 then begin ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + (links - 1) * 4, 4, @lastlink); -// SetLength(Data, lastlink + 1024); Data := nil; TAccess_OniArchive(ConManager.Connection[ConnectionID]).LoadRawOffset( False, baselink, lastlink + 1024, Data); -// TOniDataDat(connection).LoadRawOffset(False, baselink, lastlink + 1024, Data); - // connection.LoadRawFile(fileid,$1C,baselink,lastlink+1024,False,@data[0]); - raise ENotImplemented.Create('RawList.SUBT'); - end; -{ - k := 0; - for j := 0 to 1024 do - begin - if (Data[lastlink + j] = $00) or (j = 1024) then + Data.Seek(lastlink, soFromBeginning); + + foundzeros := 0; + repeat + read := Data.Read(char, 1); + if (read > 0) and (char = 0) then begin - if j < 1024 then - begin - if k = 0 then - begin - k := 1; - end - else - begin - SetLength(Result, 1); - Result[0].src_offset := $18; - Result[0].raw_addr := baselink; - Result[0].raw_size := lastlink + j; - Break; - end; - end; + Inc(foundzeros); end; + until (read = 0) or (foundzeros = 2); + + if foundzeros = 2 then + begin + SetLength(Result, 1); + Result[0].SrcID := FileID; + Result[0].SrcOffset := $18; + Result[0].RawAddr := baselink; + Result[0].RawSize := Data.Position; + Result[0].LocSep := False; end; end; -} end; @@ -195,20 +191,26 @@ var templ: Integer; Data: TByteData; offset: Word; - frame_count: Byte; + frame_count: Integer; begin SetLength(Result, 13); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $16C, 2, @frames); - {y-pos} + {x-z-pos} ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $0C, 4, @link); Result[0].SrcOffset := $0C; Result[0].RawAddr := link; - Result[0].RawSize := frames * 4; - {x-z-pos} + if link > 0 then + Result[0].RawSize := frames * 4 + else + Result[0].RawSize := 0; + {y-pos} ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @link); Result[1].SrcOffset := $10; Result[1].RawAddr := link; - Result[1].RawSize := frames * 8; + if link > 0 then + Result[1].RawSize := frames * 8 + else + Result[1].RawSize := 0; {attacks} ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $182, 1, @tempb); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $14, 4, @link); @@ -226,7 +228,7 @@ begin ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @link); Result[4].SrcOffset := $1C; Result[4].RawAddr := link; - Result[4].RawSize := tempb * 8; + Result[4].RawSize := tempb * 12; {shortcut} ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $185, 1, @tempb); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20, 4, @link); @@ -424,7 +426,7 @@ end; initialization RawLists := TRawLists.Create; - RawLists.InsertRawListHandler('AGDB', False, AGDB); + RawLists.InsertRawListHandler('AGDB', True, AGDB); RawLists.InsertRawListHandler('AKVA', True, AKVA); RawLists.InsertRawListHandler('BINA', True, BINA); RawLists.InsertRawListHandler('OSBD', True, OSBD);