Changeset 188 for trunk/Start.pas


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/Start.pas

    r187 r188  
    534534  Brains[0].Picture := TBitmap.Create;
    535535  Brains[0].Picture.SetSize(64, 64);
    536   BitBlt(Brains[0].Picture.Canvas.Handle, 0, 0, 64, 64,
    537     GrExt[HGrSystem2].Data.Canvas.Handle, 1, 111, SRCCOPY);
     536  BitBltCanvas(Brains[0].Picture.Canvas, 0, 0, 64, 64,
     537    GrExt[HGrSystem2].Data.Canvas, 1, 111);
    538538  Brains[1].Picture := TBitmap.Create;
    539539  Brains[1].Picture.SetSize(64, 64);
    540   BitBlt(Brains[1].Picture.Canvas.Handle, 0, 0, 64, 64,
    541     GrExt[HGrSystem2].Data.Canvas.Handle, 66, 111, SRCCOPY);
     540  BitBltCanvas(Brains[1].Picture.Canvas, 0, 0, 64, 64,
     541    GrExt[HGrSystem2].Data.Canvas, 66, 111);
    542542  Brains[2].Picture := TBitmap.Create;
    543543  Brains[2].Picture.SetSize(64, 64);
    544   BitBlt(Brains[2].Picture.Canvas.Handle, 0, 0, 64, 64,
    545     GrExt[HGrSystem2].Data.Canvas.Handle, 131, 111, SRCCOPY);
     544  BitBltCanvas(Brains[2].Picture.Canvas, 0, 0, 64, 64,
     545    GrExt[HGrSystem2].Data.Canvas, 131, 111);
    546546  Brains[3].Picture := TBitmap.Create;
    547547  Brains[3].Picture.SetSize(64, 64);
    548   BitBlt(Brains[3].Picture.Canvas.Handle, 0, 0, 64, 64,
    549     GrExt[HGrSystem2].Data.Canvas.Handle, 131, 46, SRCCOPY);
     548  BitBltCanvas(Brains[3].Picture.Canvas, 0, 0, 64, 64,
     549    GrExt[HGrSystem2].Data.Canvas, 131, 46);
    550550
    551551  AIBrains := TBrains.Create(False);
     
    699699    $000000, xAction, y + 21, Phrases2.Lookup(TextItem));
    700700  BitBltCanvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas,
    701     xActionIcon - 2, y - 2, SRCCOPY);
     701    xActionIcon - 2, y - 2);
    702702  GlowFrame(LogoBuffer, 8, 8, 34, 34, $202020);
    703   BitBlt(Canvas.Handle, xActionIcon - 2, y - 2, 50, 50,
    704     LogoBuffer.Canvas.Handle, 0, 0, SRCCOPY);
    705   BitBlt(Canvas.Handle, xActionIcon, y, 40, 40, BigImp.Canvas.Handle,
    706     (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig, SRCCOPY);
     703  BitBltCanvas(Canvas, xActionIcon - 2, y - 2, 50, 50,
     704    LogoBuffer.Canvas, 0, 0);
     705  BitBltCanvas(Canvas, xActionIcon, y, 40, 40, BigImp.Canvas,
     706    (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig);
    707707  RFrame(Canvas, xActionIcon - 1, y - 1, xActionIcon + 40, y + 40,
    708708    $000000, $000000);
     
    795795      MainTexture.clBevelShade); // Tab shadow
    796796  BitBltCanvas(LogoBuffer.Canvas, 0, 0, 36, 36, Canvas, 6,
    797     3 + 2 * integer(Tab <> tbMain), SRCCOPY);
     797    3 + 2 * integer(Tab <> tbMain));
    798798
    799799  ImageOp_BCC(LogoBuffer, Templates, 0, 0, 145, 38, 36, 27, $BFBF20, $4040DF);
     
    801801  ImageOp_BCC(LogoBuffer, Templates, 10, 27, 155, 38 + 27, 26, 9, $BFBF20,
    802802    $4040DF); // logo part 2
    803   BitBlt(Canvas.Handle, 6, 3 + 2 * integer(Tab <> tbMain), 36, 36,
    804     LogoBuffer.Canvas.Handle, 0, 0, SRCCOPY);
     803  BitBltCanvas(Canvas, 6, 3 + 2 * integer(Tab <> tbMain), 36, 36,
     804    LogoBuffer.Canvas, 0, 0);
    805805
    806806  if Page = pgMain then
     
    819819        BitBltCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,
    820820          ActionSideBorder + i * wBuffer, yAction + Integer(SelectedAction) * ActionPitch
    821           - 8, SRCCOPY);
     821          - 8);
    822822        MakeBlue(LogoBuffer, 0, 0, w, h);
    823         BitBlt(Canvas.Handle, ActionSideBorder + i * wBuffer,
     823        BitBltCanvas(Canvas, ActionSideBorder + i * wBuffer,
    824824          yAction + Integer(SelectedAction) * ActionPitch - 8, w, h,
    825           LogoBuffer.Canvas.Handle, 0, 0, SRCCOPY);
     825          LogoBuffer.Canvas, 0, 0);
    826826      end;
    827827    y := yAction;
     
    846846              Canvas.Font.Assign(UniFont[ftNormal]);
    847847              BitBltCanvas(LogoBuffer.Canvas, 0, 0, 91, 25, Canvas,
    848                 xActionIcon, y + 2, SRCCOPY);
     848                xActionIcon, y + 2);
    849849              ImageOp_BCC(LogoBuffer, Templates, 0, 0, 1, 400, 91, 25, 0,
    850850                Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText]);
    851               BitBlt(Canvas.Handle, xActionIcon, y + 2, 91, 25,
    852                 LogoBuffer.Canvas.Handle, 0, 0, SRCCOPY);
     851              BitBltCanvas(Canvas, xActionIcon, y + 2, 91, 25,
     852                LogoBuffer.Canvas, 0, 0);
    853853            end;
    854854        end;
     
    874874        if (i < 13) or (i > 17) then
    875875        begin
    876           BitBlt(Canvas.Handle, 9 + i * 27, yLogo - 2, wOrna, hOrna,
    877             GrExt[HGrSystem2].Mask.Canvas.Handle, xOrna, yOrna, SRCAND);
    878           BitBlt(Canvas.Handle, 9 + i * 27, yLogo - 2, wOrna, hOrna,
    879             GrExt[HGrSystem2].Data.Canvas.Handle, xOrna, yOrna, SRCPAINT);
     876          BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna,
     877            GrExt[HGrSystem2].Mask.Canvas, xOrna, yOrna, SRCAND);
     878          BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna,
     879            GrExt[HGrSystem2].Data.Canvas, xOrna, yOrna, SRCPAINT);
    880880        end;
    881881      PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.clBevelLight,
     
    893893          if Assigned(PlayersBrain[I]) and (PlayersBrain[i].Kind in [btTerm, btRandom, btAI]) then
    894894          begin
    895             BitBlt(Canvas.Handle, xBrain[i] - 18, yBrain[i] + 19, 12, 14,
    896               GrExt[HGrSystem].Data.Canvas.Handle, 134 + (Difficulty[i] - 1) *
    897               13, 28, SRCCOPY);
     895            BitBltCanvas(Canvas, xBrain[i] - 18, yBrain[i] + 19, 12, 14,
     896              GrExt[HGrSystem].Data.Canvas, 134 + (Difficulty[i] - 1) *
     897              13, 28);
    898898            Frame(Canvas, xBrain[i] - 19, yBrain[i] + 18, xBrain[i] - 18 + 12,
    899899              yBrain[i] + (19 + 14), $000000, $000000);
     
    913913                PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12,
    914914                MainTexture.clBevelShade, MainTexture.clBevelLight);
    915               BitBlt(Canvas.Handle, xBrain[i] - 31, yBrain[i], 13, 12,
    916                 GrExt[HGrSystem].Data.Canvas.Handle, 88, 47, SRCCOPY);
     915              BitBltCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12,
     916                GrExt[HGrSystem].Data.Canvas, 88, 47);
    917917            end;
    918918          end;
     
    958958        if (i < 2) or (i > 6) then
    959959        begin
    960           BitBlt(Canvas.Handle, 9 + i * 27, yLogo - 2, wOrna, hOrna,
    961             GrExt[HGrSystem2].Mask.Canvas.Handle, xOrna, yOrna, SRCAND);
    962           BitBlt(Canvas.Handle, 9 + i * 27, yLogo - 2, wOrna, hOrna,
    963             GrExt[HGrSystem2].Data.Canvas.Handle, xOrna, yOrna, SRCPAINT);
     960          BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna,
     961            GrExt[HGrSystem2].Mask.Canvas, xOrna, yOrna, SRCAND);
     962          BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna,
     963            GrExt[HGrSystem2].Data.Canvas, xOrna, yOrna, SRCPAINT);
    964964        end;
    965965      PaintLogo(Canvas, 69, yLogo, MainTexture.clBevelLight,
     
    10541054  if MiniMap.Mode = mmPicture then
    10551055  begin
    1056     BitBlt(Canvas.Handle, xMini + 2, yMini + 2, MiniMap.Size.X * 2, MiniMap.Size.Y,
    1057       MiniMap.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
     1056    BitBltCanvas(Canvas, xMini + 2, yMini + 2, MiniMap.Size.X * 2, MiniMap.Size.Y,
     1057      MiniMap.Bitmap.Canvas, 0, 0);
    10581058    if Page = pgStartRandom then
    10591059      s := Phrases.Lookup('RANMAP')
Note: See TracChangeset for help on using the changeset viewer.