FS2_Open
Open source remastering of the Freespace 2 engine
gamesequence.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 
13 // defines for game sequencing
14 
15 #ifndef __GAMESEQUENCE_H__
16 #define __GAMESEQUENCE_H__
17 
24 enum GS_EVENT {
25  GS_EVENT_MAIN_MENU = 0, // first event to move to first state
26  GS_EVENT_START_GAME, // start a new game (Loads a mission then goes to briefing state)
27  GS_EVENT_ENTER_GAME, // switches into game state, probably after mission briefing or ship selection.
28  GS_EVENT_START_GAME_QUICK, // start a new game (Loads a mission then goes to directly to game state)
29  GS_EVENT_END_GAME, // end the current game (i.e. back to main menu)
30  GS_EVENT_QUIT_GAME, // quit the entire game
31  GS_EVENT_PAUSE_GAME, // pause the current game
32  GS_EVENT_PREVIOUS_STATE, // return to the previous state
33  GS_EVENT_OPTIONS_MENU, // go to the options menu
34  GS_EVENT_BARRACKS_MENU, // go to the barracks menu
35  GS_EVENT_TRAINING_MENU, // go to the training menu
36  GS_EVENT_TECH_MENU, // go to the tech room menu
37  GS_EVENT_LOAD_MISSION_MENU, // go to the load mission menu
38  GS_EVENT_SHIP_SELECTION, // Show ship selection menu
39  GS_EVENT_TOGGLE_FULLSCREEN, // toggle fullscreen mode
40  GS_EVENT_START_BRIEFING, // go to the briefing for the current mission
42  GS_EVENT_HUD_CONFIG, // start the HUD configuration screen
43  GS_EVENT_MULTI_JOIN_GAME, // start multiplayer join game screen
44  GS_EVENT_CONTROL_CONFIG, // get user to choose what type of controller to config
45  GS_EVENT_EVENT_DEBUG, // an event debug trace scroll list display screen
46  GS_EVENT_WEAPON_SELECTION, // Do weapon loadout
47  GS_EVENT_MISSION_LOG_SCROLLBACK, // scrollback screen for message log entries
48  GS_EVENT_GAMEPLAY_HELP, // show help for the gameplay
49  GS_EVENT_DEATH_DIED, // Player just died
50  GS_EVENT_DEATH_BLEW_UP, // Saw ship explode.
52  GS_EVENT_CREDITS, // Got to the credits
53  GS_EVENT_SHOW_GOALS, // Show the goal status screen
54  GS_EVENT_HOTKEY_SCREEN, // Show the hotkey assignment screen
55  GS_EVENT_VIEW_MEDALS, // Go to the View Medals screen
56  GS_EVENT_MULTI_HOST_SETUP, // host setup for multiplayer
57  GS_EVENT_MULTI_CLIENT_SETUP, // client setup for multiplayer
58  GS_EVENT_DEBRIEF, // go to debriefing
59  GS_EVENT_GOTO_VIEW_CUTSCENES_SCREEN, // go to the management screen
60  GS_EVENT_MULTI_STD_WAIT, // standalone wait state
61  GS_EVENT_STANDALONE_MAIN, // the main do-nothing state of the standalone
62  GS_EVENT_MULTI_PAUSE, // pause your multiplayer game
63  GS_EVENT_TEAM_SELECT, // team selection for multiplayer
64  GS_EVENT_TRAINING_PAUSE, // pause game while training message is displayed
65  GS_EVENT_INGAME_PRE_JOIN, // go to ship selection screen for ingame join
66  GS_EVENT_PLAYER_WARPOUT_START, // player hit 'j' to warp out
67  GS_EVENT_PLAYER_WARPOUT_START_FORCED, // player is being forced out of mission no matter what
68  GS_EVENT_PLAYER_WARPOUT_STOP, // player hit 'esc' or something to cancel warp out
69  GS_EVENT_PLAYER_WARPOUT_DONE_STAGE1, // player ship got up to speed
70  GS_EVENT_PLAYER_WARPOUT_DONE_STAGE2, // player ship got through the warp effect
71  GS_EVENT_PLAYER_WARPOUT_DONE, // warp effect went away
72  GS_EVENT_STANDALONE_POSTGAME, // debriefing, etc
73  GS_EVENT_INITIAL_PLAYER_SELECT, // initial screen where player selects from multi/single player pilots
75  GS_EVENT_MULTI_MISSION_SYNC, // sychronize/transfer/load any mission specific data in multiplayer
76  GS_EVENT_MULTI_START_GAME, // immediately before the create game screen for the host to set the game variables
77  GS_EVENT_MULTI_HOST_OPTIONS, // options the host can set while in the create game scree
78  GS_EVENT_MULTI_DOGFIGHT_DEBRIEF, // multiplayer furball debriefing screen (replaces normal debriefing)
80  GS_EVENT_CMD_BRIEF, // switch to command briefing screen
81  GS_EVENT_TOGGLE_GLIDE, // GS_EVENT_TOGGLE_GLIDE
82  GS_EVENT_RED_ALERT, // go to red alert screen
84  GS_EVENT_END_CAMPAIGN, // end of the whole thang.
85  GS_EVENT_LOOP_BRIEF, // campaign loop brief
86  GS_EVENT_CAMPAIGN_CHEAT, // skip to a mission in a campaign
88  GS_EVENT_LAB, // WMC - I-FRED concept
92 
93  GS_NUM_EVENTS // Last one++
94 };
95 // IMPORTANT: When you add a new event, update the initialization for GS_event_text[]
96 // which is done in gamesequence.cpp
97 //
98 extern char *GS_event_text[]; // text description for the GS_EVENT_* #defines above
99 
100 
107 enum GS_STATE {
108  GS_STATE_INVALID = 0, // This state should never be reached
126  GS_STATE_DEATH_DIED, // Player just died
127  GS_STATE_DEATH_BLEW_UP, // Saw ship explode.
132  GS_STATE_VIEW_MEDALS, // Go to the View Medals screen
133  GS_STATE_MULTI_HOST_SETUP, // state where host sets up multiplayer game
134  GS_STATE_MULTI_CLIENT_SETUP, // client setup for multiplayer game
141  GS_STATE_TRAINING_PAUSED, // game is paused while training msg is being read.
142  GS_STATE_INGAME_PRE_JOIN, // go to ship selection screen for ingame join
143  GS_STATE_EVENT_DEBUG, // an event debug trace scroll list display screen
144  GS_STATE_STANDALONE_POSTGAME, // debriefing, etc.
151  GS_STATE_CMD_BRIEF, // command briefing screen
152  GS_STATE_RED_ALERT, // red alert screen
153  GS_STATE_END_OF_CAMPAIGN, // end of main campaign -- only applicable in single player
162 
163  GS_NUM_STATES // Last one++
164 };
165 // IMPORTANT: When you add a new state, update the initialization for GS_state_text[]
166 // which is done in GameSequence.cpp
167 //
168 extern struct script_hook GS_state_hooks[]; //WMC-for scripting
169 extern char *GS_state_text[]; // text description for the GS_STATE_* #defines above
170 extern int Num_gs_event_text;
171 extern int Num_gs_state_text; //WMC - for scripting
172 
173 
174 // function prototypes
175 //
176 void gameseq_init();
177 int gameseq_process_events( void ); // returns current game state
178 int gameseq_get_state( int depth = 0 );
179 void gameseq_post_event( int event );
180 int gameseq_get_event( void );
181 
182 void gameseq_set_state(int new_state, int override = 0);
183 void gameseq_push_state( int new_state );
184 void gameseq_pop_state( void );
186 int gameseq_get_depth();
189 
190 
191 // Called by the sequencing code when things happen.
192 void game_process_event(int current_state, int event);
193 void game_leave_state(int old_state,int new_state);
194 void game_enter_state(int old_state,int new_state);
195 void game_do_state(int current_state);
196 
197 // Kazan
198 bool GameState_Stack_Valid();
199 
200 //WMC
201 int gameseq_get_event_idx(char *s);
202 int gameseq_get_state_idx(char *s);
203 
204 //zookeeper
205 int gameseq_get_state_idx(int state);
206 
207 #endif /* __GAMESEQUENCE_H__ */
GS_STATE
Enum's for game sequencing states.
Definition: gamesequence.h:107
void game_leave_state(int old_state, int new_state)
Definition: fredstubs.cpp:184
void gameseq_init()
void gameseq_pop_state(void)
int Num_gs_event_text
void gameseq_post_event(int event)
void game_do_state(int current_state)
Definition: fredstubs.cpp:205
GLint GLint GLsizei GLsizei GLsizei depth
Definition: Glext.h:5180
int Num_gs_state_text
int gameseq_get_state_idx(char *s)
GS_EVENT
Enum's for Game Sequence Events.
Definition: gamesequence.h:24
char * GS_event_text[]
int gameseq_get_pushed_state()
void game_process_event(int current_state, int event)
Definition: fredstubs.cpp:206
void gameseq_push_state(int new_state)
int gameseq_get_previous_state()
struct script_hook GS_state_hooks[]
GLdouble s
Definition: Glext.h:5321
void gameseq_pop_and_discard_state(void)
char * GS_state_text[]
int gameseq_get_state(int depth=0)
int gameseq_get_depth()
struct _cl_event * event
Definition: Glext.h:7296
bool GameState_Stack_Valid()
int gameseq_process_events(void)
void game_enter_state(int old_state, int new_state)
Definition: fredstubs.cpp:183
int gameseq_get_event_idx(char *s)
int gameseq_get_event(void)
void gameseq_set_state(int new_state, int override=0)