- Timestamp:
- May 14, 2020, 10:39:45 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Wonders.pas
r206 r230 87 87 procedure TWondersDlg.PaintBackgroundShape; 88 88 const 89 darken = 24;89 Darken = 24; 90 90 // space=pi/120; 91 91 amax0 = 15734; // 1 shl 16*tan(pi/12-space); … … 103 103 C: Integer; 104 104 Ch: Integer; 105 Line: array [0.. 1] of TPixelPointer;105 Line: array [0..3] of TPixelPointer; 106 106 begin 107 107 Offscreen.BeginUpdate; 108 Line[0] := PixelPointer(Offscreen); 109 Line[1] := PixelPointer(Offscreen); 108 Line[0] := PixelPointer(Offscreen, Center.X, Center.Y); 109 Line[1] := PixelPointer(Offscreen, Center.X, Center.Y - 1); 110 Line[2] := PixelPointer(Offscreen, Center.X - 1, Center.Y); 111 Line[3] := PixelPointer(Offscreen, Center.X - 1, Center.Y - 1); 110 112 for Y := 0 to 127 do begin 111 113 for X := 0 to 179 do begin … … 115 117 ((r >= 32 * 64 * 90 * 90) and (ax < amax2 * X) and 116 118 ((ax < amax0 * X) or (ax > amin2 * X)) or (ax > amin1 * X) and 117 ((ax < amax1 * X) or (ax > amin3 * X))) then 118 for i := 0 to 1 do 119 for ch := 0 to 2 do begin 120 Line[0].SetXY(Center.X + X, Center.Y + Y); 121 Line[1].SetXY(Center.X + X, Center.Y - 1 - Y); 122 c := Line[i].Pixel^.Planes[ch] - darken; 123 if c < 0 then Line[i].Pixel^.Planes[ch] := 0 124 else Line[i].Pixel^.Planes[ch] := c; 125 Line[0].SetXY(Center.X - 1 - X, Center.Y + Y); 126 Line[1].SetXY(Center.X - 1 - X, Center.Y - 1 - Y); 127 c := Line[i].Pixel^.Planes[ch] - darken; 128 if c < 0 then Line[i].Pixel^.Planes[ch] := 0 129 else Line[i].Pixel^.Planes[ch] := c; 130 end; 131 end; 119 ((ax < amax1 * X) or (ax > amin3 * X))) then begin 120 for ch := 0 to 2 do begin 121 c := Line[0].Pixel^.Planes[ch] - Darken; 122 if c < 0 then Line[0].Pixel^.Planes[ch] := 0 123 else Line[0].Pixel^.Planes[ch] := c; 124 c := Line[1].Pixel^.Planes[ch] - Darken; 125 if c < 0 then Line[1].Pixel^.Planes[ch] := 0 126 else Line[1].Pixel^.Planes[ch] := c; 127 c := Line[2].Pixel^.Planes[ch] - Darken; 128 if c < 0 then Line[2].Pixel^.Planes[ch] := 0 129 else Line[2].Pixel^.Planes[ch] := c; 130 c := Line[3].Pixel^.Planes[ch] - Darken; 131 if c < 0 then Line[3].Pixel^.Planes[ch] := 0 132 else Line[3].Pixel^.Planes[ch] := c; 133 end; 134 end; 135 Line[0].NextPixel; 136 Line[1].NextPixel; 137 Line[2].PreviousPixel; 138 Line[3].PreviousPixel; 139 end; 140 Line[0].NextLine; 141 Line[1].PreviousLine; 142 Line[2].NextLine; 143 Line[3].PreviousLine; 132 144 end; 133 145 Offscreen.EndUpdate; … … 217 229 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 218 230 (hMaintexture - ClientHeight) div 2); 219 DarkIcon(I);231 //DarkIcon(I); 220 232 end; 221 233 -2: // destroyed -
trunk/Packages/CevoComponents/ScreenTools.pas
r225 r230 911 911 begin 912 912 dst.BeginUpdate; 913 DstPtr := PixelPointer(dst, x0 , y0);913 DstPtr := PixelPointer(dst, x0 - GlowRange + 1, y0 - GlowRange + 1); 914 914 for y := -GlowRange + 1 to Height - 1 + GlowRange - 1 do begin 915 915 for x := -GlowRange + 1 to Width - 1 + GlowRange - 1 do begin 916 DstPtr.SetXY(x, y);917 916 if x < 0 then 918 917 if y < 0 then … … 933 932 else if y >= Height then 934 933 r := y - (Height - 1) 935 else 934 else begin 935 DstPtr.NextPixel; 936 936 continue; 937 end; 937 938 if r = 0 then 938 939 r := 1; … … 942 943 (DstPtr.Pixel^.Planes[2 - ch] * (r - 1) + (cl shr (8 * ch) and $FF) * 943 944 (GlowRange - r)) div (GlowRange - 1); 944 end; 945 DstPtr.NextPixel; 946 end; 947 DstPtr.NextLine; 945 948 end; 946 949 dst.EndUpdate; -
trunk/Packages/CevoComponents/UPixelPointer.pas
r206 r230 27 27 BytesPerPixel: Integer; 28 28 BytesPerLine: Integer; 29 procedure NextLine; inline; // Move pointer to start of new base line 29 procedure NextLine; inline; // Move pointer to start of next line 30 procedure PreviousLine; inline; // Move pointer to start of previous line 30 31 procedure NextPixel; inline; // Move pointer to next pixel 32 procedure PreviousPixel; inline; // Move pointer to previous pixel 31 33 procedure SetXY(X, Y: Integer); inline; // Set pixel position relative to base 32 34 procedure SetX(X: Integer); inline; // Set horizontal pixel position relative to base … … 47 49 end; 48 50 51 procedure TPixelPointer.PreviousLine; 52 begin 53 Line := Pointer(Line) - BytesPerLine; 54 Pixel := Line; 55 end; 56 49 57 procedure TPixelPointer.NextPixel; inline; 50 58 begin 51 59 Pixel := Pointer(Pixel) + BytesPerPixel; 60 end; 61 62 procedure TPixelPointer.PreviousPixel; 63 begin 64 Pixel := Pointer(Pixel) - BytesPerPixel; 52 65 end; 53 66
Note:
See TracChangeset
for help on using the changeset viewer.