1 /*--------------------------------------------------------------------------
2
3 REVERSEM :
4
5 UNIT : GRAPHICS CONTROL
6
7 COPYRIGHT (C) 1994 Erich P. Gatejen ALL RIGHTS RESERVED
8 This is Freeware. You may distribute it as you wish. However, you may not
9 distribute a modified version without my consent.
10
11 Feel free to cut and paste any algorthm.
12
13 NOTE: XTILE is (C) 1992, 1994 by myself. It is NOT freeware. You may use
14 it for personal projects, but otherwise, it is not to be distributed
15 outside this REVERSEM package. (Contact me if you wish to do
16 otherwise)
17
18 ---------------------------------------------------------------------------*/
19
20 #include"mypic.hpp"
21
22
23 // --- Definitions ---------------------------------------------------------
24
25 // --- Define possible user actions
26 enum USER_ACTION { NO_ACTION = 0,
27 CLICK_BRAIN1,
28 CLICK_BRAIN2,
29 CLICK_BRAIN3,
30 CLICK_BRAIN4,
31 CLICK_BRAIN5,
32 CLICK_BRAIN6,
33 CLICK_BOARD,
34 CLICK_HELP,
35 CLICK_NEW,
36 CLICK_DONE,
37 CLICK_PICTURE
38 };
39
40 // --- Main buttons
41 enum MAIN_BUTTONS { HELP_BUTTON = 0,
42 NEW_BUTTON,
43 DONE_BUTTON
44 };
45
46
47 // --- Graphics control class -----------------------------------------------
48 class GraphicsControl {
49
50 BRAIN BrainButtonState;
51
52 // Private functions
53 void InitTGAHooks( void );
54 int MouseView( void );
55 USER_ACTION ParseMouseCkick( Go& AGo );
56
57 public:
58
59 // --- The my picture class
60 MyPicture Me;
61
62 // Constructor and Destructor
63 GraphicsControl( void );
64 ~GraphicsControl();
65
66 // Primary routines
67 void InitMainScreen( void );
68 void ShowBoard( Board TheBoard );
69 USER_ACTION WaitUser( Go& AGo );
70
71 // Brain level buttons
72 void BrainSetting( BRAIN Setting );
73
74 // Button control
75 void PushMainButton( MAIN_BUTTONS TheButton );
76 void PopMainButton( MAIN_BUTTONS TheButton );
77
78 // Pop ups
79 BOOLEAN WhoFirst( void ); // Return TRUE if player first
80 BOOLEAN YouSure( void ); // Return TRUE if player is sure
81 void YouMustPass( void );
82
83 // Spot items
84 void ShowValidMoves( Board TheBoard );
85 void Here( Go TheGo );
86
87 // Show the score
88 void Score( int TheScore );
89 };
90
91
|