Changeset 6 for trunk/Back.pas


Ignore:
Timestamp:
Jan 7, 2017, 11:32:14 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Formated all project source files using Delphi formatter as original indentation and other formatting was really bad.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Back.pas

    r2 r6  
    11{$INCLUDE switches}
    2 
    32unit Back;
    43
     
    2423
    2524uses
    26 Directories,ScreenTools,Start;
     25  Directories, ScreenTools, Start;
    2726
    2827{$R *.DFM}
     
    3029procedure TBackground.FormCreate(Sender: TObject);
    3130begin
    32 img:=nil;
     31  img := nil;
    3332end;
    3433
    3534procedure TBackground.FormShow(Sender: TObject);
    3635begin
    37 img:=nil;
    38 if FullScreen then
     36  img := nil;
     37  if FullScreen then
    3938  begin
    40   if FileExists(HomeDir+'Graphics\Background.bmp')
    41     or FileExists(HomeDir+'Graphics\Background.png') then
     39    if FileExists(HomeDir + 'Graphics\Background.bmp') or
     40      FileExists(HomeDir + 'Graphics\Background.png') then
    4241    begin
    43     img:=TBitmap.Create;
    44     LoadGraphicFile(img, HomeDir+'Graphics\Background');
     42      img := TBitmap.Create;
     43      LoadGraphicFile(img, HomeDir + 'Graphics\Background');
    4544    end
    4645  end
    47 else
     46  else
    4847  begin
    49   WindowState:=wsNormal;
    50   Width:=StartDlg.Width+16;
    51   Height:=StartDlg.Height+16;
    52   Left:=StartDlg.Left-8;
    53   Top:=StartDlg.Top-8;
     48    WindowState := wsNormal;
     49    Width := StartDlg.Width + 16;
     50    Height := StartDlg.Height + 16;
     51    Left := StartDlg.Left - 8;
     52    Top := StartDlg.Top - 8;
    5453  end
    5554end;
     
    5756procedure TBackground.FormPaint(Sender: TObject);
    5857begin
    59 if img<>nil then
    60   BitBlt(Canvas.Handle,
    61     Screen.Width-img.Width-(Screen.Width-800)*3 div 8,
    62     (Screen.Height-600) div 3,
    63     img.Width,img.Height,
    64     img.Canvas.Handle,0,0,SRCCOPY);
     58  if img <> nil then
     59    BitBlt(Canvas.Handle, Screen.Width - img.Width - (Screen.Width - 800) *
     60      3 div 8, (Screen.Height - 600) div 3, img.Width, img.Height,
     61      img.Canvas.Handle, 0, 0, SRCCOPY);
    6562end;
    6663
    6764procedure TBackground.FormClose(Sender: TObject; var Action: TCloseAction);
    6865begin
    69 if img<>nil then begin img.Free; img:=nil end;
     66  if img <> nil then
     67  begin
     68    img.Free;
     69    img := nil
     70  end;
    7071end;
    7172
    7273end.
    73 
Note: See TracChangeset for help on using the changeset viewer.