FS2_Open
Open source remastering of the Freespace 2 engine
missionshipchoice.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __MISSIONSHIPCHOICE_H__
13 #define __MISSIONSHIPCHOICE_H__
14 
15 class p_object;
16 
18 // Ships selection hot spots
20 #define SHIP_SELECT_SHIP_SCROLL_UP 8
21 #define SHIP_SELECT_SHIP_SCROLL_DOWN 9
22 
23 #define SHIP_SELECT_ICON_0 10
24 #define SHIP_SELECT_ICON_1 11
25 #define SHIP_SELECT_ICON_2 12
26 #define SHIP_SELECT_ICON_3 13
27 
28 #define WING_0_SHIP_0 14
29 #define WING_0_SHIP_1 15
30 #define WING_0_SHIP_2 16
31 #define WING_0_SHIP_3 17
32 #define WING_1_SHIP_0 18
33 #define WING_1_SHIP_1 19
34 #define WING_1_SHIP_2 20
35 #define WING_1_SHIP_3 21
36 #define WING_2_SHIP_0 22
37 #define WING_2_SHIP_1 23
38 #define WING_2_SHIP_2 24
39 #define WING_2_SHIP_3 25
40 
41 #define SHIP_SELECT_RESET 39
42 
43 #define NUM_SHIP_SELECT_REGIONS (NUM_COMMON_REGIONS + 19)
44 
45 #define MAX_NUM_SHIP_DESC_LINES 10
46 #define SHIP_SELECT_SHIP_INFO_MAX_LINE_LEN 150
47 
48 extern int Ship_select_open; // This game-wide global flag is set to 1 to indicate that the ship
49  // select screen has been opened and memory allocated. This flag
50  // is needed so we can know if ship_select_close() needs to called if
51  // restoring a game from the Options screen invoked from ship select
52 
53 extern int Commit_pressed; // flag to indicate that the commit button was pressed
54  // use a flag, so the ship_create() can be done at the end of the loop
55 
56 extern char default_player_ship[255];
57 extern int Select_default_ship;
58 
59 extern float ShipSelectScreenShipRot;
60 extern int ShipSelectModelNum;
61 
62 extern int Ship_select_overlay_id;
63 
64 void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select, bool ship_selection = true);
65 void ship_select_init();
66 void ship_select_do(float frametime);
67 void ship_select_close();
70 int ss_get_ship_class(int ship_entry_index);
72 
73 void ss_blit_ship_icon(int x,int y,int ship_class,int bmap_num);
74 
75 // called from weapon select
76 int ss_return_ship(int wing_block, int wing_slot, int *ship_index, p_object **ppobjp);
77 void ss_return_name(int wing_block, int wing_slot, char *name);
78 int ss_return_original_ship_class(int slot_num);
79 int ss_return_saindex(int slot_num);
80 int ss_disabled_slot(int slot_num, bool ship_selection = true);
81 int ss_valid_slot(int slot_num);
83 
84 // lock/unlock any necessary slots for multiplayer
86 
87 int create_default_player_ship( int use_last_flown = 1 );
88 void update_player_ship(int si_index);
89 
90 void ss_synch_interface();
91 
92 // called by multiplayer team select to set the slot based flags
93 void ss_make_slot_empty(int slot_index);
94 void ss_make_slot_full(int slot_index);
95 
96 int ss_dump_to_list(int from_slot, int to_list, int *sound);
97 int ss_swap_slot_slot(int from_slot, int to_slot, int *sound);
98 int ss_grab_from_list(int from_list, int to_slot, int *sound);
99 int ss_swap_list_slot(int from_list, int to_slot, int *sound);
100 
101 void ss_apply(int mode, int from_slot,int from_index,int to_slot,int to_index,int player_index = -1);
102 void ss_drop(int from_slot,int from_index,int to_slot,int to_index,int player_index = -1);
103 
104 #endif /* __MISSIONSHIPCHOICE_H__ */
Definition: sound.cpp:39
float ShipSelectScreenShipRot
void ss_drop(int from_slot, int from_index, int to_slot, int to_index, int player_index=-1)
int ss_grab_from_list(int from_list, int to_slot, int *sound)
int ss_swap_slot_slot(int from_slot, int to_slot, int *sound)
int ss_get_ship_class(int ship_entry_index)
GLuint index
Definition: Glext.h:5608
void ss_blit_ship_icon(int x, int y, int ship_class, int bmap_num)
void ship_select_common_close()
int ship_class
Definition: missionparse.h:351
GLenum mode
Definition: Glext.h:5794
int ss_valid_slot(int slot_num)
int ss_get_selected_ship()
int ss_disabled_slot(int slot_num, bool ship_selection=true)
int ss_return_saindex(int slot_num)
void ss_return_name(int wing_block, int wing_slot, char *name)
void ss_make_slot_empty(int slot_index)
void ship_select_close()
int create_default_player_ship(int use_last_flown=1)
void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select, bool ship_selection=true)
int Select_default_ship
void ship_select_common_init()
int ss_swap_list_slot(int from_list, int to_slot, int *sound)
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
int ss_wing_slot_is_console_player(int index)
void ss_apply(int mode, int from_slot, int from_index, int to_slot, int to_index, int player_index=-1)
char default_player_ship[255]
GLuint const GLchar * name
Definition: Glext.h:5608
void ss_recalc_multiplayer_slots()
void ss_make_slot_full(int slot_index)
void ss_synch_interface()
int Ship_select_open
void update_player_ship(int si_index)
void ship_select_do(float frametime)
int Ship_select_overlay_id
int Commit_pressed
int ShipSelectModelNum
int ss_return_ship(int wing_block, int wing_slot, int *ship_index, p_object **ppobjp)
int ss_dump_to_list(int from_slot, int to_list, int *sound)
int ss_return_original_ship_class(int slot_num)
GLint y
Definition: Gl.h:1505
void ship_select_init()