| 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/gamecinematics_external.h $ |
| 21 | * $Revision: 13 $ |
| 22 | * $Date: 5/10/99 10:22p $ |
| 23 | * $Author: Ardussi $ |
| 24 | * |
| 25 | * Defines and structs external for DLLs |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/gamecinematics_external.h $ |
| 28 | * |
| 29 | * 13 5/10/99 10:22p Ardussi |
| 30 | * changes to compile on Mac |
| 31 | * |
| 32 | * 12 5/04/99 6:53p Jeff |
| 33 | * added new canned cinematic to fade screen to white and endlevel. Fixed |
| 34 | * crash bug with invalid player path for canned cine with player paths |
| 35 | * |
| 36 | * 11 4/04/99 8:21p Matt |
| 37 | * Fixed include problems with osiris vector stuff. Osiris headers now |
| 38 | * include vecmat_external.h, instead of defining the typedefs, structs, |
| 39 | * and inlines on the Osiris side. |
| 40 | * |
| 41 | * 10 3/27/99 7:22p Jeff |
| 42 | * fixed cinematics when going from one cut to another immediatly. Added |
| 43 | * start transition |
| 44 | * |
| 45 | * 9 2/28/99 8:32p Jeff |
| 46 | * added fade and move player dallas action. Fixed the end-level sequence |
| 47 | * changing view back to player for split second. |
| 48 | * |
| 49 | * 8 2/22/99 1:20a Jeff |
| 50 | * added support for inventory (simple) in dallas. Moved end-level |
| 51 | * sequence to use IGC. Add position clipboard stuff for dallas. Fixed |
| 52 | * some inventory bug with storing object handles |
| 53 | * |
| 54 | * 7 2/21/99 8:36p Jeff |
| 55 | * misc changes to handle new matcen and path types of dallas |
| 56 | * |
| 57 | * 6 2/16/99 9:36p Jeff |
| 58 | * added low text layout for cinematics |
| 59 | * |
| 60 | * 5 2/14/99 1:16a Jeff |
| 61 | * added canned cinematic function/structures. Added a flag to push |
| 62 | * target to end of path if on a path (quick exit). Added canned intro |
| 63 | * cine. Determine correct velocity on player ship for intro cine. |
| 64 | * |
| 65 | * 4 2/12/99 2:45a Jeff |
| 66 | * added end-cinematic transitions |
| 67 | * |
| 68 | * 3 2/02/99 3:58p Jeff |
| 69 | * started to implement level intro cinematic (need ai functions first). |
| 70 | * No longer need camera object to do cinematic (auto-created)...path |
| 71 | * cameras use speed based on distance needed to travel. |
| 72 | * |
| 73 | * 2 2/01/99 12:55p Jeff |
| 74 | * restore correct hud mode, added flag to stop cinematics if target dies |
| 75 | * |
| 76 | * 1 1/31/99 10:28p Jeff |
| 77 | * |
| 78 | * $NoKeywords: $ |
| 79 | */ |
| 80 | |
| 81 | #ifndef __GAMECINEMATICS_EXTERNAL_H_ |
| 82 | #define __GAMECINEMATICS_EXTERNAL_H_ |
| 83 | |
| 84 | #include <cstdint> |
| 85 | |
| 86 | #include "vecmat_external.h" |
| 87 | #include "manage_external.h" |
| 88 | |
| 89 | /* |
| 90 | ========================================================== |
| 91 | Canned Cinematics |
| 92 | */ |
| 93 | #define CANNED_LEVEL_INTRO 1 |
| 94 | #define CANNED_LEVEL_END_PATH 2 // end level with camera on path |
| 95 | #define CANNED_LEVEL_END_POINT 3 // end level with camera on point |
| 96 | #define CANNED_MOVE_PLAYER_FADE 4 // fade the screen out and move the player to a new position |
| 97 | #define CANNED_LEVEL_END_FADE_WHITE 5 // fade the screen to white and end level |
| 98 | |
| 99 | struct tCannedCinematicInfo { |
| 100 | int32_t type; |
| 101 | /* |
| 102 | CANNED_LEVEL_INTRO: |
| 103 | camera_pathid |
| 104 | target_pathid |
| 105 | text_to_display |
| 106 | time |
| 107 | */ |
| 108 | /* |
| 109 | CANNED_LEVEL_END_PATH |
| 110 | camera_pathid |
| 111 | target_pathid |
| 112 | text_to_display |
| 113 | time |
| 114 | */ |
| 115 | /* |
| 116 | CANNED_LEVEL_END_POINT |
| 117 | object_to_use_for_point |
| 118 | target_pathid |
| 119 | text_to_display |
| 120 | time |
| 121 | */ |
| 122 | /* |
| 123 | CANNED_MOVE_PLAYER_FADE |
| 124 | room //destination room |
| 125 | pos //destination pos |
| 126 | orient //destination orient |
| 127 | target_objhandle //the player |
| 128 | */ |
| 129 | /* |
| 130 | CANNED_LEVEL_END_FADE_WHITE |
| 131 | time |
| 132 | text_to_display |
| 133 | */ |
| 134 | |
| 135 | int32_t camera_pathid; |
| 136 | int32_t target_pathid; |
| 137 | const char *text_to_display; |
| 138 | |
| 139 | int32_t target_objhandle; |
| 140 | |
| 141 | int32_t room; |
| 142 | |
| 143 | float time; |
| 144 | |
| 145 | int32_t object_to_use_for_point; |
| 146 | |
| 147 | vector pos; |
| 148 | matrix orient; |
| 149 | |
| 150 | }; |
| 151 | |
| 152 | //======================================================== |
| 153 | |
| 154 | // flags for game cinematic struct |
| 155 | #define GCF_LETTERBOX 0x00000000 |
| 156 | #define GCF_FULLSCREEN 0x00000001 |
| 157 | #define GCF_SCREENFORMAT 0x00000001 // mask for screen format to use |
| 158 | |
| 159 | #define GCF_USEPATH 0x00000000 |
| 160 | #define GCF_USEPOINT 0x00000002 |
| 161 | #define GCF_CAMERAPLACEMENT 0x00000002 // mask for camera placement (use path or point) |
| 162 | |
| 163 | #define GCF_TEXT_WIPEIN 0x00000004 |
| 164 | #define GCF_TEXT_FADEINOUT 0x00000008 |
| 165 | #define GCF_TEXT_NOEFFECT 0x00000000 |
| 166 | #define GCF_TEXT_MASK 0x0000000C // mask for text modes |
| 167 | |
| 168 | #define GCF_LAYOUT_BOTTOM 0x00000000 |
| 169 | #define GCF_LAYOUT_TOP 0x00000010 |
| 170 | #define GCF_LAYOUT_MIDDLE 0x00000020 |
| 171 | #define GCF_LAYOUT_LOW 0x00000040 |
| 172 | #define GCF_LAYOUT_MASK 0x00000070 // mask for text layout to use |
| 173 | |
| 174 | #define GCF_STOPIFTAGETDEAD 0x00000100 // stop the cinematic if the target dies |
| 175 | #define GCF_FORCETARGETTOEND \ |
| 176 | 0x00000200 // if there is a quick exit (by keypress) force target position to the end of the path |
| 177 | #define GCF_DONTRESTOREVIEWER \ |
| 178 | 0x00000400 // don't restore the view back to the player (this is really an internal flag and shouldn't be used) |
| 179 | #define GCF_IGNOREPLAYERDEAD 0x00000800 // don't stop cinematic if player dies |
| 180 | #define GCF_DOTRANSBEFORETEXT 0x00001000 // process end transitions before drawing text |
| 181 | |
| 182 | // callback types |
| 183 | #define GCCT_START 0x00000001 // first frame of the movie |
| 184 | #define GCCT_STOP 0x00000002 // last frame of the movie |
| 185 | #define GCCT_FRAME 0x00000003 // frame of the movie |
| 186 | |
| 187 | // Transition types |
| 188 | #define GCTT_NONE 0 |
| 189 | #define GCTT_WACKY 1 |
| 190 | #define GCTT_FADE 2 |
| 191 | #define GCTT_FADEINOUT 3 |
| 192 | #define GCTT_FADEWHITE 4 |
| 193 | |
| 194 | struct PercentageRange { |
| 195 | float min, max; // 0.0f->1.0f |
| 196 | }; |
| 197 | |
| 198 | struct tGameCinematic { |
| 199 | uint32_t flags; |
| 200 | |
| 201 | int32_t target_objhandle; |
| 202 | |
| 203 | int32_t end_transition; |
| 204 | int32_t start_transition; |
| 205 | |
| 206 | // the name of the path or the position that the camera should be at |
| 207 | int32_t pathid; |
| 208 | vector position; |
| 209 | matrix *orient; |
| 210 | int32_t room; |
| 211 | |
| 212 | // the total time that the cinematic should play |
| 213 | float max_time_play; |
| 214 | |
| 215 | // called every frame while the cinematic is processing |
| 216 | void (*callback)(int type); |
| 217 | |
| 218 | // ranges (based on max_time_play) |
| 219 | PercentageRange text_display; // range that the text should be displayed |
| 220 | PercentageRange track_target; // range that the camera should track the target |
| 221 | PercentageRange player_disabled; // range that the player can't move/fire/etc. |
| 222 | PercentageRange in_camera_view; // range that the view is from the camera |
| 223 | PercentageRange quick_exit; // range where a key-press will quick exit cinematic |
| 224 | |
| 225 | }; |
| 226 | |
| 227 | #endif |