Changeset 346 for trunk/LocalPlayer/Help.pas
- Timestamp:
- Apr 6, 2021, 7:19:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Help.pas
r331 r346 111 111 procedure WaterSign(x0, y0, iix: Integer); 112 112 procedure Search(SearchString: string); 113 procedure OnScroll(var m: TMessage); message WM_VSCROLL;113 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 114 114 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 115 115 public … … 351 351 end; 352 352 353 procedure THelpDlg.OnScroll(var m: TMessage);353 procedure THelpDlg.OnScroll(var Msg: TMessage); 354 354 begin 355 355 { TODO: Handled by MouseWheel event 356 if ScrollBar.Process( m) then begin356 if ScrollBar.Process(Msg) then begin 357 357 Sel := -1; 358 358 SmartUpdateContent(true) … … 452 452 MaxSum = 9 * 9 * 255 * 75 div 100; 453 453 var 454 x, y, dx, dy, xSrc, ySrc, sum, xx: integer;454 x, y, dx, dy, xSrc, ySrc, Sum, xx: integer; 455 455 Heaven: array [0..nHeaven] of integer; 456 PaintPtr, CoalPtr: TPixelPointer; 456 PaintPtr: TPixelPointer; 457 CoalPtr: TPixelPointer; 457 458 ImpPtr: array [-1..1] of TPixelPointer; 458 459 begin … … 466 467 xSrc := iix mod 7 * xSizeBig; 467 468 ySrc := (iix div 7 + 1) * ySizeBig; 468 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do 469 PaintPtr := PixelPointer(OffScreen, ScaleToNative(x0), ScaleToNative(y0)); 470 CoalPtr := PixelPointer(Templates.Data, ScaleToNative(xCoal), ScaleToNative(yCoal)); 471 for dy := -1 to 1 do 472 ImpPtr[dy] := PixelPointer(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc)); 473 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin 469 474 if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin 470 PaintPtr := PixelPointer(OffScreen, 0, ScaleToNative(y0) + y);471 CoalPtr := PixelPointer(Templates.Data, 0, ScaleToNative(yCoal) + y);472 475 for dy := -1 to 1 do 473 476 if ((Max(y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(y + ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then 474 ImpPtr[dy] := PixelPointer(BigImp, 0, ScaleToNative(ySrc) + (Max(y + ScaleToNative(dy), 0) shr 1));475 for x := 0 to ScaleToNative(xSizeBig ) * 2- 1 do begin476 sum := 0;477 ImpPtr[dy].SetXY(0, Max(y + ScaleToNative(dy), 0) shr 1); 478 for x := 0 to ScaleToNative(xSizeBig * 2) - 1 do begin 479 Sum := 0; 477 480 for dx := -1 to 1 do begin 478 xx := ScaleToNative(xSrc) +Max((x + ScaleToNative(dx)), 0) shr 1;481 xx := Max((x + ScaleToNative(dx)), 0) shr 1; 479 482 for dy := -1 to 1 do begin 480 483 ImpPtr[dy].SetX(xx); … … 483 486 ((y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and 484 487 (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 + 485 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y ) + dy) shr 1]) then486 sum := sum + 9 * 255488 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y + ScaleToNative(dy))) shr 1]) then 489 Sum := Sum + 9 * 255 487 490 else 488 sum := sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 *491 Sum := Sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 * 489 492 ImpPtr[dy].Pixel^.R; 490 493 end; 491 494 end; 492 if sum < MaxSum then begin // no saturation 493 CoalPtr.SetX(ScaleToNative(xCoal) + x); 494 sum := 1 shl 22 - (MaxSum - sum) * (256 - CoalPtr.Pixel^.B * 2); 495 PaintPtr.SetX(x0 + x); 496 PaintPtr.Pixel^.B := PaintPtr.Pixel^.B * sum shr 22; 497 PaintPtr.Pixel^.G := PaintPtr.Pixel^.G * sum shr 22; 498 PaintPtr.Pixel^.R := PaintPtr.Pixel^.R * sum shr 22; 495 if Sum < MaxSum then begin // no saturation 496 Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.Pixel^.B * 2); 497 PaintPtr.Pixel^.B := Min(PaintPtr.Pixel^.B * Sum shr 22, 255); 498 PaintPtr.Pixel^.G := Min(PaintPtr.Pixel^.G * Sum shr 22, 255); 499 PaintPtr.Pixel^.R := Min(PaintPtr.Pixel^.R * Sum shr 22, 255); 499 500 end; 501 PaintPtr.NextPixel; 502 CoalPtr.NextPixel; 500 503 end; 501 504 end; 505 PaintPtr.NextLine; 506 CoalPtr.NextLine; 507 end; 502 508 Offscreen.EndUpdate; 503 509 BigImp.EndUpdate;
Note:
See TracChangeset
for help on using the changeset viewer.