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 |