File: missionsave.h

package info (click to toggle)
freespace2 3.7.4%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: buster
  • size: 22,236 kB
  • sloc: cpp: 393,535; ansic: 4,106; makefile: 1,091; xml: 181; sh: 137
file content (89 lines) | stat: -rw-r--r-- 2,406 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/



#ifndef __MISSION_SAVE_CPP__
#define __MISSION_SAVE_CPP__

#include <stdio.h>
#include "mission/missionparse.h"
#include "parse/parselo.h"
#include "ai/ai.h"
#include "cfile/cfile.h"
#include "ship/ship.h"
#include "object/waypoint.h"

#include <string>

#define BACKUP_DEPTH	9

class CFred_mission_save {
private:
	char *raw_ptr;
	SCP_vector<SCP_string> fso_ver_comment;
	int err;
	CFILE *fp;

	int save_mission_info();
	int save_plot_info();
	int save_variables();
//	int save_briefing_info();
	int save_cutscenes();
	int save_fiction();
	int save_cmd_brief();
	int save_cmd_briefs();
	int save_briefing();
	int save_debriefing();
	int save_players();
	int save_objects();
	int save_common_object_data(object *objp, ship *shipp);
	int save_wings();
	int save_goals();
	int save_waypoints();
	int save_waypoint_list(waypoint_list *w);
	int save_vector(vec3d &v);
	int save_matrix(matrix &m);
	int save_messages();
	int save_events();
	int save_asteroid_fields();
	int save_music();
	void save_campaign_sexp(int node, int link);
	void save_single_dock_instance(ship *shipp, dock_instance *dock_ptr);
	
	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);

	void convert_special_tags_to_retail(char *text, int max_len);
	void convert_special_tags_to_retail(SCP_string &text);
	void convert_special_tags_to_retail();

	void save_mission_internal(const char *pathname);

public:
	void save_turret_info(ship_subsys *ptr, int ship);
	int save_bitmaps();
	int save_reinforcements();
	void save_ai_goals(ai_goal *goalp, int ship);
	int fout(char *format, ...);
	int fout_version(char *format, ...);
	int fout_ext(char *pre_str, char *format, ...);
	void parse_comments(int = 1);
	CFred_mission_save() : err(0), raw_ptr(Mission_text_raw) { }
	int save_mission_file(char *pathname);
	int autosave_mission_file(char *pathname);
	int save_campaign_file(char *pathname);		

	void fso_comment_push(char *ver);
	void fso_comment_pop(bool pop_all = false);

	// Goober5000
	void bypass_comment(const char *comment, const char *end = NULL);
};

#endif