Debian Codegraph @

lib/demofile.h

raw symbols SCIP
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/lib/demofile.h $
21 * $Revision: 25 $
22 * $Date: 7/21/99 12:03p $
23 * $Author: Kevin $
24 *
25 *
26 *
27 * $Log: /DescentIII/main/lib/demofile.h $
28 *
29 * 25 7/21/99 12:03p Kevin
30 * Changed version numbers around
31 *
32 * 24 4/25/99 10:19p Matt
33 * Fixed multiplayer and demo problems will killing an object from script,
34 * and cleaned up the death code a bit in the process.
35 *
36 * 23 3/12/99 7:53p Jeff
37 * save player rotating balls info, handle obj_observer with obj_player,
38 * handle objects that use life left, handle 2d sound playing
39 *
40 * 22 3/11/99 11:40a Kevin
41 * New stuff for multi
42 *
43 * 21 3/10/99 2:25p Kevin
44 * Save/Load and Demo file fixes
45 *
46 * 20 2/25/99 11:01a Matt
47 * Added new explosion system.
48 *
49 * 19 2/23/99 12:45a Jeff
50 * added support for in-game-cinematics in demo system
51 *
52 * 18 2/22/99 9:21p Kevin
53 * Added DT_CINEMATICS
54 *
55 * 17 2/08/99 7:05p Kevin
56 * Trying to get demo system working with powerup scripts
57 *
58 * 16 1/23/99 10:12p Kevin
59 * Added the start of osiris support into the demo system
60 *
61 * 15 11/24/98 3:57p Kevin
62 * Demo system immprovements
63 *
64 * 14 11/24/98 12:08p Kevin
65 *
66 * 13 11/24/98 10:41a Kevin
67 * Demo system
68 *
69 * 12 11/23/98 4:52p Kevin
70 * Demo system enhancments
71 *
72 * 11 11/23/98 3:11p Kevin
73 * Demo system
74 *
75 * 10 11/19/98 5:40p Kevin
76 * Demo system
77 *
78 * 9 11/17/98 4:17p Kevin
79 * Demo recording system
80 *
81 * 8 11/11/98 2:46p Kevin
82 * Demo recording system work
83 *
84 * 7 11/09/98 4:12p Kevin
85 *
86 * 6 11/05/98 5:54p Kevin
87 * Demo system work
88 *
89 * 5 10/08/98 12:00p Kevin
90 * Demo system work
91 *
92 * 4 10/06/98 5:46p Kevin
93 * Added new configuration for demo
94 *
95 * 3 10/05/98 12:09p Kevin
96 * Converted projects to VC6 and demo file stuff added
97 *
98 * 2 10/05/98 10:32a Kevin
99 * Initial Version
100 *
101 * 1 10/05/98 10:22a Kevin
102 *
103 * $NoKeywords: $
104 */
105
106 #ifndef _DEMO_FILE_HEADER_
107 #define _DEMO_FILE_HEADER_
108
109 #include <cstdint>
110
111 extern char Demo_fname[_MAX_PATH * 2];
112
113 extern uint32_t Demo_flags;
114 extern bool Demo_paused;
115 extern bool Demo_do_one_frame;
116 extern bool Demo_restart;
117 extern bool Demo_auto_play;
118 extern bool Demo_make_movie;
119 extern float Demo_frame_ofs;
120 extern uint16_t Demo_obj_map[MAX_OBJECTS];
121 #define DF_NONE 0
122 #define DF_RECORDING 1
123 #define DF_PLAYBACK 2
124
125 #define D3_DEMO_SIG "D3DEM"
126 #define D3_DEMO_SIG_NEW "D3DM1"
127
128 #define DT_OBJ 1 // Object data
129 #define DT_NEW_FRAME 2 // Start of a new frame
130 #define DT_WEAPON_FIRE 3 // Someone fired a weapon
131 #define DT_HUD_MESSAGE 4 // Display a hud message
132 #define DT_3D_SOUND 5 // Play a 3d sound (associated with a weapon firing usually)
133 #define DT_OBJ_CREATE 6 // A new object was created...
134 #define DT_OBJ_ANIM 7 // Object animation has changed
135 #define DT_OBJ_TURRET 8 // Object's turrets have changed
136 #define DT_OBJ_EXPLODE 9 // Explode object
137 #define DT_PLAYER_DEATH 10 // Player died
138 #define DT_COLLIDE_PLR 11 // Player collided with a weapon
139 #define DT_COLLIDE_GEN 12 // generic collided with a weapon
140 #define DT_ATTACH 13 // Attach some objects
141 #define DT_ATTACH_RAD 14 // Attach some objects with a radius?
142 #define DT_UNATTACH 15 // Unattach some stuff
143 #define DT_WEAP_FIRE_FLAG 16 // flags like spraying and on/off
144 #define DT_PLAYER_INFO 17 // Player 1's info like energy/sheilds, etc.
145 #define DT_MSAFE 18 // MSAFE data (ie script stuff)
146 #define DT_POWERUP 19 // Powerups data
147 #define DT_CINEMATICS 20 // Cinematic info
148 #define DT_PERSISTANT_HUD 21 // Persistant hud message
149 #define DT_SETOBJDEAD 22 // Mark an object as dead
150 #define DT_PLAYERBALLS 23 // Rotating balls around player ship
151 #define DT_PLAYERTYPECHNG 24 // Player type is changing
152 #define DT_SETOBJLIFELEFT 25 // Object is getting OF_LIFELEFT flag changed
153 #define DT_2D_SOUND 26 // Play a 2d sound
154
155 // If not recording prompts user for filename and starts recording if successfull
156 // If recording, close the demo file
157 void DemoToggleRecording();
158
159 void DemoWriteChangedObj(object *op);
160
161 void DemoWriteHeader();
162
163 void DemoStartNewFrame();
164
165 void DemoWriteHudMessage(uint32_t color, bool blink, char *msg);
166
167 void DemoWriteChangedObjects();
168
169 void DemoWriteWeaponFire(uint16_t objectnum, vector *pos, vector *dir, uint16_t weaponnum,
170 uint16_t weapobjnum, int16_t gunnum);
171
172 void DemoWriteObjCreate(uint8_t type, uint16_t id, int roomnum, vector *pos, const matrix *orient, int parent_handle,
173 object *obj);
174
175 void DemoWriteTurretChanged(uint16_t objnum);
176
177 int DemoReadHeader();
178
179 int DemoPlaybackFile(char *filename);
180
181 bool LoadDemoDialog();
182
183 void DemoFrame();
184
185 void DemoAbort(bool deletefile = false);
186
187 void DemoWriteKillObject(object *hit_obj, object *killer, float damage, int death_flags, float delay, int seed);
188
189 void DemoWritePlayerDeath(object *player, bool melee, int fate = -1);
190
191 void DemoWrite3DSound(int16_t soundidx, uint16_t objnum, int priority, float volume = 0.5f);
192
193 void DemoWriteCollidePlayerWeapon(object *playerobj, object *weapon, vector *collision_point, vector *collision_normal,
194 bool f_reverse_normal, void *hit_info);
195
196 void DemoWriteCollideGenericWeapon(object *robotobj, object *weapon, vector *collision_point, vector *collision_normal,
197 bool f_reverse_normal, void *hit_info);
198
199 void DemoReadCollidePlayerWeapon(void);
200
201 void DemoReadCollideGenericWeapon(void);
202
203 void DemoReadNewFrame(void);
204
205 void DemoWriteObjAnimChanged(uint16_t objnum);
206
207 void DemoWriteAttachObjRad(object *parent, char parent_ap, object *child, float rad);
208
209 void DemoReadAttachObjRad(void);
210
211 void DemoWriteAttachObj(object *parent, char parent_ap, object *child, char child_ap, bool f_aligned);
212
213 void DemoReadAttachObj(void);
214
215 void DemoWriteUnattachObj(object *child);
216
217 void DemoReadUnattachObj(void);
218
219 void DemoPostPlaybackMenu(void);
220
221 void DemoReadObjWeapFireFlagChanged(void);
222
223 void DemoWriteObjWeapFireFlagChanged(int16_t objnum);
224
225 void DemoWritePlayerInfo(void);
226
227 void DemoReadPlayerInfo(void);
228
229 void DemoPlayAutoDemo(void);
230
231 void DemoWriteMSafe(uint8_t *data, uint16_t len);
232
233 void DemoReadMSafe();
234
235 void DemoWritePowerup(uint8_t *data, uint16_t len);
236
237 void DemoReadPowerups();
238
239 void DemoReadCinematics();
240
241 void DemoWriteCinematics(uint8_t *data, uint16_t len);
242
243 void DemoWritePersistantHUDMessage(ddgr_color color, int x, int y, float time, int flags, int sound_index, char *msg);
244
245 void DemoReadPersistantHUDMessage();
246
247 void DemoWriteSetObjDead(object *obj);
248 void DemoReadSetObjDead();
249
250 void DemoWritePlayerBalls(int pnum);
251 void DemoReadPlayerBalls(void);
252
253 void DemoWritePlayerTypeChange(int slot, bool stop_observing = false, int observer_mode = -1, int piggy_objnum = -1);
254 void DemoReadPlayerTypeChange(void);
255
256 void DemoWriteObjLifeLeft(object *obj);
257 void DemoReadObjLifeLeft(void);
258
259 void DemoWrite2DSound(int16_t soundidx, float volume = 0.5f);
260 void DemoRead2DSound(void);
261
262 #endif