]> icculus.org git repositories - taylor/freespace2.git/blob - include/missionweaponchoice.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / missionweaponchoice.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/MissionWeaponChoice.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for the weapon loadout screen
16  *
17  * $Log$
18  * Revision 1.3  2003/06/11 18:30:32  taylor
19  * plug memory leaks
20  *
21  * Revision 1.2  2002/06/09 04:41:14  relnev
22  * added copyright header
23  *
24  * Revision 1.1.1.1  2002/05/03 03:28:12  root
25  * Initial import.
26  *
27  * 
28  * 2     10/07/98 10:53a Dave
29  * Initial checkin.
30  * 
31  * 1     10/07/98 10:50a Dave
32  * 
33  * 21    4/17/98 5:27p Dave
34  * More work on the multi options screen. Fixed many minor ui todo bugs.
35  * 
36  * 20    3/31/98 1:50p Duncan
37  * ALAN: fix bugs with selecting alternate weapons 
38  * 
39  * 19    2/28/98 7:04p Lawrance
40  * Don't show reset button in multiplayer
41  * 
42  * 18    2/24/98 6:21p Lawrance
43  * Integrate new reset button into loadout screens
44  * 
45  * 17    1/17/98 4:14p Lawrance
46  * fix mask problem with primary weapon scrolling
47  * 
48  * 16    1/17/98 1:32a Lawrance
49  * fix mask problem that was mixing up scroll up and scroll down on
50  * weapons loadout
51  * 
52  * 15    1/09/98 6:06p Dave
53  * Put in network sound support for multiplayer ship/weapon select
54  * screens. Made clients exit game correctly through warp effect. Fixed
55  * main hall menu help overlay bug.
56  * 
57  * 14    12/24/97 1:19p Lawrance
58  * fix some bugs with the multiplayer ship/weapons loadout
59  * 
60  * 13    12/23/97 5:25p Allender
61  * more fixes to multiplayer ship selection.  Fixed strange reentrant
62  * problem with cf_callback when loading freespace data
63  * 
64  * 12    12/22/97 6:18p Lawrance
65  * Get save/restore of player loadout working with new code
66  * 
67  * 11    12/22/97 1:40a Lawrance
68  * Re-write ship select/weapons loadout to be multiplayer friendly
69  * 
70  * 10    12/19/97 1:23p Dave
71  * Put in multiplayer groundwork for new weapon/ship select screens.
72  * 
73  * 9     12/18/97 8:59p Dave
74  * Finished putting in basic support for weapon select and ship select in
75  * multiplayer.
76  * 
77  * 8     12/17/97 7:42p Lawrance
78  * re-work how weapons are re-set when ships change in ship select
79  * 
80  * 7     12/17/97 4:53p Lawrance
81  * changes to support multiplayer
82  * 
83  * 6     12/17/97 2:33p Dave
84  * Finished up basic weapon select support for multiplayer.
85  * 
86  * 5     12/16/97 6:17p Dave
87  * Put in primary weapon support for multiplayer weapon select screen.
88  * 
89  * 4     12/03/97 1:22p Lawrance
90  * implement saving/restoring of ship selection and weapons loadout
91  * 
92  * 3     12/02/97 10:51p Lawrance
93  * implement save/restore of ship selection and weapon loadouts
94  * 
95  * 2     11/15/97 6:12p Lawrance
96  * don't allow Player ship to have all weapons removed
97  * 
98  * 1     9/30/97 10:16a Lawrance
99  * move files from Mission lib to MissionUI lib
100  * 
101  * 8     9/18/97 7:58a Lawrance
102  * fix some bugs associated with the player ship being created early on
103  * 
104  * 7     8/30/97 12:24p Lawrance
105  * supporting animations in the weapons loadout screen, fixed some bugs
106  * 
107  * 6     8/29/97 7:33p Lawrance
108  * further work on weapons loadout
109  * 
110  * 5     8/15/97 8:00p Lawrance
111  * integrating new art for the briefing screens
112  * 
113  * 4     7/23/97 11:36a Lawrance
114  * support common buttons through the briefing/ship select/weapons
115  * loadout, be able to hide buttons when necessary
116  * 
117  * 3     7/14/97 3:58p Lawrance
118  * limit frametime to 33 ms for animation timing
119  * 
120  * 2     2/25/97 11:11a Lawrance
121  * ship selection and weapon loadout interfaces working at basic level
122  *
123  * $NoKeywords: $
124  */
125
126
127 #ifndef __MISSION_WEAPON_CHOICE_H__
128 #define __MISSION_WEAPON_CHOICE_H__
129
130 #include "missionparse.h"
131 #include "missionscreencommon.h"
132
133 // mask regions for icons in the scrollable lists
134 #define ICON_PRIMARY_0                          28
135 #define ICON_PRIMARY_1                          29
136 #define ICON_PRIMARY_2                          30
137 #define ICON_PRIMARY_3                          31
138 #define ICON_SECONDARY_0                        10
139 #define ICON_SECONDARY_1                        11
140 #define ICON_SECONDARY_2                        12
141 #define ICON_SECONDARY_3                        13
142
143 // mask regions for icons that sit above the ship
144 #define ICON_SHIP_PRIMARY_0             32
145 #define ICON_SHIP_PRIMARY_1             33
146 #define ICON_SHIP_PRIMARY_2             34
147 #define ICON_SHIP_SECONDARY_0           35
148 #define ICON_SHIP_SECONDARY_1           36
149 #define ICON_SHIP_SECONDARY_2           37
150 #define ICON_SHIP_SECONDARY_3           38
151
152 // mask region for weapon loadout specific buttons
153 #define PRIMARY_SCROLL_UP                                       27      
154 #define PRIMARY_SCROLL_DOWN                             26
155 #define SECONDARY_SCROLL_UP                             9
156 #define SECONDARY_SCROLL_DOWN                           8
157 #define WL_RESET_BUTTON_MASK                            39
158
159 #define NUM_WEAPON_REGIONS              (NUM_COMMON_REGIONS + 32)
160
161 void weapon_select_init();
162 void weapon_select_common_init();
163 void weapon_select_do(float frametime);
164 void weapon_select_close();
165 void weapon_select_close_team();
166
167 void    wl_update_parse_object_weapons(p_object *pobjp, wss_unit *slot);
168 int     wl_update_ship_weapons(int objnum, wss_unit *slot);
169 void    wl_bash_ship_weapons(ship_weapon *swp, wss_unit *slot);
170
171 void wl_set_default_weapons(int index, int ship_class);
172 void wl_reset_to_defaults();
173
174 // Set selected slot to first placed ship
175 void wl_reset_selected_slot();
176
177 void wl_remove_weps_from_pool(int *wep, int *wep_count, int ship_class);
178 void wl_get_ship_class_weapons(int ship_class, int *wep, int *wep_count);
179 void wl_get_default_weapons(int ship_class, int slot_num, int *wep, int *wep_count);
180
181 void wl_synch_interface();
182 void wl_apply(int mode,int from_bank,int from_list,int to_bank,int to_list,int ship_slot,int player_index = -1);
183 void wl_drop(int from_bank,int from_list,int to_bank,int to_list, int ship_slot,int player_index = -1);
184
185 #endif /* __MISSION_WEAPON_CHOICE_H__ */
186