| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/main/gamesequence.h $ |
| 21 | * $Revision: 24 $ |
| 22 | * $Date: 4/08/99 3:12p $ |
| 23 | * $Author: Matt $ |
| 24 | * |
| 25 | * Game Sequencer |
| 26 | * |
| 27 | * $Log: /DescentIII/main/gamesequence.h $ |
| 28 | * |
| 29 | * 24 4/08/99 3:12p Matt |
| 30 | * Finished cleaning up level sequencing code. Got rid of all the "level |
| 31 | * minus one" stuff. |
| 32 | * |
| 33 | * 23 4/07/99 12:30p Matt |
| 34 | * Added code for failed missions. |
| 35 | * |
| 36 | * 22 4/04/99 8:15p Jeff |
| 37 | * added debug graph stuff |
| 38 | * |
| 39 | * 21 2/12/99 3:54a Jeff |
| 40 | * added function to restart a level, and a cheat key to do so (del-alt-e) |
| 41 | * |
| 42 | * 20 1/31/99 3:44p Matt |
| 43 | * Streamlined game sequencing |
| 44 | * |
| 45 | * 19 1/15/99 7:16p Kevin |
| 46 | * Added GameGauge Configuration & code |
| 47 | * |
| 48 | * 18 12/15/98 4:28p Jeff |
| 49 | * added mission data information to the pilot files to save what the |
| 50 | * highest level they achieved on a mission is. Added level select dialog |
| 51 | * (not hooked up) and level warp cheat. |
| 52 | * |
| 53 | * 17 11/19/98 5:40p Kevin |
| 54 | * Demo system |
| 55 | * |
| 56 | * 16 10/08/98 7:29p Samir |
| 57 | * revamped sequencing. |
| 58 | * |
| 59 | * 15 10/08/98 12:00p Kevin |
| 60 | * Demo system work |
| 61 | * |
| 62 | * 14 10/05/98 12:09p Kevin |
| 63 | * Converted projects to VC6 and demo file stuff added |
| 64 | * |
| 65 | * 13 8/18/98 3:02p Samir |
| 66 | * new sequencing for LoadGameState and PLEASE define Current_level some |
| 67 | * other way (or at least keep the definition in StartNewLebvel) |
| 68 | * |
| 69 | * 12 8/18/98 1:05a Samir |
| 70 | * added save and load interfaces. |
| 71 | * |
| 72 | * 11 8/16/98 5:56p Jeff |
| 73 | * added game interface for multiplayer dll ui stuff |
| 74 | * |
| 75 | * 10 6/25/98 12:43p Jeff |
| 76 | * Added exit game confirmation |
| 77 | * |
| 78 | * 9 5/18/98 4:36p Jeff |
| 79 | * TelCom uses Game_interface_mode variable now |
| 80 | * |
| 81 | * 8 4/03/98 3:36p Chris |
| 82 | * Added the start of the buddy menu |
| 83 | * |
| 84 | * 7 3/13/98 12:08p Samir |
| 85 | * Added SimpleStartLevel. |
| 86 | * |
| 87 | * 6 3/05/98 2:51p Jeff |
| 88 | * Added Help interface |
| 89 | * |
| 90 | * 5 3/03/98 12:10p Samir |
| 91 | * Added simple pausing. |
| 92 | * |
| 93 | * 4 3/02/98 5:52p Samir |
| 94 | * Added game interface system. |
| 95 | * |
| 96 | * 3 2/12/98 5:08p Matt |
| 97 | * Reset cockpit mode when starting a level. Unfortunately, this involved |
| 98 | * some semi-major mucking with game sequencing. |
| 99 | * |
| 100 | * 2 2/08/98 5:01p Samir |
| 101 | * New game sequencing changes. |
| 102 | * |
| 103 | * 1 2/08/98 3:54p Samir |
| 104 | * Initial revision. |
| 105 | * |
| 106 | * $NoKeywords: $ |
| 107 | */ |
| 108 | |
| 109 | #ifndef GAMESEQUENCE_H |
| 110 | #define GAMESEQUENCE_H |
| 111 | |
| 112 | // gamesequencer states: |
| 113 | // game states |
| 114 | |
| 115 | enum tGameState { |
| 116 | GAMESTATE_IDLE, // no state |
| 117 | GAMESTATE_NEW, // starts a new game (with current mission.) |
| 118 | GAMESTATE_LVLNEXT, // go to the next level |
| 119 | GAMESTATE_LVLSTART, // happens when a level starts, game time starts here. |
| 120 | GAMESTATE_LVLPLAYING, // calls gameloop, polls for input. |
| 121 | GAMESTATE_LOADGAME, // a load game request has been issued. |
| 122 | GAMESTATE_LVLEND, // calls endlevel and any other endlevel stuff. |
| 123 | GAMESTATE_LVLFAILED, // a level was unsuccessfully ended |
| 124 | GAMESTATE_LVLWARP, // warp to a new level |
| 125 | GAMESTATE_LOADDEMO, // Load whatever demo was chosen in the UI |
| 126 | }; |
| 127 | |
| 128 | // top level interfaces for game. |
| 129 | #define GAME_INTERFACE 0 |
| 130 | #define GAME_OPTIONS_INTERFACE 1 |
| 131 | #define GAME_PAUSE_INTERFACE 2 |
| 132 | #define GAME_HELP_INTERFACE 3 |
| 133 | #define GAME_BUDDY_INTERFACE 4 |
| 134 | #define GAME_TELCOM_BRIEFINGS 5 |
| 135 | #define GAME_TELCOM_AUTOMAP 6 |
| 136 | #define GAME_TELCOM_CARGO 7 |
| 137 | #define GAME_EXIT_CONFIRM 8 |
| 138 | #define GAME_DLL_INTERFACE 9 |
| 139 | #define GAME_SAVE_INTERFACE 10 |
| 140 | #define GAME_LOAD_INTERFACE 11 |
| 141 | #define GAME_TOGGLE_DEMO 12 |
| 142 | #define GAME_POST_DEMO 13 |
| 143 | #define GAME_DEMO_LOOP 14 |
| 144 | #define GAME_LEVEL_WARP 15 |
| 145 | #define GAME_DEBUGGRAPH_INTERFACE 16 |
| 146 | |
| 147 | // variables |
| 148 | extern tGameState Game_state; |
| 149 | extern int Game_interface_mode; // current interface mode of game (menu, game?) |
| 150 | extern int paged_in_count; |
| 151 | extern int paged_in_num; |
| 152 | |
| 153 | // functions |
| 154 | // main sequencing code for game. run this to execute a game. |
| 155 | // before calling this function make sure that a |
| 156 | // mission has been loaded/initialized. |
| 157 | bool GameSequencer(); |
| 158 | |
| 159 | // Sets the current level for subsequent level loads, movies, or briefings |
| 160 | void SetCurrentLevel(int level); |
| 161 | |
| 162 | // loads and starts the specified leve. starts a new level (usually called internally) |
| 163 | bool LoadAndStartCurrentLevel(); |
| 164 | |
| 165 | // creates a simple mission to play one level. |
| 166 | bool SimpleStartLevel(char *level_name); |
| 167 | |
| 168 | // sets and retrieves the current gamestate |
| 169 | inline void SetGameState(tGameState state) { Game_state = state; } |
| 170 | |
| 171 | inline tGameState GetGameState() { return Game_state; } |
| 172 | |
| 173 | #endif |