Changeset 52 for trunk/LocalPlayer/Wonders.pas
- Timestamp:
- Jan 11, 2017, 10:14:11 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Wonders.pas
r38 r52 78 78 79 79 procedure TWondersDlg.OffscreenPaint; 80 type81 TLine = array [0 .. 649, 0 .. 2] of Byte;82 80 83 81 procedure DarkIcon(i: Integer); 84 82 var 85 83 X, Y, ch, x0Dst, y0Dst, x0Src, y0Src, darken, c: Integer; 86 Src, Dst: ^TLine;84 Src, Dst: PPixel32; 87 85 begin 88 86 x0Dst := ClientWidth div 2 - xSizeBig div 2 + RingPosition[i, 0]; … … 90 88 x0Src := (i mod 7) * xSizeBig; 91 89 y0Src := (i div 7 + SystemIconLines) * ySizeBig; 92 for Y := 0 to ySizeBig - 1 do 93 begin 94 Src := BigImp.ScanLine[y0Src + Y]; 95 Dst := Offscreen.ScanLine[y0Dst + Y]; 96 for X := 0 to xSizeBig - 1 do 97 begin 98 darken := ((255 - Src[x0Src + X][0]) * 3 + (255 - Src[x0Src + X][1]) * 99 15 + (255 - Src[x0Src + X][2]) * 9) div 128; 100 for ch := 0 to 2 do 101 begin 102 c := Dst[x0Dst + X][ch] - darken; 103 if c < 0 then 104 Dst[x0Dst + X][ch] := 0 105 else 106 Dst[x0Dst + X][ch] := c; 90 for Y := 0 to ySizeBig - 1 do begin 91 for X := 0 to xSizeBig - 1 do begin 92 Src := GetBitmapPixelPtr(BigImp, x0Src + X, y0Src + Y); 93 Dst := GetBitmapPixelPtr(Offscreen, x0Dst + X, y0Dst + Y); 94 darken := ((255 - Src^.B) * 3 + (255 - Src^.G) * 95 15 + (255 - Src^.R) * 9) div 128; 96 for ch := 0 to 2 do begin 97 c := Dst^.Planes[ch] - darken; 98 if c < 0 then Dst^.Planes[ch] := 0 99 else Dst^.Planes[ch] := c; 107 100 end 108 101 end … … 129 122 i, X, Y, r, ax, ch, c: Integer; 130 123 HaveWonder: boolean; 131 Line: array [0 .. 1] of ^TLine;124 Line: array [0 .. 1] of PPixel32; 132 125 s: string; 133 126 begin … … 160 153 xm := ClientWidth div 2; 161 154 ym := ClientHeight div 2; 162 for Y := 0 to 127 do 163 begin 164 Line[0] := Offscreen.ScanLine[ym + Y]; 165 Line[1] := Offscreen.ScanLine[ym - 1 - Y]; 166 for X := 0 to 179 do 167 begin 155 for Y := 0 to 127 do begin 156 for X := 0 to 179 do begin 168 157 r := X * X * (32 * 32) + Y * Y * (45 * 45); 169 158 ax := ((1 shl 16 div 32) * 45) * Y; … … 173 162 ((ax < amax1 * X) or (ax > amin3 * X))) then 174 163 for i := 0 to 1 do 175 for ch := 0 to 2 do 176 begin 177 c := Line[i][xm + X][ch] - darken; 164 for ch := 0 to 2 do begin 165 Line[0] := GetBitmapPixelPtr(Offscreen, xm + X, ym + Y); 166 Line[1] := GetBitmapPixelPtr(Offscreen, xm + X, ym - 1 - Y); 167 c := Line[i]^.Planes[ch] - darken; 178 168 if c < 0 then 179 Line[i] [xm + X][ch] := 0169 Line[i]^.Planes[ch] := 0 180 170 else 181 Line[i][xm + X][ch] := c; 182 c := Line[i][xm - 1 - X][ch] - darken; 171 Line[i]^.Planes[ch] := c; 172 Line[0] := GetBitmapPixelPtr(Offscreen, xm - 1 - X, ym + Y); 173 Line[1] := GetBitmapPixelPtr(Offscreen, xm - 1 - X, ym - 1 - Y); 174 c := Line[i]^.Planes[ch] - darken; 183 175 if c < 0 then 184 Line[i] [xm - 1 - X][ch] := 0176 Line[i]^.Planes[ch] := 0 185 177 else 186 Line[i] [xm - 1 - X][ch] := c;178 Line[i]^.Planes[ch] := c; 187 179 end; 188 180 end;
Note:
See TracChangeset
for help on using the changeset viewer.