Index: oup/current/Global/OniImgClass.pas
===================================================================
--- oup/current/Global/OniImgClass.pas	(revision 117)
+++ oup/current/Global/OniImgClass.pas	(revision 118)
@@ -20,5 +20,4 @@
     function ResizeImage(oldx, oldy: Integer; img: TByteData): TByteData;
     procedure RevertImage;
-    procedure DecodeImage;
     procedure DecompressImage;
   protected
@@ -38,4 +37,6 @@
     function LoadFromTXMB(ConnectionID, FileID: Integer): Boolean;
     function GetImageDataSize(fading: Boolean): Integer;
+
+    procedure DecodeImageTo32bit;
 
     procedure GetAsData(var Target: TStream); overload;
@@ -132,5 +133,5 @@
 
 
-procedure TOniImage.DecodeImage;
+procedure TOniImage.DecodeImageTo32bit;
 var
   x, y:  Integer;
@@ -371,5 +372,5 @@
   txmpimg := TOniImage.Create;
   txmpimg.LoadFromTXMP(ConnectionID, PSpc.TXMP);
-  txmpimg.DecodeImage;
+  txmpimg.DecodeImageTo32bit;
 //  txmpimg.WriteToBMP('C:\file.bmp');
   txmpimg.GetAs32bit(txmpdata);
@@ -536,5 +537,5 @@
     images_decoded[i] := TOniImage.Create;
     images_decoded[i].LoadFromTXMP(ConnectionID, link);
-    images_decoded[i].DecodeImage;
+    images_decoded[i].DecodeImageTo32bit;
     images_decoded[i].RevertImage;
   end;
@@ -604,5 +605,5 @@
   x    := Self.FWidth;
   y    := Self.FHeight;
-  size := x * y * bpp div 8;
+  size := (x * y * bpp) div 8;
   if fading then
   begin
@@ -610,5 +611,5 @@
       x    := x div 2;
       y    := y div 2;
-      size := size + x * y * bpp div 8;
+      size := (size + x * y * bpp) div 8;
     until (x = 1) or (y = 1);
   end;
@@ -655,5 +656,5 @@
 begin
   if not (DT_Decoded32 in Self.FDataType) then
-    Self.DecodeImage;
+    Self.DecodeImageTo32bit;
   if not Assigned(Target) then
     Target := TMemoryStream.Create;
@@ -684,5 +685,5 @@
 begin
   if not (DT_Decoded32 in Self.FDataType) then
-    Self.DecodeImage;
+    Self.DecodeImageTo32bit;
 
   SetLength(Target, Self.FWidth * Self.FHeight * 3 + 54);
Index: oup/current/Global/RawList.pas
===================================================================
--- oup/current/Global/RawList.pas	(revision 117)
+++ oup/current/Global/RawList.pas	(revision 118)
@@ -312,5 +312,8 @@
   storetype: Byte;
   datasize:  Integer;
-begin
+  mipmap:    Byte;
+  bpp:       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);
@@ -318,12 +321,28 @@
   ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $9C, 4, @link_pc);
   ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $A0, 4, @link_mac);
+
+
   case storetype of
     0, 1, 2:
-      datasize := x * y * 2;
+      bpp := 16;
+//      datasize := x * y * 2;
     8:
-      datasize := x * y * 4;
+      bpp := 32;
+//      datasize := x * y * 4;
     9:
-      datasize := x * y div 2;
-  end;
+      bpp := 4;
+//      datasize := x * y div 2;
+  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 = 1) or (y = 1);
+  end;
+
   SetLength(Result, 1);
   if ConManager.Connection[ConnectionID].DataOS = DOS_WIN then
Index: oup/current/Global/TypeDefs.pas
===================================================================
--- oup/current/Global/TypeDefs.pas	(revision 117)
+++ oup/current/Global/TypeDefs.pas	(revision 118)
@@ -76,9 +76,9 @@
 
   TRawDataInfo = record
-      SrcID:       Integer;
-      SrcOffset:   Integer;
-      RawAddr:     Integer;
-      RawSize:     Integer;
-      LocSep:      Boolean;
+      SrcID:         Integer;
+      SrcOffset:     Integer;
+      RawAddr:       Integer;
+      RawSize:       Integer;
+      LocSep:        Boolean;
   end;
   TRawDataList = array of TRawDataInfo;
