Ignore:
Timestamp:
Apr 6, 2021, 8:11:02 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Merged trunk branch version r348 into highdpi branch.
File:
1 edited

Legend:

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

    r311 r349  
    149149      begin
    150150        Tribe[IconIndex].InitAge(GetAge(IconIndex));
    151         if Tribe[IconIndex].faceHGr >= 0 then
    152           TopSpace := 64
     151        if Assigned(Tribe[IconIndex].faceHGr) then
     152          TopSpace := 64;
    153153      end;
    154154    mikFullControl:
     
    233233  hScrewed = 27;
    234234var
    235   ix, iy, xDst, yDst, dx, dy, xIcon, yIcon, xb, yb, wb, hb: integer;
     235  ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: integer;
     236  BookRect: TRect;
    236237  x1, xR, yR, share: single;
    237238  Screwed: array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of single;
     
    282283    end;
    283284    BigImp.EndUpdate;
    284     xb := xBBook;
    285     yb := yBBook;
    286     wb := wBBook;
    287     hb := hBBook;
     285    BookRect := BigBook.BoundsRect;
    288286  end
    289287  else
    290288  begin
    291     xb := xSBook;
    292     yb := ySBook;
    293     wb := wSBook;
    294     hb := hSBook;
    295   end;
    296   x := x - wb div 2;
     289    BookRect := SmallBook.BoundsRect;
     290  end;
     291  x := x - BookRect.Width div 2;
    297292
    298293  // paint
    299   // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    300   LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    301   DpiBitCanvas(LogoBuffer.Canvas, 0, 0, wb, hb, ca, x, y);
     294  UnshareBitmap(LogoBuffer);
     295  DpiBitCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, x, y);
    302296
    303297  if IconIndex >= 0 then
     
    310304            Trunc(Screwed[ix, iy, 0] / Screwed[ix, iy, 3]) shl 16;
    311305
    312   ImageOp_BCC(LogoBuffer, Templates, 0, 0, xb, yb, wb, hb, clCover, clPage);
    313 
    314   DpiBitCanvas(ca, x, y, wb, hb, LogoBuffer.Canvas, 0, 0);
     306  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), BookRect, clCover, clPage);
     307
     308  DpiBitCanvas(ca, x, y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0);
    315309end;
    316310
     
    336330      with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do
    337331      begin
    338         DpiBitCanvas(Canvas, x, y, 64, 48, GrExt[HGr].Mask.Canvas,
     332        DpiBitCanvas(Canvas, x, y, 64, 48, HGr.Mask.Canvas,
    339333          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND);
    340         DpiBitCanvas(Canvas, x, y, 64, 48, GrExt[HGr].Data.Canvas,
     334        DpiBitCanvas(Canvas, x, y, 64, 48, HGr.Data.Canvas,
    341335          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT);
    342336      end;
     
    379373      begin
    380374        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);
     375        UnshareBitmap(Buffer);
    383376        DpiBitCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
    384377          ySizeBig + 2 * GlowRange, Canvas,
     
    411404          ySizeBig, 0, 0);
    412405        DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
    413           GrExt[HGr].Mask.Canvas, pix mod 10 * 65 + 1,
     406          HGr.Mask.Canvas, pix mod 10 * 65 + 1,
    414407          pix div 10 * 49 + 1, SRCAND);
    415408        DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
    416           GrExt[HGr].Data.Canvas, pix mod 10 * 65 + 1,
     409          HGr.Data.Canvas, pix mod 10 * 65 + 1,
    417410          pix div 10 * 49 + 1, SRCPAINT);
    418411      end;
     
    421414        MainTexture.clCover);
    422415    mikTribe:
    423       if Tribe[IconIndex].faceHGr >= 0 then
     416      if Assigned(Tribe[IconIndex].faceHGr) then
    424417      begin
    425418        Frame(Canvas, ClientWidth div 2 - 32 - 1, 24 - 1,
    426419          ClientWidth div 2 + 32, 24 + 48, $000000, $000000);
    427420        DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48,
    428           GrExt[Tribe[IconIndex].faceHGr].Data.Canvas,
     421          Tribe[IconIndex].faceHGr.Data.Canvas,
    429422          1 + Tribe[IconIndex].facepix mod 10 * 65,
    430423          1 + Tribe[IconIndex].facepix div 10 * 49)
     
    441434        DpiBitCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
    442435          (ClientWidth - 140) div 2, 24);
    443         ImageOp_BCC(Buffer, Templates, 0, 0, 1, 279, 140, 120, 0, $FFFFFF);
     436        ImageOp_BCC(Buffer, Templates.Data, Point(0, 0), StarshipDeparted.BoundsRect, 0, $FFFFFF);
    444437        DpiBitCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,
    445438          Buffer.Canvas, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.