Changeset 514 for trunk/Start.pas
- Timestamp:
- Jan 3, 2024, 3:05:32 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r511 r514 114 114 FormerGames: TStringList; 115 115 Maps: TStringList; 116 LogoBuffer: TBitmap;117 116 // BookDate: string; 118 117 PlayerSlots: TPlayerSlots; … … 181 180 ActionSideBorder = 24; 182 181 ActionBottomBorder = 10; 183 wBuffer = 91;184 182 x0Mini = 437; 185 183 y0Mini = 178; … … 308 306 EmptyPicture.SetSize(64, 64); 309 307 EmptyPicture.Canvas.FillRect(0, 0, EmptyPicture.Width, EmptyPicture.Height); 310 LogoBuffer := TBitmap.Create;311 LogoBuffer.PixelFormat := TPixelFormat.pf24bit;312 LogoBuffer.SetSize(wBuffer, 56);313 LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);314 308 315 309 MiniMap := TMiniMap.Create; … … 336 330 FreeAndNil(Maps); 337 331 FreeAndNil(EmptyPicture); 338 FreeAndNil(LogoBuffer);339 332 FreeAndNil(PlayerSlots); 340 333 FreeAndNil(MiniMap); … … 537 530 $000000, xAction, Y + 21, Phrases2.Lookup(TextItem)); 538 531 539 UnshareBitmap(LogoBuffer); 540 BitBltCanvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas, 532 UnshareBitmap(DrawBuffer); 533 DrawBufferEnsureSize(50, 50); 534 BitBltCanvas(DrawBuffer.Canvas, 0, 0, 50, 50, Canvas, 541 535 xActionIcon - 2, Y - 2); 542 GlowFrame( LogoBuffer, 8, 8, 34, 34, $202020);536 GlowFrame(DrawBuffer, 8, 8, 34, 34, $202020); 543 537 BitBltCanvas(Canvas, xActionIcon - 2, Y - 2, 50, 50, 544 LogoBuffer.Canvas, 0, 0);538 DrawBuffer.Canvas, 0, 0); 545 539 BitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas, 546 540 (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig); … … 637 631 638 632 // Paint menu logo 639 UnshareBitmap(LogoBuffer); 640 BitBltCanvas(LogoBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6, 633 UnshareBitmap(DrawBuffer); 634 DrawBufferEnsureSize(MenuLogo.Width, MenuLogo.Height); 635 BitBltCanvas(DrawBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6, 641 636 3 + 2 * Integer(Tab <> tbMain)); 642 637 643 ImageOp_BCC( LogoBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top,638 ImageOp_BCC(DrawBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top, 644 639 MenuLogo.Width, MenuLogo.Height - 9, $BFBF20, $4040DF); // logo part 1 645 ImageOp_BCC( LogoBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10,640 ImageOp_BCC(DrawBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10, 646 641 MenuLogo.Top + 27, MenuLogo.Width - 10, 9, $BFBF20, $4040DF); // logo part 2 647 642 BitBltCanvas(Canvas, 6, 3 + 2 * Integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height, 648 LogoBuffer.Canvas, 0, 0);643 DrawBuffer.Canvas, 0, 0); 649 644 650 645 if Page = pgMain then begin 651 if SelectedAction <> maNone then // mark selected action 652 for I := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do 653 begin 654 W := ClientWidth - 2 * ActionSideBorder - I * wBuffer; 655 if W > wBuffer then 656 W := wBuffer; 657 H := ActionPitch; 658 if yAction + Integer(SelectedAction) * ActionPitch - 8 + H > ClientHeight - ActionBottomBorder 659 then 660 H := ClientHeight - ActionBottomBorder - 661 (yAction + Integer(SelectedAction) * ActionPitch - 8); 662 663 UnshareBitmap(LogoBuffer); 664 BitBltCanvas(LogoBuffer.Canvas, 0, 0, W, H, Canvas, 665 ActionSideBorder + I * wBuffer, yAction + Integer(SelectedAction) * ActionPitch 666 - 8); 667 MakeBlue(LogoBuffer, 0, 0, W, H); 668 BitBltCanvas(Canvas, ActionSideBorder + I * wBuffer, 669 yAction + Integer(SelectedAction) * ActionPitch - 8, W, H, 670 LogoBuffer.Canvas, 0, 0); 671 end; 646 if SelectedAction <> maNone then begin 647 // Mark selected action 648 W := ClientWidth - 2 * ActionSideBorder; 649 H := ActionPitch; 650 if yAction + Integer(SelectedAction) * ActionPitch - 8 + H > ClientHeight - ActionBottomBorder 651 then 652 H := ClientHeight - ActionBottomBorder - 653 (yAction + Integer(SelectedAction) * ActionPitch - 8); 654 655 UnshareBitmap(DrawBuffer); 656 DrawBufferEnsureSize(W, H); 657 BitBltCanvas(DrawBuffer.Canvas, 0, 0, W, H, Canvas, 658 ActionSideBorder, yAction + Integer(SelectedAction) * ActionPitch - 8); 659 MakeBlue(DrawBuffer, 0, 0, W, H); 660 BitBltCanvas(Canvas, ActionSideBorder, yAction + Integer(SelectedAction) * 661 ActionPitch - 8, W, H, DrawBuffer.Canvas, 0, 0); 662 end; 672 663 Y := yAction; 673 664 for MainAction := Low(TMainActionSet) to High(TMainActionSet) do … … 687 678 Canvas.Font.Assign(UniFont[ftNormal]); 688 679 689 UnshareBitmap(LogoBuffer); 690 BitBltCanvas(LogoBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas, 680 UnshareBitmap(DrawBuffer); 681 DrawBufferEnsureSize(LinkArrows.Width, LinkArrows.Height); 682 BitBltCanvas(DrawBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas, 691 683 xActionIcon, Y + 2); 692 ImageOp_BCC( LogoBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0,684 ImageOp_BCC(DrawBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0, 693 685 Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText]); 694 686 BitBltCanvas(Canvas, xActionIcon, Y + 2, LinkArrows.Width, LinkArrows.Height, 695 LogoBuffer.Canvas, 0, 0);687 DrawBuffer.Canvas, 0, 0); 696 688 end; 697 689 end;
Note:
See TracChangeset
for help on using the changeset viewer.