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 118 by alloc, Fri Mar 23 00:58:09 2007 UTC

# Line 311 | Line 311 | var
311    x, y:      Word;
312    storetype: Byte;
313    datasize:  Integer;
314 +  mipmap:    Byte;
315 +  bpp:       Byte;
316   begin
317 +  ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $88, SizeOf(mipmap), @mipmap);
318    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $8C, SizeOf(x), @x);
319    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $8E, SizeOf(y), @y);
320    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $90, SizeOf(storetype), @storetype);
321    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $9C, 4, @link_pc);
322    ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $A0, 4, @link_mac);
323 +
324 +
325    case storetype of
326      0, 1, 2:
327 <      datasize := x * y * 2;
327 >      bpp := 16;
328 > //      datasize := x * y * 2;
329      8:
330 <      datasize := x * y * 4;
330 >      bpp := 32;
331 > //      datasize := x * y * 4;
332      9:
333 <      datasize := x * y div 2;
333 >      bpp := 4;
334 > //      datasize := x * y div 2;
335    end;
336 +
337 +  datasize := (x * y * bpp) div 8;
338 +  if (mipmap and $01) > 0 then
339 +  begin
340 +    repeat
341 +      x    := x div 2;
342 +      y    := y div 2;
343 +      datasize := (datasize + x * y * bpp) div 8;
344 +    until (x = 1) or (y = 1);
345 +  end;
346 +
347    SetLength(Result, 1);
348    if ConManager.Connection[ConnectionID].DataOS = DOS_WIN then
349    begin

Diff Legend

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