Changeset 60 for trunk/ScreenTools.pas


Ignore:
Timestamp:
Jan 13, 2017, 6:51:27 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: City mini map was drawn incorrectly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ScreenTools.pas

    r52 r60  
    653653// X channel = background amp (old Dst content), 128=original brightness
    654654var
    655   i, Brightness, test: integer;
     655  X, Y: Integer;
     656  Brightness, test: integer;
    656657  PixelSrc: ^Byte;
    657658  PixelDst: PPixel32;
    658659begin
    659   {TODO assert(Src.PixelFormat = pf8bit);}
    660   assert(dst.PixelFormat = pf24bit);
     660  //TODO Assert(Src.PixelFormat = pf8bit);
     661  Assert(dst.PixelFormat = pf24bit);
    661662  if xDst < 0 then
    662663  begin
     
    680681  dst.BeginUpdate;
    681682  Src.BeginUpdate;
    682   h := yDst + h;
    683   while yDst < h do
    684   begin
    685     PixelDst := GetBitmapPixelPtr(dst, xDst, yDst);
    686     PixelSrc := Src.ScanLine[ySrc] + xSrc;
    687     for i := 0 to w - 1 do
    688     begin
     683  for Y := 0 to h - 1 do begin
     684    PixelDst := GetBitmapPixelPtr(dst, xDst, yDst + Y);
     685    PixelSrc := Pointer(GetBitmapPixelPtr(Src, xSrc, ySrc + Y));
     686    for X := 0 to w - 1 do begin
    689687      Brightness := PixelSrc^;
    690688      test := (PixelDst^.R * Brightness) shr 7;
     
    700698        PixelDst^.B := test; // Blue
    701699      PixelDst := Pointer(PixelDst) + (Dst.RawImage.Description.BitsPerPixel shr 3);
    702       PixelSrc := Pointer(PixelSrc) + 1;
    703     end;
    704     inc(yDst);
    705     inc(ySrc);
     700      PixelSrc := Pointer(PixelSrc) + (Src.RawImage.Description.BitsPerPixel shr 3);
     701    end;
    706702  end;
    707703  src.EndUpdate;
Note: See TracChangeset for help on using the changeset viewer.