1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef BORDER_FRAME_HH
|
---|
10 | #define BORDER_FRAME_HH
|
---|
11 |
|
---|
12 |
|
---|
13 | #include "window/window.hh"
|
---|
14 | #include "string/string.hh"
|
---|
15 | #include "memory/array.hh"
|
---|
16 | #include "window/colorwin.hh"
|
---|
17 |
|
---|
18 | class i4_button_class;
|
---|
19 | class i4_image_class;
|
---|
20 | class i4_graphical_style_class;
|
---|
21 |
|
---|
22 | // this window is responsible for drawing the border area around the game window's
|
---|
23 | // it also loads the board frame from disk when need. My hope is that during the normal
|
---|
24 | // game it can free up the memory associated with the border.
|
---|
25 | class g1_border_frame_class : public i4_color_window_class
|
---|
26 | {
|
---|
27 | public:
|
---|
28 |
|
---|
29 |
|
---|
30 | private:
|
---|
31 |
|
---|
32 | enum
|
---|
33 | {
|
---|
34 | OPTIONS,
|
---|
35 | BUILD_FIRST, BUILD_LAST=BUILD_FIRST+0x1000,
|
---|
36 | ACTIVE_FIRST, ACTIVE_LAST=ACTIVE_FIRST+0x1000
|
---|
37 | };
|
---|
38 |
|
---|
39 | // left justify draw number with commas if needed
|
---|
40 |
|
---|
41 |
|
---|
42 | enum { REFRESH_FRAME=1,
|
---|
43 | REFRESH_ALL=REFRESH_FRAME*2-1
|
---|
44 | };
|
---|
45 |
|
---|
46 | struct last_struct
|
---|
47 | {
|
---|
48 | int money, ammo[4], cost, frame_upgrade_level;
|
---|
49 | int lives;
|
---|
50 | last_struct() { memset(this, 0, sizeof(*this)); }
|
---|
51 | } last;
|
---|
52 |
|
---|
53 |
|
---|
54 | int refresh;
|
---|
55 | void reparent(i4_image_class *draw_area, i4_parent_window_class *parent);
|
---|
56 |
|
---|
57 | public:
|
---|
58 | int border_x();
|
---|
59 | int border_y();
|
---|
60 |
|
---|
61 | void relocate(i4_parent_window_class *w, char *loc, int x, int y);
|
---|
62 |
|
---|
63 | void resize_controller(int shrink_add);
|
---|
64 |
|
---|
65 | int shrink; // how many pixels the 3d view is shrinked in for speed-up
|
---|
66 | i4_image_class *frame;
|
---|
67 |
|
---|
68 | i4_bool mouse_grabbed;
|
---|
69 |
|
---|
70 | i4_window_class *strategy_window;
|
---|
71 | i4_window_class *controller_window;
|
---|
72 | i4_window_class *radar_window;
|
---|
73 |
|
---|
74 | void set_strategy_on_top(i4_bool v);
|
---|
75 | i4_bool strategy_on_top;
|
---|
76 |
|
---|
77 | void update(); // check for changes in the game
|
---|
78 |
|
---|
79 | g1_border_frame_class();
|
---|
80 |
|
---|
81 | virtual void parent_draw(i4_draw_context_class &context);
|
---|
82 | virtual void draw(i4_draw_context_class &context);
|
---|
83 |
|
---|
84 | void receive_event(i4_event *ev);
|
---|
85 |
|
---|
86 | ~g1_border_frame_class();
|
---|
87 | char *name() { return "border_frame"; }
|
---|
88 |
|
---|
89 | };
|
---|
90 |
|
---|
91 |
|
---|
92 | class g1_strategy_screen_class : public i4_color_window_class
|
---|
93 | {
|
---|
94 | enum { OPTIONS, BUILD=1, ACTIVE=100 };
|
---|
95 | i4_array<i4_button_class *> build_buttons;
|
---|
96 |
|
---|
97 | public:
|
---|
98 | int border_x();
|
---|
99 | int border_y();
|
---|
100 | int shrink; // how many pixels the 3d view is shrinked in for speed-up
|
---|
101 | i4_image_class *frame;
|
---|
102 |
|
---|
103 | void create_build_buttons();
|
---|
104 |
|
---|
105 | virtual void parent_draw(i4_draw_context_class &context);
|
---|
106 | g1_strategy_screen_class();
|
---|
107 | void receive_event(i4_event *ev);
|
---|
108 | char *name() { return "strategy_screen"; }
|
---|
109 | };
|
---|
110 |
|
---|
111 |
|
---|
112 | extern i4_event_handler_reference_class<g1_border_frame_class> g1_border;
|
---|
113 | extern i4_event_handler_reference_class<g1_strategy_screen_class> g1_strategy_screen;
|
---|
114 |
|
---|
115 | w32 g1_get_upgrade_color(int upgrade_level); // used for font colors & border edges
|
---|
116 |
|
---|
117 |
|
---|
118 | class g1_help_screen_class : public i4_parent_window_class
|
---|
119 | {
|
---|
120 | i4_image_class *help;
|
---|
121 | w32 mess_id_to_send;
|
---|
122 | public:
|
---|
123 | char *name() { return "help screen"; }
|
---|
124 |
|
---|
125 | g1_help_screen_class(w16 w, w16 h,
|
---|
126 | i4_graphical_style_class *style,
|
---|
127 | const i4_const_str &image_name,
|
---|
128 | w32 mess_id_to_send);
|
---|
129 |
|
---|
130 | virtual void parent_draw(i4_draw_context_class &context);
|
---|
131 | void receive_event(i4_event *ev);
|
---|
132 | ~g1_help_screen_class();
|
---|
133 | };
|
---|
134 |
|
---|
135 | #endif
|
---|
136 |
|
---|
137 |
|
---|