Last change
on this file was 3, checked in by chronos, 9 years ago |
- Added: Classes for decoding MAP, CPS, SHP and ENG file formats.
|
File size:
1.3 KB
|
Line | |
---|
1 | unit UFormMain;
|
---|
2 |
|
---|
3 | {$mode delphi}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
---|
9 | LCLType, types;
|
---|
10 |
|
---|
11 | type
|
---|
12 |
|
---|
13 | { TFormMain }
|
---|
14 |
|
---|
15 | TFormMain = class(TForm)
|
---|
16 | PaintBox1: TPaintBox;
|
---|
17 | procedure FormActivate(Sender: TObject);
|
---|
18 | procedure FormKeyPress(Sender: TObject; var Key: char);
|
---|
19 | procedure PaintBox1Click(Sender: TObject);
|
---|
20 | procedure PaintBox1Paint(Sender: TObject);
|
---|
21 | private
|
---|
22 | Initialized: Boolean;
|
---|
23 | public
|
---|
24 | procedure EraseBackground(DC: HDC); override;
|
---|
25 | end;
|
---|
26 |
|
---|
27 | var
|
---|
28 | FormMain: TFormMain;
|
---|
29 |
|
---|
30 | implementation
|
---|
31 |
|
---|
32 | {$R *.lfm}
|
---|
33 |
|
---|
34 | uses
|
---|
35 | UCore;
|
---|
36 |
|
---|
37 | { TFormMain }
|
---|
38 |
|
---|
39 | procedure TFormMain.PaintBox1Click(Sender: TObject);
|
---|
40 | begin
|
---|
41 |
|
---|
42 | end;
|
---|
43 |
|
---|
44 | procedure TFormMain.PaintBox1Paint(Sender: TObject);
|
---|
45 | begin
|
---|
46 | Core.Game.Paint(PaintBox1.Canvas);
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TFormMain.FormActivate(Sender: TObject);
|
---|
50 | begin
|
---|
51 | if not Initialized then begin
|
---|
52 | Initialized := True;
|
---|
53 | Core.Init;
|
---|
54 | end;
|
---|
55 | end;
|
---|
56 |
|
---|
57 | procedure TFormMain.FormKeyPress(Sender: TObject; var Key: char);
|
---|
58 | begin
|
---|
59 | Caption := IntToStr(Ord(Key));
|
---|
60 | if Key = #63 then begin
|
---|
61 | Inc(Core.Game.IW);
|
---|
62 | core.Game.LoadData;
|
---|
63 | PaintBox1.Repaint;
|
---|
64 | end;
|
---|
65 | if Key = #41 then begin
|
---|
66 | Dec(Core.Game.IW);
|
---|
67 | core.Game.LoadData;
|
---|
68 | PaintBox1.Repaint;
|
---|
69 | end;
|
---|
70 | end;
|
---|
71 |
|
---|
72 | procedure TFormMain.EraseBackground(DC: HDC);
|
---|
73 | begin
|
---|
74 | // Do not redraw background
|
---|
75 | end;
|
---|
76 |
|
---|
77 | end.
|
---|
78 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.