--- oup/rewrite/Global/RawList.pas 2007/02/20 20:43:29 101 +++ oup/current/Global/RawList.pas 2007/03/23 03:07:58 124 @@ -1,7 +1,5 @@ unit RawList; - interface - uses TypeDefs; type @@ -17,6 +15,7 @@ type private FRawListHandlers: TRawListHandlers; public + property RawListHandlers: TRawListHandlers read FRawListHandlers; procedure InsertRawListHandler(ext: String; needed: Boolean; handler: THandler); function GetRawList(ConnectionID, FileID: Integer): TRawDataList; function GetRawInfo(ConnectionID, FileID, DatOffset: Integer): TRawDataInfo; @@ -141,8 +140,6 @@ function SUBT(ConnectionID, FileID: Inte var baselink, lastlink: Integer; links: Integer; - j, k: Integer; -// Data: TByteData; Data: TStream; begin ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $18, 4, @baselink); @@ -314,20 +311,41 @@ var x, y: Word; storetype: Byte; datasize: Integer; + mipmap: Byte; + bpp: Byte; + minside: Byte; begin + ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $88, SizeOf(mipmap), @mipmap); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $8C, SizeOf(x), @x); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $8E, SizeOf(y), @y); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $90, SizeOf(storetype), @storetype); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $9C, 4, @link_pc); ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $A0, 4, @link_mac); + + + minside := 1; case storetype of 0, 1, 2: - datasize := x * y * 2; + bpp := 16; 8: - datasize := x * y * 4; + bpp := 32; 9: - datasize := x * y div 2; + begin + bpp := 4; + minside := 4; + end; end; + + datasize := (x * y * bpp) div 8; + if (mipmap and $01) > 0 then + begin + repeat + x := x div 2; + y := y div 2; + datasize := datasize + (x * y * bpp) div 8; + until (x = minside) or (y = minside); + end; + SetLength(Result, 1); if ConManager.Connection[ConnectionID].DataOS = DOS_WIN then begin