]> icculus.org git repositories - taylor/freespace2.git/blob - include/demo.h
Initial revision
[taylor/freespace2.git] / include / demo.h
1 /*
2  * $Logfile: /Freespace2/code/Demo/Demo.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  *
8  * $Log$
9  * Revision 1.1  2002/05/03 03:28:11  root
10  * Initial revision
11  *
12  * 
13  * 3     3/29/99 6:17p Dave
14  * More work on demo system. Got just about everything in except for
15  * blowing ships up, secondary weapons and player death/warpout.
16  * 
17  * 2     3/28/99 5:58p Dave
18  * Added early demo code. Make objects move. Nice and framerate
19  * independant, but not much else. Don't use yet unless you're me :)
20  *  
21  *  
22  * $NoKeywords: $
23  */
24
25 #ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
26 #define _FS2_DEMO_SYSTEM_HEADER_FILE
27
28 // -----------------------------------------------------------------------------------------------------------------------------
29 // DEMO DEFINES/VARS
30 //
31
32 // compile in the demo system
33 #define DEMO_SYSTEM
34
35 struct object;
36 struct ship;
37
38 // an error reading or writing the demo file
39 #define DEMO_ERROR_NONE                                 0                                       // no error
40 #define DEMO_ERROR_GENERAL                              1                                       // general problem
41 #define DEMO_ERROR_FRAMESIZE                    2                                       // frame size was too big (> 32k)
42 #define DEMO_ERROR_DISK_SPACE                   3                                       // out of disk space
43 #define DEMO_ERROR_DISK_ACCESS          4                                       // problem accessing disk
44 #define DEMO_ERROR_VERSION                              5                                       // bad version #
45 #define DEMO_ERROR_MISSION                              6                                       // different mission file checksums
46 extern int Demo_error;
47
48 extern int Demo_make;
49
50 // -----------------------------------------------------------------------------------------------------------------------------
51 // DEMO FUNCTIONS
52 //
53
54 // do frame for the demo - start for the frame
55 int demo_do_frame_start();
56
57 // do frame for the demo - end for the frame
58 int demo_do_frame_end();
59
60 // initialize a demo for recording
61 // NOTE : call this after loading the mission and going through the briefing, but _before_ physically moving into the mission
62 int demo_start_record(char *file);
63
64 // initialize a demo for playback - calling this will load up the demo file and move the player into the playback state
65 int demo_start_playback(char *file);
66
67 // finish the demo, whether recording or playing back
68 void demo_close();
69
70 // if we should run the simulation for this object, or let the demo system handle it
71 int demo_should_sim(object *objp);
72
73
74 // functions for posting critical events to the demo system ------------------------------------------------------------
75
76 // post an object dump event (only used internally)
77 void demo_POST_object_dump();
78
79 // post a primary fired event
80 void demo_POST_primary_fired(object *objp, int banks, int linked);
81
82 // post a unique message
83 void demo_POST_unique_message(char *id, char *who_from, int m_source, int priority);
84
85 // post a builtin message
86 void demo_POST_builtin_message(int type, ship *shipp, int priority, int timing);
87
88 // post an object create message
89 void demo_POST_obj_create(char *pobj_name, int signature);
90
91 // post a warpin event
92 void demo_POST_warpin(int signature, int ship_flags);
93
94 // post a warpout event
95 void demo_POST_warpout(int signature, int ship_flags);
96
97 // post a departed event
98 void demo_POST_departed(int signature, int ship_flags);
99
100 // post a ship kill event
101 void demo_POST_ship_kill(object *objp);
102
103 #endif
104