Changeset 190 for trunk/LocalPlayer/TechTree.pas
- Timestamp:
- May 7, 2020, 10:33:59 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/TechTree.pas
r188 r190 78 78 X, w: Integer; 79 79 begin 80 with Canvas do 81 begin 80 with Canvas do begin 82 81 // black border 83 82 brush.color := $000000; … … 120 119 procedure TTechTreeDlg.FormShow(Sender: TObject); 121 120 var 122 X, Y, ad , TexWidth, TexHeight: Integer;121 X, Y, ad: Integer; 123 122 s: string; 124 SrcPixel, DstPixel: TPixelPointer; 125 begin 126 if Image = nil then127 begin123 const 124 TransparentColor = $7F007F; 125 begin 126 if Image = nil then begin 128 127 Image := TBitmap.Create; 129 128 Image.PixelFormat := pf24bit; 130 129 LoadGraphicFile(Image, HomeDir + 'Help' + DirectorySeparator + 'AdvTree.png', gfNoGamma); 131 130 132 with Image.Canvas do 133 begin 131 with Image.Canvas do begin 134 132 // write advance names 135 133 Font.Assign(UniFont[ftSmall]); … … 147 145 TextOut(xStart + X * xPitch + 2, yStart + Y * yPitch, s); 148 146 Pixels[xStart + X * xPitch + 10, yStart + Y * yPitch - 1] 149 := $7F007F;147 := TransparentColor; 150 148 end 151 149 end; … … 162 160 end; 163 161 164 // texturize background 165 Image.BeginUpdate; 166 TexWidth := Paper.Width; 167 TexHeight := Paper.Height; 168 DstPixel.Init(Image); 169 SrcPixel.Init(Paper); 170 for Y := 0 to Image.Height - 1 do begin 171 for X := 0 to Image.Width - 1 do begin 172 if (DstPixel.Pixel^.ARGB and $FFFFFF) = $7F007F then begin // transparent 173 SrcPixel.SetXY(X mod TexWidth, Y mod TexHeight); 174 DstPixel.Pixel^.B := SrcPixel.Pixel^.B; 175 DstPixel.Pixel^.G := SrcPixel.Pixel^.G; 176 DstPixel.Pixel^.R := SrcPixel.Pixel^.R; 177 end; 178 DstPixel.NextPixel; 179 end; 180 DstPixel.NextLine; 181 end; 182 Image.EndUpdate; 162 Texturize(Image, Paper, TransparentColor); 183 163 end; 184 164 … … 205 185 xDown := X; 206 186 yDown := Y; 207 end 187 end; 208 188 end; 209 189 … … 235 215 236 216 SmartInvalidate; 237 end 217 end; 238 218 end; 239 219 … … 247 227 procedure TTechTreeDlg.CloseBtnClick(Sender: TObject); 248 228 begin 249 Close ();229 Close; 250 230 end; 251 231
Note:
See TracChangeset
for help on using the changeset viewer.