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 113 by alloc, Sun Feb 25 17:20:22 2007 UTC vs.
Revision 124 by alloc, Fri Mar 23 03:07:58 2007 UTC

# Line 311 | 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 +  end;
348 +
349    SetLength(Result, 1);
350    if ConManager.Connection[ConnectionID].DataOS = DOS_WIN then
351    begin

Diff Legend

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