Ignore:
Timestamp:
May 6, 2020, 11:21:12 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Simplified code by replacing BitBlt which uses always handles by BitBltCanvas which uses directly TCanvas objects. Used default ROP SRCCOPY.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r173 r188  
    260260    Back.Canvas.FillRect(0, 0, ClientWidth, ClientHeight);
    261261
    262     bitblt(Back.Canvas.Handle, 0, 0, ClientWidth, ClientHeight,
    263       MainTexture.Image.Canvas.Handle, 0, 0, SRCCOPY);
     262    bitbltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
     263      MainTexture.Image.Canvas, 0, 0);
    264264    ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight);
    265265  end;
     
    291291  Color2 := Colors.Canvas.Pixels[clkAge0 + Age, cliHouse];
    292292  SmallCityMap.Canvas.FillRect(0, 0, SmallCityMap.Width, SmallCityMap.Height);
    293   bitblt(SmallCityMap.Canvas.Handle, 0, 0, 83, hSmallMap,
    294     SmallCityMapTemplate.Canvas.Handle, 83 * SizeClass, 0, SRCCOPY);
     293  bitbltCanvas(SmallCityMap.Canvas, 0, 0, 83, hSmallMap,
     294    SmallCityMapTemplate.Canvas, 83 * SizeClass, 0);
    295295  if IsPort then
    296296  begin
    297     bitblt(SmallCityMap.Canvas.Handle, 83, 0, 15, hSmallMap,
    298       SmallCityMapTemplate.Canvas.Handle, 332 + 15, 0, SRCCOPY);
     297    bitbltCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,
     298      SmallCityMapTemplate.Canvas, 332 + 15, 0);
    299299    ImageOp_CCC(SmallCityMap, 0, 0, 83, hSmallMap, Color0, Color1, Color2);
    300300    Color2 := Colors.Canvas.Pixels[clkCity, cliWater];
     
    303303  else
    304304  begin
    305     bitblt(SmallCityMap.Canvas.Handle, 83, 0, 15, hSmallMap,
    306       SmallCityMapTemplate.Canvas.Handle, 332, 0, SRCCOPY);
     305    bitbltCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap,
     306      SmallCityMapTemplate.Canvas, 332, 0);
    307307    ImageOp_CCC(SmallCityMap, 0, 0, wSmallMap, hSmallMap, Color0,
    308308      Color1, Color2);
     
    359359  ZoomCityMap.Canvas.FillRect(0, 0, ZoomCityMap.Width, ZoomCityMap.Height);
    360360
    361   bitblt(ZoomCityMap.Canvas.Handle, 0, 0, wZoomMap, hZoomMap,
    362     Back.Canvas.Handle, xZoomMap, yZoomMap, SRCCOPY);
     361  bitbltCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap,
     362    Back.Canvas, xZoomMap, yZoomMap);
    363363  if Mode = mImp then begin
    364364    if ZoomArea < 3 then begin
     
    542542  RedTex.clTextShade := $0000FF;
    543543
    544   bitblt(offscreen.Canvas.Handle, 0, 0, 640, 480, Back.Canvas.Handle, 0,
    545     0, SRCCOPY);
     544  bitbltCanvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0);
    546545
    547546  offscreen.Canvas.Font.Assign(UniFont[ftCaption]);
     
    614613    false, AllowChange and IsCityAlive and
    615614    (c.Status and csResourceWeightsMask = 0));
    616   bitblt(offscreen.Canvas.Handle, xmArea + 102, 42, 90, 33, Back.Canvas.Handle,
    617     xmArea + 102, 42, SRCCOPY);
     615  bitbltCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas,
     616    xmArea + 102, 42);
    618617
    619618  if IsCityAlive then
     
    645644    else
    646645      xGr := 141;
    647     bitblt(offscreen.Canvas.Handle, xmArea - 192 + 5 + i * d, ymArea - 96 - 29,
    648       27, 30, GrExt[HGrSystem].Mask.Canvas.Handle, xGr, 171, SRCAND); { shadow }
     646    bitbltCanvas(offscreen.Canvas, xmArea - 192 + 5 + i * d, ymArea - 96 - 29,
     647      27, 30, GrExt[HGrSystem].Mask.Canvas, xGr, 171, SRCAND); { shadow }
    649648    Sprite(offscreen, HGrSystem, xmArea - 192 + 4 + i * d, ymArea - 96 - 30, 27,
    650649      30, xGr, 171);
     
    657656  begin
    658657    xGr := 1 + 112;
    659     bitblt(offscreen.Canvas.Handle, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27,
    660       30, GrExt[HGrSystem].Mask.Canvas.Handle, xGr, 171, SRCAND); { shadow }
     658    bitbltCanvas(offscreen.Canvas, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27,
     659      30, GrExt[HGrSystem].Mask.Canvas, xGr, 171, SRCAND); { shadow }
    661660    Sprite(offscreen, HGrSystem, xmArea + 192 - 27 - i * d, 29, 27, 30,
    662661      xGr, 171);
     
    803802
    804803  // small map
    805   bitblt(offscreen.Canvas.Handle, xSmallMap, ySmallMap, wSmallMap, hSmallMap,
    806     SmallCityMap.Canvas.Handle, 0, 0, SRCCOPY);
     804  bitbltCanvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap,
     805    SmallCityMap.Canvas, 0, 0);
    807806  if Mode = mImp then
    808807    Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),
     
    831830  Sprite(offscreen, HGrSystem, x + 6, y - 5, 10, 10, 154, 126);
    832831
    833   bitblt(offscreen.Canvas.Handle, xZoomMap, yZoomMap, wZoomMap, hZoomMap,
    834     ZoomCityMap.Canvas.Handle, 0, 0, SRCCOPY);
     832  bitbltCanvas(offscreen.Canvas, xZoomMap, yZoomMap, wZoomMap, hZoomMap,
     833    ZoomCityMap.Canvas, 0, 0);
    835834
    836835  for i := 0 to 5 do
     
    16201619      with Canvas do
    16211620      begin
    1622         bitblt(Canvas.Handle, xView + 5, yView + 1, 64, 2, Back.Canvas.Handle,
    1623           xView + 5, yView + 1, SRCCOPY);
    1624         bitblt(Canvas.Handle, xView + 5, yView + 3, 2, 42, Back.Canvas.Handle,
    1625           xView + 5, yView + 3, SRCCOPY);
    1626         bitblt(Canvas.Handle, xView + 5 + 62, yView + 3, 2, 42,
    1627           Back.Canvas.Handle, xView + 5 + 62, yView + 3, SRCCOPY);
     1621        bitbltCanvas(Canvas, xView + 5, yView + 1, 64, 2, Back.Canvas,
     1622          xView + 5, yView + 1);
     1623        bitbltCanvas(Canvas, xView + 5, yView + 3, 2, 42, Back.Canvas,
     1624          xView + 5, yView + 3);
     1625        bitbltCanvas(Canvas, xView + 5 + 62, yView + 3, 2, 42,
     1626          Back.Canvas, xView + 5 + 62, yView + 3);
    16281627        ScreenTools.Frame(Canvas, xView + 9 - 1, yView + 5 - 1, xView + 9 + xSizeBig,
    16291628          yView + 5 + ySizeBig, $B0B0B0, $FFFFFF);
     
    16441643      else if c.Project and cpImp = 0 then
    16451644      begin // project is unit
    1646         bitblt(Canvas.Handle, xView + 9, yView + 5, xSizeBig, ySizeBig,
    1647           bigimp.Canvas.Handle, 0, 0, SRCCOPY);
     1645        bitbltCanvas(Canvas, xView + 9, yView + 5, xSizeBig, ySizeBig,
     1646          bigimp.Canvas, 0, 0);
    16481647        with Tribe[cOwner].ModelPicture[c.Project and cpIndex] do
    16491648          Sprite(Canvas, HGr, xView + 5, yView + 1, 64, 44, pix mod 10 * 65 + 1,
Note: See TracChangeset for help on using the changeset viewer.