Changeset 245 for trunk/LocalPlayer/Help.pas
- Timestamp:
- May 21, 2020, 7:58:42 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Help.pas
r206 r245 441 441 const 442 442 nHeaven = 28; 443 maxsum = 9 * 9 * 255 * 75 div 100;443 MaxSum = 9 * 9 * 255 * 75 div 100; 444 444 var 445 445 x, y, dx, dy, xSrc, ySrc, sum, xx: integer; … … 457 457 xSrc := iix mod 7 * xSizeBig; 458 458 ySrc := (iix div 7 + 1) * ySizeBig; 459 for y := 0 to ySizeBig* 2 - 1 do460 if (( y0 + y) >= 0) and ((y0 + y) < InnerHeight) then begin461 PaintPtr := PixelPointer(OffScreen, 0, y0+ y);462 CoalPtr := PixelPointer(Templates, 0, yCoal+ y);459 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do 460 if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin 461 PaintPtr := PixelPointer(OffScreen, 0, ScaleToNative(y0) + y); 462 CoalPtr := PixelPointer(Templates, 0, ScaleToNative(yCoal) + y); 463 463 for dy := -1 to 1 do 464 if ((Max(y + dy, 0) shr 1) >= 0) and ((Max(y + dy, 0) shr 1) < ySizeBig) then465 ImpPtr[dy] := PixelPointer(BigImp, 0, ySrc + (Max(y + dy, 0) shr 1));466 for x := 0 to xSizeBig* 2 - 1 do begin464 if ((Max(y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(y + ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then 465 ImpPtr[dy] := PixelPointer(BigImp, 0, ScaleToNative(ySrc) + (Max(y + ScaleToNative(dy), 0) shr 1)); 466 for x := 0 to ScaleToNative(xSizeBig) * 2 - 1 do begin 467 467 sum := 0; 468 468 for dx := -1 to 1 do begin 469 xx := xSrc + Max((x + dx), 0) shr 1;469 xx := ScaleToNative(xSrc) + Max((x + ScaleToNative(dx)), 0) shr 1; 470 470 for dy := -1 to 1 do begin 471 471 ImpPtr[dy].SetX(xx); 472 if ((y + dy) shr 1 < 0) or ((y + dy) shr 1 >= ySizeBig) or473 ((x + dx) shr 1 < 0) or ((x + dx) shr 1 >= xSizeBig) or474 ((y + dy) shr 1 < nHeaven) and472 if ((y + ScaleToNative(dy)) shr 1 < 0) or ((y + ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or 473 ((x + ScaleToNative(dx)) shr 1 < 0) or ((x + ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or 474 ((y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and 475 475 (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 + 476 ImpPtr[dy].Pixel^.R = Heaven[( y+ dy) shr 1]) then476 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y) + dy) shr 1]) then 477 477 sum := sum + 9 * 255 478 478 else … … 481 481 end; 482 482 end; 483 if sum < maxsum then begin // no saturation484 CoalPtr.SetX( xCoal+ x);485 sum := 1 shl 22 - ( maxsum - sum) * (256 - CoalPtr.Pixel^.B * 2);483 if sum < MaxSum then begin // no saturation 484 CoalPtr.SetX(ScaleToNative(xCoal) + x); 485 sum := 1 shl 22 - (MaxSum - sum) * (256 - CoalPtr.Pixel^.B * 2); 486 486 PaintPtr.SetX(x0 + x); 487 487 PaintPtr.Pixel^.B := PaintPtr.Pixel^.B * sum shr 22;
Note:
See TracChangeset
for help on using the changeset viewer.