Changeset 72 for trunk/LocalPlayer/TechTree.pas
- Timestamp:
- Jan 15, 2017, 11:47:01 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/TechTree.pas
r57 r72 123 123 X, Y, ad, TexWidth, TexHeight: Integer; 124 124 s: string; 125 SrcPixel, DstPixel: PPixel32;125 SrcPixel, DstPixel: TPixelPointer; 126 126 begin 127 127 if Image = nil then … … 165 165 // texturize background 166 166 Image.BeginUpdate; 167 TexWidth := Paper.width; 168 TexHeight := Paper.height; 169 for Y := 0 to Image.height - 1 do 170 begin 171 for X := 0 to Image.width - 1 do 172 begin 173 DstPixel := GetBitmapPixelPtr(Image, X, Y); 174 if (DstPixel^.ARGB and $FFFFFF) = $7F007F then // transparent 175 begin 176 SrcPixel := GetBitmapPixelPtr(Paper, X mod TexWidth, Y mod TexHeight); 177 DstPixel^.B := SrcPixel^.B; 178 DstPixel^.G := SrcPixel^.G; 179 DstPixel^.R := SrcPixel^.R; 167 TexWidth := Paper.Width; 168 TexHeight := Paper.Height; 169 DstPixel.Init(Image); 170 SrcPixel.Init(Paper); 171 for Y := 0 to Image.Height - 1 do begin 172 for X := 0 to Image.Width - 1 do begin 173 if (DstPixel.Pixel^.ARGB and $FFFFFF) = $7F007F then begin // transparent 174 SrcPixel.SetXY(X mod TexWidth, Y mod TexHeight); 175 DstPixel.Pixel^.B := SrcPixel.Pixel^.B; 176 DstPixel.Pixel^.G := SrcPixel.Pixel^.G; 177 DstPixel.Pixel^.R := SrcPixel.Pixel^.R; 180 178 end; 179 DstPixel.NextPixel; 181 180 end; 181 DstPixel.NextLine; 182 182 end; 183 183 Image.EndUpdate;
Note:
See TracChangeset
for help on using the changeset viewer.