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