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