1 // SONIC ROBO BLAST 2
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 1993-1996 by id Software, Inc.
4 // Copyright (C) 1998-2000 by DooM Legacy Team.
5 // Copyright (C) 1999-2020 by Sonic Team Junior.
6 //
7 // This program is free software distributed under the
8 // terms of the GNU General Public License, version 2.
9 // See the 'LICENSE' file for more details.
10 //-----------------------------------------------------------------------------
11 /// \file  g_demo.h
12 /// \brief Demo recording and playback
13 
14 #ifndef __G_DEMO__
15 #define __G_DEMO__
16 
17 #include "doomdef.h"
18 #include "doomstat.h"
19 #include "d_event.h"
20 
21 // ======================================
22 // DEMO playback/recording related stuff.
23 // ======================================
24 
25 // demoplaying back and demo recording
26 extern boolean demoplayback, titledemo, demorecording, timingdemo;
27 extern tic_t demostarttime;
28 
29 // Quit after playing a demo from cmdline.
30 extern boolean singledemo;
31 extern boolean demo_start;
32 extern boolean demosynced;
33 
34 extern mobj_t *metalplayback;
35 
36 // Only called by startup code.
37 void G_RecordDemo(const char *name);
38 void G_RecordMetal(void);
39 void G_BeginRecording(void);
40 void G_BeginMetal(void);
41 
42 // Only called by shutdown code.
43 void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings);
44 UINT8 G_CmpDemoTime(char *oldname, char *newname);
45 
46 typedef enum
47 {
48 	GHC_NORMAL = 0,
49 	GHC_SUPER,
50 	GHC_FIREFLOWER,
51 	GHC_INVINCIBLE,
52 	GHC_NIGHTSSKIN, // not actually a colour
53 	GHC_RETURNSKIN // ditto
54 } ghostcolor_t;
55 
56 // Record/playback tics
57 void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum);
58 void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum);
59 void G_GhostAddThok(void);
60 void G_GhostAddSpin(void);
61 void G_GhostAddRev(void);
62 void G_GhostAddColor(ghostcolor_t color);
63 void G_GhostAddFlip(void);
64 void G_GhostAddScale(fixed_t scale);
65 void G_GhostAddHit(mobj_t *victim);
66 void G_WriteGhostTic(mobj_t *ghost);
67 void G_ConsGhostTic(void);
68 void G_GhostTicker(void);
69 void G_ReadMetalTic(mobj_t *metal);
70 void G_WriteMetalTic(mobj_t *metal);
71 void G_SaveMetal(UINT8 **buffer);
72 void G_LoadMetal(UINT8 **buffer);
73 
74 void G_DeferedPlayDemo(const char *demo);
75 void G_DoPlayDemo(char *defdemoname);
76 void G_TimeDemo(const char *name);
77 void G_AddGhost(char *defdemoname);
78 void G_FreeGhosts(void);
79 void G_DoPlayMetal(void);
80 void G_DoneLevelLoad(void);
81 void G_StopMetalDemo(void);
82 ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill);
83 void G_StopDemo(void);
84 boolean G_CheckDemoStatus(void);
85 
86 #endif // __G_DEMO__
87