Ignore:
Timestamp:
May 21, 2020, 8:17:38 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Update from trunk rev 245.
  • Modified: Vcl prefix/suffix changed to Native.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/MessgEx.pas

    r216 r246  
    212212        Sleep(1);
    213213        Ticks := NowPrecise;
    214       until MovieCancelled or (MillisecondOf(Ticks - Ticks0) >= 1500);
     214      until MovieCancelled or (Round((Ticks - Ticks0) / OneMillisecond) >= 1500);
    215215      Hide;
    216216    end;
     
    237237  Screwed: array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of single;
    238238  SrcPtr: TPixelPointer;
    239 begin
     239  Width: Integer;
     240  Height: Integer;
     241begin
     242  Width := 56;
     243  Height := 40;
    240244  if IconIndex >= 0 then begin
    241245    xIcon := IconIndex mod 7 * xSizeBig;
    242246    yIcon := (IconIndex + SystemIconLines * 7) div 7 * ySizeBig;
    243247    // prepare screwed icon
    244     fillchar(Screwed, sizeof(Screwed), 0);
     248    FillChar(Screwed, sizeof(Screwed), 0);
    245249    BigImp.BeginUpdate;
    246     for iy := 0 to 39 do begin
    247       for ix := 0 to 55 do begin
    248         SrcPtr := PixelPointer(BigImp, ix + xIcon, iy + yIcon);
    249         xR := ix * (37 + iy * 5 / 40) / 56;
     250    SrcPtr := PixelPointer(BigImp, ScaleToNative(xIcon), ScaleToNative(yIcon));
     251    for iy := 0 to ScaleToNative(Height) - 1 do begin
     252      for ix := 0 to ScaleToNative(Width) - 1 do begin
     253        xR := ScaleFromNative(ix) * (37 + ScaleFromNative(iy) * 5 / Height) / Width;
    250254        xDst := Trunc(xR);
    251255        xR := Frac(xR);
    252         x1 := (120 - ix) * (120 - ix) - 10000;
    253         yR := iy * 18 / 40 + x1 * x1 / 4000000;
     256        x1 := (120 - ScaleFromNative(ix)) * (120 - ScaleFromNative(ix)) - 10000;
     257        yR := ScaleFromNative(iy) * 18 / Height + x1 * x1 / 4000000;
    254258        yDst := Trunc(yR);
    255259        yR := Frac(yR);
     
    272276            Screwed[xDst + dx, yDst + dy, 3] := Screwed[xDst + dx, yDst + dy,
    273277              3] + share;
    274           end;
    275       end;
     278        end;
     279        SrcPtr.NextPixel;
     280      end;
     281      SrcPtr.NextLine;
    276282    end;
    277283    BigImp.EndUpdate;
     
    373379      begin
    374380        p1 := MyRO.Wonder[IconIndex].EffectiveOwner;
     381        // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
     382        Buffer.Canvas.FillRect(0, 0, 1, 1);
    375383        DpiBitCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
    376384          ySizeBig + 2 * GlowRange, Canvas,
Note: See TracChangeset for help on using the changeset viewer.