--- oup/current/FileClasses/TXMP.pas 2007/06/12 17:00:48 213 +++ oup/current/FileClasses/TXMP.pas 2007/06/12 20:31:54 215 @@ -7,10 +7,8 @@ uses type TFile_TXMP = class(TFile) - protected - procedure InitDatLinks; override; + public procedure InitDataFields; override; - procedure InitRawList; override; end; implementation @@ -107,73 +105,5 @@ begin end; -procedure TFile_TXMP.InitDatLinks; -begin - SetLength(FDatLinks, 2); - FDatLinks[0].SrcOffset := $94; - FDatLinks[0].DestID := GetDatLinkValue(FFileStream, $94); - FDatLinks[0].PosDestExts := '*'; - FDatLinks[1].SrcOffset := $98; - FDatLinks[1].DestID := GetDatLinkValue(FFileStream, $98); - FDatLinks[1].PosDestExts := 'TXMP'; -end; - - -procedure TFile_TXMP.InitRawList; -var - link_pc: Integer; - link_mac: Integer; - x, y: Word; - storetype: Byte; - datasize: Integer; - mipmap: Byte; - - function GetImgSize(w,h, storetype: Integer): Integer; - begin - case storetype of - 0, 1, 2: - Result := w*h*2; - 8: - Result := w*h*4; - 9: - Result := Max(1, w div 4) * Max(1, h div 4) * 8; - else - Result := -1; - end; - end; - -begin - ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $88, SizeOf(mipmap), @mipmap); - ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8C, SizeOf(x), @x); - ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8E, SizeOf(y), @y); - ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $90, SizeOf(storetype), @storetype); - ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $9C, 4, @link_pc); - ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $A0, 4, @link_mac); - - datasize := GetImgSize(x, y, storetype); - if (mipmap and $01) > 0 then - begin - repeat - x := Max(x div 2, 1); - y := Max(y div 2, 1); - datasize := datasize + GetImgSize(x, y, storetype); - until (x = 1) and (y = 1); - end; - - SetLength(FRawParts, 1); - if ConManager.Connection[FConnectionID].DataOS = DOS_WIN then - begin - FRawParts[0].SrcOffset := $9C; - FRawParts[0].RawAddr := link_pc; - end - else - begin - FRawParts[0].SrcOffset := $A0; - FRawParts[0].RawAddr := link_mac; - end; - FRawParts[0].RawSize := datasize; - FRawParts[0].LocSep := not (ConManager.Connection[FConnectionID].DataOS = DOS_WIN); -end; - end.