FS2_Open
Open source remastering of the Freespace 2 engine
missionsave.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 __MISSION_SAVE_CPP__
13 #define __MISSION_SAVE_CPP__
14 
15 #include <stdio.h>
16 #include "mission/missionparse.h"
17 #include "parse/parselo.h"
18 #include "ai/ai.h"
19 #include "cfile/cfile.h"
20 #include "ship/ship.h"
21 #include "object/waypoint.h"
22 
23 #include <string>
24 
25 #define BACKUP_DEPTH 9
26 
28 private:
29  char *raw_ptr;
30  SCP_vector<SCP_string> fso_ver_comment;
31  int err;
32  CFILE *fp;
33 
34  int save_mission_info();
35  int save_plot_info();
36  int save_variables();
37 // int save_briefing_info();
38  int save_cutscenes();
39  int save_fiction();
40  int save_cmd_brief();
41  int save_cmd_briefs();
42  int save_briefing();
43  int save_debriefing();
44  int save_players();
45  int save_objects();
46  int save_common_object_data(object *objp, ship *shipp);
47  int save_wings();
48  int save_goals();
49  int save_waypoints();
50  int save_waypoint_list(waypoint_list *w);
51  int save_vector(vec3d &v);
52  int save_matrix(matrix &m);
53  int save_messages();
54  int save_events();
55  int save_asteroid_fields();
56  int save_music();
57  void save_campaign_sexp(int node, int link);
58  void save_single_dock_instance(ship *shipp, dock_instance *dock_ptr);
59 
60  void save_custom_bitmap(const char *expected_string_640, const char *expected_string_1024, const char *string_field_640, const char *string_field_1024, int blank_lines = 0);
61 
62  void convert_special_tags_to_retail(char *text, int max_len);
63  void convert_special_tags_to_retail(SCP_string &text);
64  void convert_special_tags_to_retail();
65 
66  void save_mission_internal(const char *pathname);
67 
68 public:
69  void save_turret_info(ship_subsys *ptr, int ship);
70  int save_bitmaps();
71  int save_reinforcements();
72  void save_ai_goals(ai_goal *goalp, int ship);
73  int fout(char *format, ...);
74  int fout_version(char *format, ...);
75  int fout_ext(char *pre_str, char *format, ...);
76  void parse_comments(int = 1);
77  CFred_mission_save() : err(0), raw_ptr(Mission_text_raw) { }
78  int save_mission_file(char *pathname);
79  int autosave_mission_file(char *pathname);
80  int save_campaign_file(char *pathname);
81 
82  void fso_comment_push(char *ver);
83  void fso_comment_pop(bool pop_all = false);
84 
85  // Goober5000
86  void bypass_comment(const char *comment, const char *end = NULL);
87 };
88 
89 #endif
GLenum GLsizei GLenum format
Definition: Gl.h:1509
void fso_comment_pop(bool pop_all=false)
int save_campaign_file(char *pathname)
Definition: pstypes.h:88
Definition: cfile.h:28
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
object * objp
Definition: lua.cpp:3105
ship * shipp
Definition: lua.cpp:9162
void save_turret_info(ship_subsys *ptr, int ship)
int fout_ext(char *pre_str, char *format,...)
int autosave_mission_file(char *pathname)
Definition: ship.h:534
int fout(char *format,...)
GLubyte GLubyte GLubyte GLubyte w
Definition: Glext.h:5679
int save_mission_file(char *pathname)
int fout_version(char *format,...)
char * Mission_text_raw
Definition: parselo.cpp:47
const GLfloat * m
Definition: Glext.h:10319
void parse_comments(int=1)
Definition: ai.h:134
void bypass_comment(const char *comment, const char *end=NULL)
void fso_comment_push(char *ver)
const GLdouble * v
Definition: Glext.h:5322
void save_ai_goals(ai_goal *goalp, int ship)
GLuint GLuint end
Definition: Gl.h:1502