FS2_Open
Open source remastering of the Freespace 2 engine
missionlog.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _MISSIONLOG_H
13 #define _MISSIONLOG_H
14 
15 #include "globalincs/globals.h"
16 #include "globalincs/pstypes.h"
17 
18 // defined for different mission log entries
19 
20 #define LOG_SHIP_DESTROYED 1
21 #define LOG_WING_DESTROYED 2
22 #define LOG_SHIP_ARRIVED 3
23 #define LOG_WING_ARRIVED 4
24 #define LOG_SHIP_DEPARTED 5
25 #define LOG_WING_DEPARTED 6
26 #define LOG_SHIP_DOCKED 7
27 #define LOG_SHIP_SUBSYS_DESTROYED 8
28 #define LOG_SHIP_UNDOCKED 9
29 #define LOG_SHIP_DISABLED 10
30 #define LOG_SHIP_DISARMED 11
31 #define LOG_PLAYER_CALLED_FOR_REARM 12
32 #define LOG_PLAYER_CALLED_FOR_REINFORCEMENT 13
33 #define LOG_GOAL_SATISFIED 14
34 #define LOG_GOAL_FAILED 15
35 #define LOG_PLAYER_ABORTED_REARM 16
36 #define LOG_WAYPOINTS_DONE 17
37 #define LOG_CARGO_REVEALED 18
38 #define LOG_CAP_SUBSYS_CARGO_REVEALED 19
39 #define LOG_SELF_DESTRUCTED 20
40 
41 // structure definition for log entries
42 
43 #define MLF_ESSENTIAL (1 << 0) // this entry is essential for goal checking code
44 #define MLF_OBSOLETE (1 << 1) // this entry is obsolete and will be removed
45 #define MLF_HIDDEN (1 << 2) // entry doesn't show up in displayed log.
46 
47 typedef struct {
48  int type; // one of the log #defines in MissionLog.h
49  int flags; // flags used for status of this log entry
50  fix timestamp; // time in fixed seconds when entry was made from beginning of mission
51  char pname[NAME_LENGTH]; // name of primary object of this action
52  char sname[NAME_LENGTH]; // name of secondary object of this action
53  int index; // a generic entry which can contain things like wave # (for wing arrivals), goal #, etc
54 
55  // Goober5000
58 } log_entry;
59 
60 extern log_entry log_entries[];
61 extern int last_entry;
62 extern int Num_log_lines;
63 
64 // function prototypes
65 
66 // to be called before each mission starts
67 extern void mission_log_init();
68 
69 // adds an entry to the mission log. The name is a string identifier that is the object
70 // of the event. The multiplayer version of this takes the actual entry number to modify.
71 extern void mission_log_add_entry(int type, char *pname, char *sname, int index = -1);
72 extern void mission_log_add_entry_multi( int type, char *pname, char *sname, int index, fix timestamp, int flags);
73 
74 // function to determine if event happened and what time it happened
75 extern int mission_log_get_time( int type, char *name, char *sname, fix *time);
76 
77 // function to determine if event happend count times and return time that the count event
78 // happened
79 extern int mission_log_get_time_indexed( int type, char *name, char *sname, int count, fix *time);
80 
81 // get the number of times an event happened
82 extern int mission_log_get_count( int type, char *pname, char *sname );
83 
84 // function to show all message log entries during or after mission
85 // (code stolen liberally from Alan!)
86 extern void mission_log_scrollback(float frametime);
87 
88 void message_log_init_scrollback(int pw);
90 void mission_log_scrollback(int scroll_offset, int list_x, int list_y, int list_w, int list_h);
91 
92 #endif
int timestamp(int delta_ms)
Definition: timer.cpp:226
void message_log_shutdown_scrollback()
Definition: missionlog.cpp:839
int primary_team
Definition: missionlog.h:56
GLuint index
Definition: Glext.h:5608
int index
Definition: missionlog.h:53
int flags
Definition: missionlog.h:49
int mission_log_get_time(int type, char *name, char *sname, fix *time)
Definition: missionlog.cpp:498
void mission_log_init()
Definition: missionlog.cpp:72
int last_entry
Definition: missionlog.cpp:70
void mission_log_add_entry(int type, char *pname, char *sname, int index=-1)
Definition: missionlog.cpp:184
int Num_log_lines
Definition: missionlog.cpp:62
GLenum type
Definition: Gl.h:1492
int type
Definition: missionlog.h:48
GLenum pname
Definition: Gl.h:1517
void mission_log_scrollback(float frametime)
long fix
Definition: pstypes.h:54
log_entry log_entries[]
Definition: missionlog.cpp:69
GLbitfield flags
Definition: Glext.h:6722
GLuint const GLchar * name
Definition: Glext.h:5608
void mission_log_add_entry_multi(int type, char *pname, char *sname, int index, fix timestamp, int flags)
Definition: missionlog.cpp:393
fix timestamp
Definition: missionlog.h:50
int secondary_team
Definition: missionlog.h:57
#define NAME_LENGTH
Definition: globals.h:15
int mission_log_get_count(int type, char *pname, char *sname)
Definition: missionlog.cpp:505
Definition: missionlog.h:47
GLint GLsizei count
Definition: Gl.h:1491
void message_log_init_scrollback(int pw)
Definition: missionlog.cpp:645
int mission_log_get_time_indexed(int type, char *name, char *sname, int count, fix *time)
Definition: missionlog.cpp:430