Ignore:
Timestamp:
Nov 10, 2018, 7:47:29 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Wrong drawing of wonders dialog.
  • Modified: Use separate offscreen bitmap for each TBufferedDrawDlg dialog.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/BaseWin.pas

    r118 r155  
    99
    1010type
     11
     12  { TBufferedDrawDlg }
     13
    1114  TBufferedDrawDlg = class(TDrawDlg)
    1215  public
    1316    UserLeft, UserTop: integer;
    1417    constructor Create(AOwner: TComponent); override;
     18    destructor Destroy; override;
    1519    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    1620    procedure FormPaint(Sender: TObject);
     
    2731    procedure VPaint; virtual;
    2832  public
     33    UsedOffscreenWidth, UsedOffscreenHeight: integer;
     34    Offscreen: TBitmap;
     35    OffscreenUser: TForm;
    2936    property WindowMode: integer read FWindowMode;
    3037  end;
     
    5562  SideFrame = 9;
    5663
    57 var
    58   UsedOffscreenWidth, UsedOffscreenHeight: integer;
    59   Offscreen: TBitmap;
    60   OffscreenUser: TForm;
    61 
    62 procedure CreateOffscreen;
     64procedure CreateOffscreen(var Offscreen: TBitmap);
    6365
    6466implementation
     
    6769  Term, Help, ButtonBase, Area;
    6870
    69 constructor TBufferedDrawDlg.Create;
    70 begin
     71constructor TBufferedDrawDlg.Create(AOwner: TComponent);
     72begin
     73  BaseWin.CreateOffscreen(Offscreen);
    7174  OnClose := FormClose;
    7275  OnPaint := FormPaint;
     
    8083  UserLeft := (Screen.Width - Width) div 2;
    8184  UserTop := (Screen.Height - Height) div 2;
     85end;
     86
     87destructor TBufferedDrawDlg.Destroy;
     88begin
     89  Offscreen.Free;
     90  inherited Destroy;
    8291end;
    8392
     
    464473end;
    465474
    466 procedure CreateOffscreen;
     475procedure CreateOffscreen(var Offscreen: TBitmap);
    467476begin
    468477  if Offscreen <> nil then
     
    480489initialization
    481490
    482 Offscreen := nil;
    483 OffscreenUser := nil;
    484 
    485491finalization
    486492
    487 Offscreen.Free;
    488 
    489493end.
Note: See TracChangeset for help on using the changeset viewer.