- Timestamp:
- Mar 28, 2007, 2:57:53 AM (18 years ago)
- Location:
- oup/current
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Global/OniImgClass.pas
r127 r128 589 589 size: Integer; 590 590 x, y: Word; 591 bpp: Byte; 592 minside: Byte; 593 begin 594 minside := 1; 595 case Self.FStoreType of 596 9: 597 begin 598 bpp := 4; 599 minside := 4; 600 end; 601 0, 1, 2: 602 bpp := 16; 603 8: 604 bpp := 32; 591 592 function GetImgSize(w,h, storetype: Integer): Integer; 593 begin 594 case storetype of 595 0, 1, 2: 596 Result := w*h*2; 597 8: 598 Result := w*h*4; 599 9: 600 Result := Max(1, w div 4) * Max(1, h div 4) * 8; 605 601 else 606 Result := 0; 607 Exit; 608 end; 609 602 Result := -1; 603 end; 604 end; 605 606 begin 610 607 x := Self.FWidth; 611 608 y := Self.FHeight; 612 size := (x * y * bpp) div 8;609 size := GetImgSize(x, y, FStoreType); 613 610 if fading then 614 611 begin 615 612 repeat 616 x := x div 2; 617 y := y div 2; 618 size := size + (x * y * bpp) div 8; 619 until (x = minside) or (y = minside); 620 if FStoreType = 9 then 621 begin 622 repeat 623 x := x div 2; 624 y := y div 2; 625 size := size + (x * y * 16) div 8; 626 until (x = 1) or (y = 1); 627 end; 613 x := Max(x div 2, 1); 614 y := Max(y div 2, 1); 615 size := size + GetImgSize(x, y, FStoreType); 616 until (x = 1) and (y = 1); 628 617 end; 629 618 Result := size; -
oup/current/Global/RawList.pas
r127 r128 30 30 31 31 uses 32 Template, ConnectionManager, Access_OniArchive, Classes, SysUtils ;32 Template, ConnectionManager, Access_OniArchive, Classes, SysUtils, Math; 33 33 34 34 … … 313 313 datasize: Integer; 314 314 mipmap: Byte; 315 bpp: Byte; 316 minside: Byte; 315 316 function GetImgSize(w,h, storetype: Integer): Integer; 317 begin 318 case storetype of 319 0, 1, 2: 320 Result := w*h*2; 321 8: 322 Result := w*h*4; 323 9: 324 Result := Max(1, w div 4) * Max(1, h div 4) * 8; 325 else 326 Result := -1; 327 end; 328 end; 329 317 330 begin 318 331 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $88, SizeOf(mipmap), @mipmap); … … 324 337 325 338 326 minside := 1; 327 case storetype of 328 0, 1, 2: 329 bpp := 16; 330 8: 331 bpp := 32; 332 9: 333 begin 334 bpp := 4; 335 minside := 4; 336 end; 337 end; 338 339 datasize := (x * y * bpp) div 8; 339 datasize := GetImgSize(x, y, storetype); 340 340 if (mipmap and $01) > 0 then 341 341 begin 342 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; 343 x := Max(x div 2, 1); 344 y := Max(y div 2, 1); 345 datasize := datasize + GetImgSize(x, y, storetype); 346 until (x = 1) and (y = 1); 355 347 end; 356 348
Note:
See TracChangeset
for help on using the changeset viewer.