]> icculus.org git repositories - taylor/freespace2.git/blob - include/hudconfig.h
fix issue with looping audio streams
[taylor/freespace2.git] / include / hudconfig.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Hud/HUDconfig.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for HUD configuration
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:13  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
25  * 4     8/02/99 9:55p Dave
26  * Hardcode a nice hud color config for the demo.
27  * 
28  * 3     6/08/99 1:14a Dave
29  * Multi colored hud test.
30  * 
31  * 2     10/07/98 10:53a Dave
32  * Initial checkin.
33  * 
34  * 1     10/07/98 10:49a Dave
35  * 
36  * 30    4/29/98 6:00p Dave
37  * Fixed chatbox font colors. Made observer offscreen indicators work.
38  * Numerous small UI fixes. Fix rank limitations for mp games. 
39  * 
40  * 29    4/16/98 4:07p Hoffoss
41  * Fixed bug with palette reseting when loading a new pilot.  Also made
42  * barracks default to palette merging mode.
43  * 
44  * 28    4/14/98 6:16p Lawrance
45  * Fix bug that was preventing non-green HUD color from getting set.
46  * 
47  * 27    3/26/98 5:45p Lawrance
48  * Added new gauges to HUD config
49  * 
50  * 26    3/12/98 5:45p Dave
51  * Put in new observer HUD. Made it possible for observers to join at the
52  * beginning of a game and follow it around as an observer full-time.
53  * 
54  * 25    2/22/98 4:17p John
55  * More string externalization classification... 190 left to go!
56  * 
57  * 24    1/28/98 6:19p Dave
58  * Reduced standalone memory usage ~8 megs. Put in support for handling
59  * multiplayer submenu handling for endgame, etc.
60  * 
61  * 23    1/18/98 5:09p Lawrance
62  * Added support for TEAM_TRAITOR
63  * 
64  * 22    1/17/98 10:02p Lawrance
65  * Fix bug with damage popup that would sometimes display with <none>.
66  * 
67  * 21    1/14/98 11:07p Lawrance
68  * Hook in brightness slider to HUD config.
69  * 
70  * 20    1/13/98 5:33p Lawrance
71  * Tweaking HUD config.
72  * 
73  * 19    1/12/98 11:16p Lawrance
74  * Wonderful HUD config.
75  * 
76  * 18    1/10/98 12:41a Lawrance
77  * start work on new HUD config
78  * 
79  * 17    1/05/98 9:38p Lawrance
80  * Implement flashing HUD gauges.
81  * 
82  * 16    12/16/97 9:13p Lawrance
83  * Integrate new gauges into HUD config.
84  * 
85  * 15    11/06/97 5:01p Dave
86  * Finished reworking standalone multiplayer sequencing. Put in
87  * configurable observer-mode HUD.
88  * 
89  * 14    11/06/97 9:53a Dave
90  * 
91  * 13    11/03/97 5:38p Dave
92  * Cleaned up more multiplayer sequencing. Added OBJ_OBSERVER module/type.
93  * Restructured HUD_config structs/flags.
94  * 
95  * 12    10/28/97 12:43a Lawrance
96  * fix bug that was not setting HUD config correctly when a new pilot was
97  * made
98  * 
99  * 11    9/22/97 11:46p Lawrance
100  * make default radar range infinity
101  * 
102  * 10    9/06/97 2:13p Mike
103  * Replace support for TEAM_NEUTRAL
104  * 
105  * 9     8/31/97 6:38p Lawrance
106  * pass in frametime to do_frame loop
107  * 
108  * 8     5/26/97 5:49p Lawrance
109  * supporting max range on radar
110  * 
111  * 7     3/26/97 8:56a Lawrance
112  * removing target and game debug flags from HUD config
113  * 
114  * 6     3/19/97 5:53p Lawrance
115  * integrating new Misc_sounds[] array (replaces old Game_sounds
116  * structure)
117  * 
118  * 5     1/28/97 5:33p Lawrance
119  * saving number of msg window lines in save game and player file
120  * 
121  * 4     12/10/96 4:18p Lawrance
122  * took out In_hud_config and use game state instead
123  * 
124  * 3     12/08/96 1:54a Lawrance
125  * integrating hud configuration
126  * 
127  * 2     11/29/96 6:10p Lawrance
128  * HUD configuration working
129  *
130  * $NoKeywords: $
131  *
132 */
133
134 #ifndef _HUDCONFIG_H
135 #define _HUDCONFIG_H
136
137 #include "hud.h"
138 #include "player.h"
139
140 #define HUD_COLOR_GREEN         0
141 #define HUD_COLOR_BLUE          1
142 #define HUD_COLOR_AMBER         2
143
144 // specify the max distance that the radar should detect objects
145 // Index in Radar_ranges[] array to get values
146
147 #define RR_MAX_RANGES           3                               // keep up to date
148 #define RR_SHORT                                0
149 #define RR_LONG                         1       
150 #define RR_INFINITY                     2
151 extern float Radar_ranges[RR_MAX_RANGES];
152 extern const char *Radar_range_text(int range_num);
153
154 #define RP_SHOW_DEBRIS                                          (1<<0)
155 #define RP_SHOW_FRIENDLY_MISSILES               (1<<1)
156 #define RP_SHOW_HOSTILE_MISSILES                        (1<<2)
157
158 #define RP_DEFAULT ( RP_SHOW_DEBRIS | RP_SHOW_FRIENDLY_MISSILES | RP_SHOW_HOSTILE_MISSILES )
159
160 extern int HUD_observer_default_flags;
161 extern int HUD_observer_default_flags2;
162 extern int HUD_default_popup_mask;
163 extern int HUD_default_popup_mask2;
164 extern int HUD_config_default_flags;
165 extern int HUD_config_default_flags2;
166
167 typedef struct HUD_CONFIG_TYPE {                
168         int show_flags;                         // whether to show gauge
169         int show_flags2;                                // whether to show gauge
170         int popup_flags;                                // whether gauge is popup       
171         int popup_flags2;                               // whether gauge is popup               
172         int num_msg_window_lines;       
173         int rp_flags;                                   // see RP_ flags above
174         int rp_dist;                                    // one of RR_ #defines above
175         int is_observer;                                // 1 or 0, observer mode or not, respectively
176         int main_color;                         // the main color
177
178         // colors for all the gauges
179         color clr[NUM_HUD_GAUGES];
180 } HUD_CONFIG_TYPE;
181
182 extern HUD_CONFIG_TYPE HUD_config;
183
184 void hud_config_init();
185 void hud_config_do_frame(float frametime);
186 void hud_config_close();
187
188 void hud_set_default_hud_config(player *p);
189 void hud_config_set_gauge_flags(int gauge_index, int on_flag, int popup_flag);
190
191 void hud_config_restore();
192 void hud_config_backup();
193 void hud_config_as_observer(ship *shipp,ai_info *aif);
194
195
196 void hud_config_as_observer();
197 void hud_config_as_player();
198 void hud_config_display_text(const char* gauge_text, int x, int y);
199 void hud_set_display_gauge_cbox();
200
201 // leave hud config without accepting changes
202 void hud_config_cancel();
203
204 // leave hud config with accepting changes
205 void hud_config_commit();
206
207 // flag access/manipulation routines
208 int     hud_config_show_flag_is_set(int i);;
209 void    hud_config_show_flag_set(int i);
210 void    hud_config_show_flag_clear(int i);
211 int     hud_config_popup_flag_is_set(int i);
212 void    hud_config_popup_flag_set(int i);
213 void    hud_config_popup_flag_clear(int i);
214
215 void hud_config_record_color(int color);
216
217 // load up the given hcf file
218 void hud_config_color_load(const char *name);
219
220 #endif
221