Changeset 506 for trunk/LocalPlayer


Ignore:
Timestamp:
Dec 25, 2023, 11:35:51 AM (11 months ago)
Author:
chronos
Message:
Location:
trunk/LocalPlayer
Files:
5 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;
  • trunk/LocalPlayer/IsoEngine.pas

    r486 r506  
    266266        for Y := 0 to yyt * 3 - 1 do begin
    267267          MaskLine[Y].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + TSpriteSize[I].Left));
    268           if MaskLine[Y].Pixel^.B = 0 then Border := False;
     268          if MaskLine[Y].PixelB = 0 then Border := False;
    269269        end;
    270270        if Border then Inc(TSpriteSize[I].Left);
     
    275275        for X := 0 to xxt * 2 - 1 do begin
    276276          MaskLine[TSpriteSize[I].Top].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + X));
    277           if MaskLine[TSpriteSize[I].Top].Pixel^.B = 0 then Border := False;
     277          if MaskLine[TSpriteSize[I].Top].PixelB = 0 then Border := False;
    278278        end;
    279279        if Border then Inc(TSpriteSize[I].Top);
     
    284284        for Y := 0 to yyt * 3 - 1 do begin
    285285          MaskLine[Y].SetX(ScaleToNative(xSrc * (xxt * 2 + 1) + TSpriteSize[I].Right));
    286           if MaskLine[Y].Pixel^.B = 0 then Border := False;
     286          if MaskLine[Y].PixelB = 0 then Border := False;
    287287        end;
    288288        if Border then Dec(TSpriteSize[I].Right);
     
    293293        for X := 0 to xxt * 2 - 1 do begin
    294294          MaskLine[TSpriteSize[I].Bottom - 1].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + X));
    295           if MaskLine[TSpriteSize[I].Bottom - 1].Pixel^.B = 0 then Border := False;
     295          if MaskLine[TSpriteSize[I].Bottom - 1].PixelB = 0 then Border := False;
    296296        end;
    297297        if Border then Dec(TSpriteSize[I].Bottom);
     
    14041404begin
    14051405  for I := 0 to Length - 1 do begin
    1406     Line^.Pixel^.B := (Line^.Pixel^.B shr 1) and $7F;
    1407     Line^.Pixel^.G := (Line^.Pixel^.G shr 1) and $7F;
    1408     Line^.Pixel^.R := (Line^.Pixel^.R shr 1) and $7F;
     1406    Line^.PixelB := (Line^.PixelB shr 1) and $7F;
     1407    Line^.PixelG := (Line^.PixelG shr 1) and $7F;
     1408    Line^.PixelR := (Line^.PixelR shr 1) and $7F;
    14091409    Line^.NextPixel;
    14101410  end;
  • trunk/LocalPlayer/MessgEx.pas

    r505 r506  
    267267            (yDst + dy < hScrewed) then begin
    268268              Screwed[xDst + dx, yDst + dy, 0] := Screwed[xDst + dx, yDst + dy, 0]
    269                 + Share * SrcPtr.Pixel^.B;
     269                + Share * SrcPtr.PixelB;
    270270              Screwed[xDst + dx, yDst + dy, 1] := Screwed[xDst + dx, yDst + dy, 1]
    271                 + Share * SrcPtr.Pixel^.G;
     271                + Share * SrcPtr.PixelG;
    272272              Screwed[xDst + dx, yDst + dy, 2] := Screwed[xDst + dx, yDst + dy, 2]
    273                 + Share * SrcPtr.Pixel^.R;
     273                + Share * SrcPtr.PixelR;
    274274              Screwed[xDst + dx, yDst + dy, 3] := Screwed[xDst + dx, yDst + dy,
    275275                3] + Share;
  • trunk/LocalPlayer/PVSB.pas

    r504 r506  
    189189  ScrollBar.OnChange := ScrollBarChanged;
    190190  ScrollBar.Parent := Parent;
    191   ScrollBar.Width := 24;
     191  ScrollBar.Width := 16;
    192192end;
    193193
  • trunk/LocalPlayer/Wonders.pas

    r490 r506  
    122122        ((ax < amax1 * X) or (ax > amin3 * X))) then begin
    123123        for ch := 0 to 2 do begin
    124           C := Line[0].Pixel^.Planes[ch] - Darken;
    125           if C < 0 then Line[0].Pixel^.Planes[ch] := 0
    126             else Line[0].Pixel^.Planes[ch] := C;
    127           C := Line[1].Pixel^.Planes[ch] - Darken;
    128           if C < 0 then Line[1].Pixel^.Planes[ch] := 0
    129             else Line[1].Pixel^.Planes[ch] := C;
    130           C := Line[2].Pixel^.Planes[ch] - Darken;
    131           if C < 0 then Line[2].Pixel^.Planes[ch] := 0
    132             else Line[2].Pixel^.Planes[ch] := C;
    133           C := Line[3].Pixel^.Planes[ch] - Darken;
    134           if C < 0 then Line[3].Pixel^.Planes[ch] := 0
    135             else Line[3].Pixel^.Planes[ch] := C;
     124          C := Line[0].PixelPlane[ch] - Darken;
     125          if C < 0 then Line[0].PixelPlane[ch] := 0
     126            else Line[0].PixelPlane[ch] := C;
     127          C := Line[1].PixelPlane[ch] - Darken;
     128          if C < 0 then Line[1].PixelPlane[ch] := 0
     129            else Line[1].PixelPlane[ch] := C;
     130          C := Line[2].PixelPlane[ch] - Darken;
     131          if C < 0 then Line[2].PixelPlane[ch] := 0
     132            else Line[2].PixelPlane[ch] := C;
     133          C := Line[3].PixelPlane[ch] - Darken;
     134          if C < 0 then Line[3].PixelPlane[ch] := 0
     135            else Line[3].PixelPlane[ch] := C;
    136136        end;
    137137      end;
     
    163163  for Y := 0 to ScaleToNative(ySizeBig) - 1 do begin
    164164    for X := 0 to ScaleToNative(xSizeBig) - 1 do begin
    165       Darken := ((255 - Src.Pixel^.B) * 3 + (255 - Src.Pixel^.G) *
    166         15 + (255 - Src.Pixel^.R) * 9) div 128;
     165      Darken := ((255 - Src.PixelB) * 3 + (255 - Src.PixelG) *
     166        15 + (255 - Src.PixelR) * 9) div 128;
    167167      for ch := 0 to 2 do begin
    168         C := Dst.Pixel^.Planes[ch] - Darken;
    169         if C < 0 then Dst.Pixel^.Planes[ch] := 0
    170           else Dst.Pixel^.Planes[ch] := C;
     168        C := Dst.PixelPlane[ch] - Darken;
     169        if C < 0 then Dst.PixelPlane[ch] := 0
     170          else Dst.PixelPlane[ch] := C;
    171171      end;
    172172      Src.NextPixel;
Note: See TracChangeset for help on using the changeset viewer.