Changeset 48


Ignore:
Timestamp:
Jan 11, 2017, 9:15:33 AM (8 years ago)
Author:
chronos
Message:
  • Fixed: ScrollDC function is not available under Linux. Replace by slow scrolling using BitBlt.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r47 r48  
    41524152end;
    41534153
     4154function ScrollDCCopy(Canvas: TCanvas; dx: longint; dy: longint; const lprcScroll:RECT; const lprcClip:RECT; hrgnUpdate:HRGN; lprcUpdate:LPRECT):WINBOOL;
     4155begin
     4156  BitBltCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,
     4157    Canvas, lprcScroll.Left, lprcScroll.Top, SRCCOPY);
     4158end;
     4159
    41544160procedure TMainScreen.MainOffscreenPaint;
    41554161var
     
    41984204    offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    41994205    rec := Rect(0, 0, MapWidth, MapHeight);
    4200 {$IFDEF WINDOWS}{ TODO Linux }
     4206{$IFDEF WINDOWS}
    42014207    ScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    42024208      rec, rec, 0, nil);
    42034209{$ENDIF}
     4210{$IFDEF LINUX}
     4211    // Fallback to bitblt
     4212    ScrollDCCopy(offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
     4213      rec, rec, 0, nil);
     4214{$ENDIF}
    42044215    for DoInvalidate := false to FastScrolling do
    42054216    begin
     
    42074218      begin
    42084219        rec.Bottom := MapHeight - overlap;
    4209 {$IFDEF WINDOWS}{ TODO Linux }
     4220{$IFDEF WINDOWS}
    42104221        ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
    42114222          rec, 0, nil);
     4223{$ENDIF}
     4224{$IFDEF LINUX}
     4225        // Fallback to bitblt
     4226        ScrollDCCopy(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
     4227          rec, rec, 0, nil);
    42124228{$ENDIF}
    42134229        ProcessOptions := prInvalidate;
  • trunk/ScreenTools.pas

    r47 r48  
    810810begin
    811811  Assert(Rop = SRCCOPY);
    812   DestCanvas.CopyRect(Rect(X, X, Width, Height), SrcCanvas,
     812  DestCanvas.CopyRect(Rect(X, Y, X + Width, Y + Height), SrcCanvas,
    813813    Rect(XSrc, YSrc, XSrc + Width, YSrc + Height));
    814814end;
Note: See TracChangeset for help on using the changeset viewer.