Changeset 72 for trunk/LocalPlayer/CityScreen.pas
- Timestamp:
- Jan 15, 2017, 11:47:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r71 r72 438 438 XX, YY: Integer; 439 439 Gray: Integer; 440 PixelPtr: PPixel32; 441 LinePtr: PPixel32; 440 PixelPtr: TPixelPointer; 442 441 begin 443 442 Offscreen.BeginUpdate; 444 LinePtr := GetBitmapPixelPtr(Offscreen, X, Y);443 PixelPtr.Init(Offscreen, X, Y); 445 444 for YY := 0 to h - 1 do begin 446 PixelPtr := LinePtr;447 445 for XX := 0 to w - 1 do begin 448 Gray := (Integer(PixelPtr ^.B) + Integer(PixelPtr^.G) + Integer(PixelPtr^.R)449 450 PixelPtr ^.B := 0;451 PixelPtr ^.G := 0;452 PixelPtr ^.R := Gray; // 255-(255-gray) div 2;453 PixelPtr := Pointer(PixelPtr) + (Offscreen.RawImage.Description.BitsPerPixel shr 3);446 Gray := (Integer(PixelPtr.Pixel^.B) + Integer(PixelPtr.Pixel^.G) + 447 Integer(PixelPtr.Pixel^.R)) * 85 shr 8; 448 PixelPtr.Pixel^.B := 0; 449 PixelPtr.Pixel^.G := 0; 450 PixelPtr.Pixel^.R := Gray; // 255-(255-gray) div 2; 451 PixelPtr.NextPixel; 454 452 end; 455 LinePtr := Pointer(LinePtr) + Offscreen.RawImage.Description.BytesPerLine;453 PixelPtr.NextLine; 456 454 end; 457 455 Offscreen.EndUpdate;
Note:
See TracChangeset
for help on using the changeset viewer.