Ignore:
Timestamp:
Dec 25, 2023, 11:35:51 AM (11 months ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Help.pas

    r503 r506  
    462462  ySrc := (iix div 7 + 1) * ySizeBig;
    463463  PaintPtr := TPixelPointer.Create(OffScreen, ScaleToNative(x0), ScaleToNative(y0));
    464   CoalPtr := TPixelPointer.Create(Templates.Data, ScaleToNative(xCoal), ScaleToNative(yCoal));
     464  CoalPtr := TPixelPointer.Create(Templates.Data, ScaleToNative(xCoal),
     465    ScaleToNative(yCoal));
    465466  for dy := -1 to 1 do
    466467    ImpPtr[dy] := TPixelPointer.Create(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc));
     
    476477          for dy := -1 to 1 do begin
    477478            ImpPtr[dy].SetX(xx);
    478             if ((Y + ScaleToNative(dy)) shr 1 < 0) or ((Y + ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or
    479               ((X + ScaleToNative(dx)) shr 1 < 0) or ((X + ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or
     479            if ((Y + ScaleToNative(dy)) shr 1 < 0) or
     480              ((Y + ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or
     481              ((X + ScaleToNative(dx)) shr 1 < 0) or
     482              ((X + ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or
    480483              ((Y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and
    481               (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 +
    482               ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(Y + ScaleToNative(dy))) shr 1]) then
     484              (ImpPtr[dy].PixelB shl 16 + ImpPtr[dy].PixelG shl 8 +
     485              ImpPtr[dy].PixelR = Heaven[(ScaleFromNative(Y + ScaleToNative(dy))) shr 1]) then
    483486              Sum := Sum + 9 * 255
    484487            else
    485               Sum := Sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 *
    486                 ImpPtr[dy].Pixel^.R;
     488              Sum := Sum + ImpPtr[dy].PixelB + 5 * ImpPtr[dy].PixelG + 3 *
     489                ImpPtr[dy].PixelR;
    487490          end;
    488491        end;
    489492        if Sum < MaxSum then begin // No saturation
    490           Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.Pixel^.B * 2);
    491           PaintPtr.Pixel^.B := Min(PaintPtr.Pixel^.B * Sum shr 22, 255);
    492           PaintPtr.Pixel^.G := Min(PaintPtr.Pixel^.G * Sum shr 22, 255);
    493           PaintPtr.Pixel^.R := Min(PaintPtr.Pixel^.R * Sum shr 22, 255);
     493          Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.PixelB * 2);
     494          PaintPtr.PixelB := Min(PaintPtr.PixelB * Sum shr 22, 255);
     495          PaintPtr.PixelG := Min(PaintPtr.PixelG * Sum shr 22, 255);
     496          PaintPtr.PixelR := Min(PaintPtr.PixelR * Sum shr 22, 255);
    494497        end;
    495498        PaintPtr.NextPixel;
Note: See TracChangeset for help on using the changeset viewer.