Ignore:
Timestamp:
May 6, 2020, 11:21:12 PM (5 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/Battle.pas

    r111 r188  
    107107    VLightGradient(ca, xm - 8, ym + 8 + LABaseDamage, LADamage - LABaseDamage,
    108108      FanaticColor);
    109   BitBlt(ca.Handle, xm - 12, ym - 12, 24, 24,
    110     GrExt[HGrSystem].Mask.Canvas.Handle, 26, 146, SRCAND);
    111   BitBlt(ca.Handle, xm - 12, ym - 12, 24, 24,
    112     GrExt[HGrSystem].Data.Canvas.Handle, 26, 146, SRCPAINT);
     109  BitBltCanvas(ca, xm - 12, ym - 12, 24, 24,
     110    GrExt[HGrSystem].Mask.Canvas, 26, 146, SRCAND);
     111  BitBltCanvas(ca, xm - 12, ym - 12, 24, 24,
     112    GrExt[HGrSystem].Data.Canvas, 26, 146, SRCPAINT);
    113113
    114114  LabelText := Format('%d', [Forecast.AStr]);
     
    132132  if Forecast.EndHealthDef <= 0 then
    133133  begin
    134     BitBlt(ca.Handle, xm + 9 + LDDamage - 7, ym - 6, 14, 17,
    135       GrExt[HGrSystem].Mask.Canvas.Handle, 51, 153, SRCAND);
    136     BitBlt(ca.Handle, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
    137       GrExt[HGrSystem].Mask.Canvas.Handle, 51, 153, SRCAND);
    138     BitBlt(ca.Handle, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
    139       GrExt[HGrSystem].Data.Canvas.Handle, 51, 153, SRCPAINT);
     134    BitBltCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17,
     135      GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);
     136    BitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
     137      GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);
     138    BitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
     139      GrExt[HGrSystem].Data.Canvas, 51, 153, SRCPAINT);
    140140  end;
    141141  LabelText := Format('%d', [DDamage]);
     
    152152  if Forecast.EndHealthAtt <= 0 then
    153153  begin
    154     BitBlt(ca.Handle, xm - 6, ym + 9 + LADamage - 7, 14, 17,
    155       GrExt[HGrSystem].Mask.Canvas.Handle, 51, 153, SRCAND);
    156     BitBlt(ca.Handle, xm - 7, ym + 8 + LADamage - 7, 14, 17,
    157       GrExt[HGrSystem].Mask.Canvas.Handle, 51, 153, SRCAND);
    158     BitBlt(ca.Handle, xm - 7, ym + 8 + LADamage - 7, 14, 17,
    159       GrExt[HGrSystem].Data.Canvas.Handle, 51, 153, SRCPAINT);
     154    BitBltCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17,
     155      GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);
     156    BitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
     157      GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);
     158    BitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
     159      GrExt[HGrSystem].Data.Canvas, 51, 153, SRCPAINT);
    160160  end;
    161161  LabelText := Format('%d', [MyUn[uix].Health - Forecast.EndHealthAtt]);
     
    173173
    174174  NoMap.SetOutput(Buffer);
    175   BitBlt(Buffer.Canvas.Handle, 0, 0, 66, 48, ca.Handle, xm + 8 + 4,
    176     ym - 8 - 12 - 48, SRCCOPY);
     175  BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4,
     176    ym - 8 - 12 - 48);
    177177  { if TerrType<fForest then
    178178    Sprite(Buffer,HGrTerrain,0,16,66,32,1+TerrType*(xxt*2+1),1+yyt)
     
    185185    end; }
    186186  NoMap.PaintUnit(1, 0, UnitInfo, 0);
    187   BitBlt(ca.Handle, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas.Handle,
    188     0, 0, SRCCOPY);
    189 
    190   BitBlt(Buffer.Canvas.Handle, 0, 0, 66, 48, ca.Handle, xm - 8 - 4 - 66,
    191     ym + 8 + 12, SRCCOPY);
     187  BitBltCanvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas,
     188    0, 0);
     189
     190  BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66,
     191    ym + 8 + 12);
    192192  MakeUnitInfo(me, MyUn[uix], UnitInfo);
    193193  UnitInfo.Flags := UnitInfo.Flags and not unFortified;
    194194  NoMap.PaintUnit(1, 0, UnitInfo, 0);
    195   BitBlt(ca.Handle, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas.Handle,
    196     0, 0, SRCCOPY);
     195  BitBltCanvas(ca, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas, 0, 0);
    197196end; { PaintBattleOutcome }
    198197
Note: See TracChangeset for help on using the changeset viewer.