]> icculus.org git repositories - taylor/freespace2.git/blob - include/missionlog.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / missionlog.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/Mission/MissionLog.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file to deal with Mission logs
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:13  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
25  * 4     8/22/99 5:53p Dave
26  * Scoring fixes. Added self destruct key. Put callsigns in the logfile
27  * instead of ship designations for multiplayer players.
28  * 
29  * 3     2/26/99 6:01p Andsager
30  * Add sexp has-been-tagged-delay and cap-subsys-cargo-known-delay
31  * 
32  * 2     10/07/98 10:53a Dave
33  * Initial checkin.
34  * 
35  * 1     10/07/98 10:49a Dave
36  * 
37  * 21    4/28/98 4:45p Allender
38  * fix mission log problems on clients
39  * 
40  * 20    1/07/98 4:41p Allender
41  * minor modification to special messages.  Fixed cargo_revealed problem
42  * for multiplayer and problem with is-cargo-known sexpression
43  * 
44  * 19    11/13/97 1:21p Hoffoss
45  * Added a hidden flag to entries can be hidden from being displayed to
46  * the user (but kept in log for checking things).
47  * 
48  * 18    11/03/97 10:12p Hoffoss
49  * Finished up work on the hud message/mission log scrollback screen.
50  * 
51  * 17    9/10/97 8:53a Allender
52  * made the mission log prettier.  Added team info to log entries -- meant
53  * reordering some code
54  * 
55  * 16    8/31/97 6:38p Lawrance
56  * pass in frametime to do_frame loop
57  * 
58  * 15    8/07/97 11:37a Allender
59  * made mission log cull non-essential entries when log starts getting
60  * full.  More drastic action is taken as the log gets more full.
61  * 
62  * 14    7/02/97 10:49p Allender
63  * added waypoints-done sexpressions
64  * 
65  * 13    7/01/97 2:52p Allender
66  * added packets for mission log stuff and for pregame chat stuff
67  * 
68  * 12    3/04/97 1:21p Mike
69  * Repair/Rearm aborting, code cleanup.
70  * 
71  * 11    3/03/97 1:21p Allender
72  * mission log stuff -- display the log during/after game.  Enhanced
73  * structure
74  * 
75  * 10    2/20/97 5:05p Allender
76  * support for docking and undocking multiple times -- also able to
77  * specify dock points through sexpression
78  * 
79  * 9     2/17/97 3:50p Allender
80  * change to allow ability to destroy single subsystem (through orders) or
81  * all engines (disable) or all turrets (disarm)
82  * 
83  * 8     1/06/97 10:44p Lawrance
84  * Changes to make save/restore functional
85  * 
86  * 7     1/06/97 11:29a Allender
87  * added define for logging a ship that undocks
88  * 
89  * 6     1/01/97 4:18p Allender
90  * added new field in mission log entry -- secondary name.  Used when
91  * there are two objects for a log entry (i.e. docking)
92  * 
93  * 5     12/17/96 1:04p Allender
94  * added subtype field for mission messages -- not used yet and may be
95  * removed
96  * 
97  * 4     11/08/96 9:06a Allender
98  * added LOG_SHIP_DOCK
99  * 
100  * 3     10/24/96 8:36a Allender
101  * added a couple of new event types
102  * 
103  * 2     10/23/96 12:48p Allender
104  * increased mission log functionality -- function to get the timestamp
105  * that a recorded event happened at
106  * 
107  * 1     10/22/96 4:49p Allender
108  * Mission log files
109  * 
110 */
111
112 #ifndef _MISSIONLOG_H
113 #define _MISSIONLOG_H
114
115 // defined for different mission log entries
116
117 #define LOG_SHIP_DESTROYED                              1
118 #define LOG_WING_DESTROYED                              2
119 #define LOG_SHIP_ARRIVE                                 3
120 #define LOG_WING_ARRIVE                                 4
121 #define LOG_SHIP_DEPART                                 5
122 #define LOG_WING_DEPART                                 6
123 #define LOG_SHIP_DOCK                                   7
124 #define LOG_SHIP_SUBSYS_DESTROYED       8
125 #define LOG_SHIP_UNDOCK                                 9
126 #define LOG_SHIP_DISABLED                               10
127 #define LOG_SHIP_DISARMED                               11
128 #define LOG_PLAYER_REARM                                12
129 #define LOG_PLAYER_REINFORCEMENT                13
130 #define LOG_GOAL_SATISFIED                              14
131 #define LOG_GOAL_FAILED                                 15
132 #define LOG_PLAYER_REARM_ABORT          16
133 #define LOG_WAYPOINTS_DONE                              17
134 #define LOG_CARGO_REVEALED                              18
135 #define LOG_CAP_SUBSYS_CARGO_REVEALED 19
136 #define LOG_SELF_DESTRUCT                               20
137
138 // structure definition for log entries
139
140 #define MLF_ESSENTIAL                           (1<<0)          // this entry is essential for goal checking code
141 #define MLF_OBSOLETE                                    (1<<1)          // this entry is obsolete and will be removed
142 #define MLF_PRIMARY_FRIENDLY            (1<<2)          // primary object in this entry is friendly
143 #define MLF_PRIMARY_HOSTILE             (1<<3)          // primary object in this entry is hostile
144 #define MLF_SECONDARY_FRIENDLY  (1<<4)          // secondary object is friendly
145 #define MLF_SECONDARY_HOSTILE           (1<<5)          // secondary object is hostile
146 #define MLF_HIDDEN                                      (1<<6)          // entry doesn't show up in displayed log.
147
148 typedef struct {
149         int             type;                                                                   // one of the log #defines in MissionLog.h
150         int             flags;                                                          // flags used for status of this log entry
151         fix             timestamp;                                                      // time in fixed seconds when entry was made from beginning of mission
152         char            pname[NAME_LENGTH];                             // name of primary object of this action
153         char            sname[NAME_LENGTH];                             // name of secondary object of this action
154         int             index;                                                          // a generic entry which can contain things like wave # (for wing arrivals), goal #, etc
155 } log_entry;
156
157 extern log_entry log_entries[];
158 extern int last_entry;
159 extern int Num_log_lines;
160
161 // function prototypes
162
163 // to be called before each mission starts
164 extern void mission_log_init();
165
166 // adds an entry to the mission log.  The name is a string identifier that is the object
167 // of the event.  The multiplayer version of this takes the actual entry number to modify.
168 extern void mission_log_add_entry(int type, const char *pname, const char *sname, int index = -1 );
169 extern void mission_log_add_entry_multi( int type, const char *pname, const char *sname, int index, fix timestamp, int flags );
170
171 // function to determine if event happened and what time it happened
172 extern int mission_log_get_time( int type, const char *name, const char *sname, fix *time);
173
174 // function to determine if event happend count times and return time that the count event
175 // happened
176 extern int mission_log_get_time_indexed( int type, const char *name, const char *sname, int count, fix *time);
177
178 // function to show all message log entries during or after mission
179 // (code stolen liberally from Alan!)
180 extern void mission_log_scrollback(float frametime);
181
182 void message_log_init_scrollback(int pw);
183 void message_log_shutdown_scrollback();
184 void mission_log_scrollback(int scroll_offset, int list_x, int list_y, int list_w, int list_h);
185
186 #endif
187