]> icculus.org git repositories - taylor/freespace2.git/blob - include/missionshipchoice.h
proper padding of PXO stats struct for FS2 demo
[taylor/freespace2.git] / include / missionshipchoice.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/MissionUI/MissionShipChoice.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file to support functions that allow player ship selection for the mission
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:14  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  * 3     7/15/99 6:36p Jamesa
26  * Moved default ship name into the ships.tbl
27  * 
28  * 2     10/07/98 10:53a Dave
29  * Initial checkin.
30  * 
31  * 1     10/07/98 10:50a Dave
32  * 
33  * 21    3/05/98 5:03p Dave
34  * More work on team vs. team support for multiplayer. Need to fix bugs in
35  * weapon select.
36  * 
37  * 20    2/24/98 6:21p Lawrance
38  * Integrate new reset button into loadout screens
39  * 
40  * 19    2/18/98 3:56p Dave
41  * Several bugs fixed for mp team select screen. Put in standalone packet
42  * routing for team select.
43  * 
44  * 18    2/17/98 6:07p Dave
45  * Tore out old multiplayer team select screen, installed new one.
46  * 
47  * 17    1/15/98 4:11p Lawrance
48  * Add call to check if slot is player occupied.
49  * 
50  * 16    1/09/98 6:06p Dave
51  * Put in network sound support for multiplayer ship/weapon select
52  * screens. Made clients exit game correctly through warp effect. Fixed
53  * main hall menu help overlay bug.
54  * 
55  * 15    12/29/97 4:21p Lawrance
56  * Flash buttons on briefing/ship select/weapons loadout when enough time
57  * has elapsed without activity.
58  * 
59  * 14    12/24/97 1:19p Lawrance
60  * fix some bugs with the multiplayer ship/weapons loadout
61  * 
62  * 13    12/23/97 5:25p Allender
63  * more fixes to multiplayer ship selection.  Fixed strange reentrant
64  * problem with cf_callback when loading freespace data
65  * 
66  * 12    12/22/97 6:18p Lawrance
67  * Get save/restore of player loadout working with new code
68  * 
69  * 11    12/22/97 1:40a Lawrance
70  * Re-write ship select/weapons loadout to be multiplayer friendly
71  * 
72  * 10    12/19/97 1:23p Dave
73  * Put in multiplayer groundwork for new weapon/ship select screens.
74  * 
75  * 9     12/18/97 8:59p Dave
76  * Finished putting in basic support for weapon select and ship select in
77  * multiplayer.
78  * 
79  * 8     12/18/97 10:24a Lawrance
80  * Fix problem with ships having no weapons due to bogus weapons pools.
81  * 
82  * 7     12/08/97 9:37p Lawrance
83  * fix up auto-restore of player ship selection and weapons
84  * 
85  * 6     12/03/97 1:22p Lawrance
86  * implement saving/restoring of ship selection and weapons loadout
87  * 
88  * 5     12/02/97 10:51p Lawrance
89  * implement save/restore of ship selection and weapon loadouts
90  * 
91  * 4     11/27/97 10:03a Lawrance
92  * supporting SF_LOCKED flag
93  * 
94  * 3     10/04/97 5:56p Lawrance
95  * keep track of original ship class in ship selection
96  * 
97  * 2     10/04/97 12:00a Lawrance
98  * grey out background when help overlay is activated
99  * 
100  * 1     9/30/97 10:16a Lawrance
101  * move files from Mission lib to MissionUI lib
102  * 
103  * 34    9/25/97 3:49p Lawrance
104  * add a disabled icon to ship icon frame list
105  * 
106  * 33    9/24/97 11:43p Hoffoss
107  * Changed Parse_player to Team_data, removed the fields we don't want in
108  * it anymore, and fixed some code that had problems with that.
109  * 
110  * 32    9/24/97 5:03p Dave
111  * Spliced a bunch of stuff into MissionScreenCommon.[h,cpp]
112  * 
113  * 31    9/23/97 11:55p Lawrance
114  * add ss_return_name() function
115  * 
116  * 30    9/19/97 4:22p Allender
117  * externed some functions that multi team selection screen will use
118  * 
119  * 29    9/18/97 7:58a Lawrance
120  * fix some bugs associated with the player ship being created early on
121  * 
122  * 28    9/16/97 5:15p Allender
123  * fixed link problem with Fred
124  * 
125  * 27    9/07/97 10:04p Lawrance
126  * make drag/drop and selection work as Windows does with mouse-button up
127  * for selection
128  * 
129  * 26    8/30/97 12:24p Lawrance
130  * supporting animations in the weapons loadout screen, fixed some bugs
131  * 
132  * 25    8/29/97 7:33p Lawrance
133  * further work on weapons loadout
134  * 
135  * 24    8/24/97 5:24p Lawrance
136  * improve drawing of buttons 
137  * 
138  * 23    8/18/97 5:28p Lawrance
139  * integrating sounds for when mouse goes over an active control
140  * 
141  * 22    8/17/97 2:41p Lawrance
142  * improving interface
143  * 
144  * 21    8/15/97 8:00p Lawrance
145  * integrating new art for the briefing screens
146  * 
147  * 20    8/11/97 9:47p Lawrance
148  * get multiplayer chat window hooks working
149  * 
150  * 19    7/23/97 11:36a Lawrance
151  * support common buttons through the briefing/ship select/weapons
152  * loadout, be able to hide buttons when necessary
153  * 
154  * 18    7/21/97 11:41a Lawrance
155  * make playback time of .ani files keyed of frametime
156  * 
157  * 17    7/20/97 6:59p Lawrance
158  * changed name of some anim functions to be more consistent
159  * 
160  * 16    7/14/97 3:58p Lawrance
161  * limit frametime to 33 ms for animation timing
162  * 
163  * 15    6/26/97 12:12a Lawrance
164  * supporting anti-aliased bitmap animations
165  * 
166  * 14    6/24/97 11:46p Lawrance
167  * supporting icon text and rotating models
168  * 
169  * 13    6/12/97 11:09p Lawrance
170  * getting map and text integrated into briefing
171  * 
172  * 12    6/12/97 11:28a Lawrance
173  * separating FRED dependant code
174  * 
175  * 11    6/12/97 2:48a Lawrance
176  * integrating briefing into ship select / weapon loadout screen
177  * 
178  * 10    5/23/97 2:01p Lawrance
179  * added update_player_weapons()
180  * 
181  * 9     5/20/97 2:44p Allender
182  * move player ship creation into player_level_init which is done before
183  * most other things when a level loads
184  * 
185  * 8     3/28/97 12:09p Lawrance
186  * change create_default_player_ship() to allow the default to be the last
187  * ship the player has flown
188  * 
189  * 7     3/20/97 3:01p Lawrance
190  * made scroll buttons repeat action when held down, don't do button
191  * actions until down and release
192  * 
193  * 6     3/07/97 8:14p Lawrance
194  * added code to drag and drop to wing formations
195  * 
196  * 5     2/26/97 10:05a Lawrance
197  * move ship_create() to end of loop when commit pressed, so don't skip on
198  * animation
199  * 
200  * 4     2/25/97 11:11a Lawrance
201  * ship selection and weapon loadout interfaces working at basic level
202  * 
203  * 3     12/30/96 1:58a Lawrance
204  * supporting ship choice in multiplayer
205  * 
206  * 2     11/19/96 1:21p Lawrance
207  * got ship selection working inside out
208  *
209  * $NoKeywords: $
210  *
211 */
212
213 #ifndef __MISSIONSHIPCHOICE_H__
214 #define __MISSIONSHIPCHOICE_H__
215
216 #include "missionscreencommon.h"
217 #include "missionparse.h"
218
219 ///////////////////////////////////////////////////////
220 // Ships selection hot spots
221 ///////////////////////////////////////////////////////
222 #define SHIP_SELECT_SHIP_SCROLL_UP                              8
223 #define SHIP_SELECT_SHIP_SCROLL_DOWN                    9
224
225 #define SHIP_SELECT_ICON_0                                                      10
226 #define SHIP_SELECT_ICON_1                                                      11
227 #define SHIP_SELECT_ICON_2                                                      12
228 #define SHIP_SELECT_ICON_3                                                      13
229
230 #define WING_0_SHIP_0                                                           14
231 #define WING_0_SHIP_1                                                           15
232 #define WING_0_SHIP_2                                                           16
233 #define WING_0_SHIP_3                                                           17
234 #define WING_1_SHIP_0                                                           18
235 #define WING_1_SHIP_1                                                           19
236 #define WING_1_SHIP_2                                                           20
237 #define WING_1_SHIP_3                                                           21
238 #define WING_2_SHIP_0                                                           22
239 #define WING_2_SHIP_1                                                           23
240 #define WING_2_SHIP_2                                                           24
241 #define WING_2_SHIP_3                                                           25
242
243 #define SHIP_SELECT_RESET                                                       39
244
245 #define NUM_SHIP_SELECT_REGIONS                                 (NUM_COMMON_REGIONS + 19)
246
247 extern int Ship_select_open;    // This game-wide global flag is set to 1 to indicate that the ship
248                                                                                 // select screen has been opened and memory allocated.  This flag
249                                                                                 // is needed so we can know if ship_select_close() needs to called if
250                                                                                 // restoring a game from the Options screen invoked from ship select
251
252 extern int Commit_pressed;      // flag to indicate that the commit button was pressed
253                                                                         // use a flag, so the ship_create() can be done at the end of the loop
254
255 extern char default_player_ship[255];
256 extern int Select_default_ship;
257
258 void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select);
259 void ship_select_init();
260 void ship_select_do(float frametime);
261 void ship_select_close();
262 void ship_select_common_init();
263 void ship_stop_animation();
264 int ss_get_ship_class(int ship_entry_index);
265 int ss_get_selected_ship();
266
267 void ss_blit_ship_icon(int x,int y,int ship_class,int bmap_num);
268
269 // called from weapon select
270 int     ss_return_ship(int wing_block, int wing_slot, int *ship_index, p_object **ppobjp);
271 void    ss_return_name(int wing_block, int wing_slot, char *name, const int max_namelen);
272 int     ss_return_original_ship_class(int slot_num);
273 int     ss_return_saindex(int slot_num);
274 int     ss_disabled_slot(int slot_num);
275 int     ss_wing_slot_is_console_player(int index);
276
277 // lock/unlock any necessary slots for multiplayer
278 void ss_recalc_multiplayer_slots();
279
280 int     create_default_player_ship( int use_last_flown = 1 );
281 void    update_player_ship(int si_index);
282
283 void ss_synch_interface();
284
285 // set the necessary pointers
286 void ss_set_team_pointers(int team);
287
288 // called by multiplayer team select to set the slot based flags
289 void ss_make_slot_empty(int slot_index);
290 void ss_make_slot_full(int slot_index);
291
292 int ss_dump_to_list(int from_slot, int to_list, int *sound);
293 int ss_swap_slot_slot(int from_slot, int to_slot, int *sound);
294 int ss_grab_from_list(int from_list, int to_slot, int *sound);
295 int ss_swap_list_slot(int from_list, int to_slot, int *sound);
296
297 void ss_apply(int mode, int from_slot,int from_index,int to_slot,int to_index,int player_index = -1);
298 void ss_drop(int from_slot,int from_index,int to_slot,int to_index,int player_index = -1);
299
300 #endif  /* __MISSIONSHIPCHOICE_H__ */
301