]> icculus.org git repositories - taylor/freespace2.git/blob - include/missionsave.h
Initial revision
[taylor/freespace2.git] / include / missionsave.h
1 /*
2  * $Logfile: /Freespace2/code/FRED2/MissionSave.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Mission saving in Fred.
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 4     1/19/99 3:57p Andsager
15  * Round 2 of variables
16  * 
17  * 3     10/29/98 6:49p Dave
18  * Finished up Fred support for externalizing mission and campaign files.
19  * 
20  * 2     10/07/98 6:28p Dave
21  * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
22  * Fred. Globalized mission and campaign file extensions. Removed Silent
23  * Threat specific code.
24  * 
25  * 1     10/07/98 3:00p Dave
26  * 
27  * 21    9/10/98 1:17p Dave
28  * Put in code to flag missions and campaigns as being MD or not in Fred
29  * and Freespace. Put in multiplayer support for filtering out MD
30  * missions. Put in multiplayer popups for warning of non-valid missions.
31  * 
32  * 20    4/14/98 11:55a Allender
33  * add end-of-campaign sexpression to allow for mission replay at the end
34  * of campaigns
35  * 
36  * 19    3/05/98 3:59p Hoffoss
37  * Added a bunch of new command brief stuff, and asteroid initialization
38  * to Fred.
39  * 
40  * 18    9/30/97 5:56p Hoffoss
41  * Added music selection combo boxes to Fred.
42  * 
43  * 17    8/25/97 5:56p Hoffoss
44  * Added multiple asteroid field support, loading and saving of asteroid
45  * fields, and ship score field to Fred.
46  * 
47  * 16    8/17/97 10:22p Hoffoss
48  * Fixed several bugs in Fred with Undo feature.  In the process, recoded
49  * a lot of CFile.cpp.
50  * 
51  * 15    6/17/97 3:01p Lawrance
52  * allow FRED to save new briefing format
53  * 
54  * 14    6/09/97 4:57p Hoffoss
55  * Added autosave and undo to Fred.
56  * 
57  * 13    6/05/97 6:10p Hoffoss
58  * Added features: Autosaving, object hiding.  Also fixed some minor bugs.
59  * 
60  * 12    5/13/97 10:52a Hoffoss
61  * Added campaign saving code.
62  * 
63  * 11    4/21/97 5:02p Hoffoss
64  * Player/player status editing supported, and both saved and loaded from
65  * Mission files.
66  * 
67  * 10    4/16/97 2:05p Hoffoss
68  * Mission saving and loading of turret info now implemented.
69  * 
70  * 9     3/10/97 6:43p Hoffoss
71  * Standardized docking goal usage by fred to use names instead of
72  * indexes.
73  * 
74  * 8     2/05/97 2:57p Hoffoss
75  * Added support for wing goals (initial orders) in Fred.
76  * 
77  * 7     1/30/97 2:24p Hoffoss
78  * Added remaining mission file structures and implemented load/save of
79  * them.
80  *
81  * $NoKeywords: $
82  */
83
84 #ifndef __MISSION_SAVE_CPP__
85 #define __MISSION_SAVE_CPP__
86
87 #include <stdio.h>
88 #include "missionparse.h"
89 #include "parselo.h"
90 #include "ailocal.h"
91 #include "ai.h"
92
93 #define BACKUP_DEPTH    9
94
95 class CFred_mission_save {
96 private:
97         char *raw_ptr;
98         int err;
99         CFILE *fp;
100
101         int save_mission_info();
102         int save_plot_info();
103         int save_variables();
104 //      int save_briefing_info();
105         int save_cmd_brief();
106         int save_cmd_briefs();
107         int save_briefing();
108         int save_debriefing();
109         int save_players();
110         int save_objects();
111         int save_common_object_data(object *objp, ship *shipp);
112         int save_wings();
113         int save_goals();
114         int save_waypoints();
115         int save_waypoint_list(waypoint_list &w);
116         int save_vector(vector &v);
117         int save_matrix(matrix &m);
118         int save_messages();
119         int save_events();
120         int save_asteroid_fields();
121         int save_music();
122         void save_campaign_sexp(int node, int link);
123
124 public:
125         void save_turret_info(ship_subsys *ptr, int ship);
126         int save_bitmaps();
127         int save_reinforcements();
128         void save_ai_goals(ai_goals *goalp, int ship);
129         int fout(char *format, ...);
130         int fout_ext(char *format, ...);
131         void parse_comments(int = 1);
132         CFred_mission_save() : err(0), raw_ptr(Mission_text_raw) { }
133         int save_mission_file(char *pathname);
134         int autosave_mission_file(char *pathname);
135         int save_campaign_file(char *pathname);         
136 };
137
138 #endif
139