ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Global/RawList.pas
(Generate patch)

Comparing oup/current/Global/RawList.pas (file contents):
Revision 109 by alloc, Wed Feb 21 03:12:33 2007 UTC vs.
Revision 127 by alloc, Fri Mar 23 17:14:40 2007 UTC

# Line 1 | Line 1
1   unit RawList;
2
2   interface
4
3   uses TypeDefs;
4  
5   type
# Line 142 | Line 140 | function SUBT(ConnectionID, FileID: Inte
140   var
141    baselink, lastlink: Integer;
142    links: Integer;
145  j, k:  Integer;
146 //  Data:  TByteData;
143    Data:  TStream;
144   begin
145    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $18, 4, @baselink);
# Line 315 | Line 311 | var
311    x, y:      Word;
312    storetype: Byte;
313    datasize:  Integer;
314 +  mipmap:    Byte;
315 +  bpp:       Byte;
316 +  minside:   Byte;
317   begin
318 +  ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $88, SizeOf(mipmap), @mipmap);
319    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $8C, SizeOf(x), @x);
320    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $8E, SizeOf(y), @y);
321    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $90, SizeOf(storetype), @storetype);
322    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $9C, 4, @link_pc);
323    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $A0, 4, @link_mac);
324 +
325 +
326 +  minside := 1;
327    case storetype of
328      0, 1, 2:
329 <      datasize := x * y * 2;
329 >      bpp := 16;
330      8:
331 <      datasize := x * y * 4;
331 >      bpp := 32;
332      9:
333 <      datasize := x * y div 2;
333 >    begin
334 >      bpp := 4;
335 >      minside := 4;
336 >    end;
337    end;
338 +
339 +  datasize := (x * y * bpp) div 8;
340 +  if (mipmap and $01) > 0 then
341 +  begin
342 +    repeat
343 +      x    := x div 2;
344 +      y    := y div 2;
345 +      datasize := datasize + (x * y * bpp) div 8;
346 +    until (x = minside) or (y = minside);
347 +    if storetype = 9 then
348 +    begin
349 +      repeat
350 +        x    := x div 2;
351 +        y    := y div 2;
352 +        datasize := datasize + (x * y * 16) div 8;
353 +      until (x = 1) or (y = 1);
354 +    end;
355 +  end;
356 +
357    SetLength(Result, 1);
358    if ConManager.Connection[ConnectionID].DataOS = DOS_WIN then
359    begin

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)