]> icculus.org git repositories - taylor/freespace2.git/blob - include/freddoc.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / freddoc.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/FREDDoc.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * FREDDoc.h : interface of the CFREDDoc class
16  * Document class for document/view architechure, which we don't really use in
17  * Fred, but MFC forces you do use like it or not.  Handles loading/saving
18  * mainly.  Most of the MFC related stuff is handled in FredView.
19  *
20  * $Log$
21  * Revision 1.2  2002/06/09 04:41:13  relnev
22  * added copyright header
23  *
24  * Revision 1.1.1.1  2002/05/03 03:28:12  root
25  * Initial import.
26  *
27  * 
28  * 2     10/07/98 6:28p Dave
29  * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
30  * Fred. Globalized mission and campaign file extensions. Removed Silent
31  * Threat specific code.
32  * 
33  * 1     10/07/98 3:01p Dave
34  * 
35  * 1     10/07/98 3:00p Dave
36  * 
37  * 15    8/17/97 10:22p Hoffoss
38  * Fixed several bugs in Fred with Undo feature.  In the process, recoded
39  * a lot of CFile.cpp.
40  * 
41  * 14    8/13/97 5:49p Hoffoss
42  * Fixed bugs, made additions.
43  * 
44  * 13    8/13/97 12:46p Hoffoss
45  * Added campaign error checker, accelerator table, and mission goal data
46  * listings to sexp tree right click menu.
47  * 
48  * 12    6/09/97 4:57p Hoffoss
49  * Added autosave and undo to Fred.
50  * 
51  * 11    6/05/97 6:10p Hoffoss
52  * Added features: Autosaving, object hiding.  Also fixed some minor bugs.
53  * 
54  * 10    5/21/97 5:42p Hoffoss
55  * Added features requested on Todo list.
56  * 
57  * 9     2/20/97 4:03p Hoffoss
58  * Several ToDo items: new reinforcement clears arrival cue, reinforcement
59  * control from ship and wing dialogs, show grid toggle.
60  * 
61  * 8     2/17/97 5:28p Hoffoss
62  * Checked RCS headers, added them were missing, changing description to
63  * something better, etc where needed.
64  * 
65  * 14    2/12/97 12:25p Hoffoss
66  * Expanded on global error checker, added initial orders conflict
67  * checking and warning, added waypoint editor dialog and code.
68  * 
69  * 13    1/30/97 2:24p Hoffoss
70  * Added remaining mission file structures and implemented load/save of
71  * them.
72  *
73  * $NoKeywords: $
74  */
75
76 #ifndef _FREDDOC_H
77 #define _FREDDOC_H
78
79 #include "ailocal.h"
80 #include "missionsave.h"
81
82 #define MISSION_BACKUP_NAME     "Backup"
83
84 #define US_WORLD_CHANGED        0x01
85 #define US_VIEW_CHANGED         0x02
86
87 class CFREDDoc : public CDocument
88 {
89 protected: // create from serialization only
90         CFREDDoc();
91         DECLARE_DYNCREATE(CFREDDoc)
92
93 // Attributes
94 public:
95         int check_undo();
96         int autoload();
97         int load_mission(char *pathname);
98         int autosave(char *desc);
99         int save_matrix(matrix &m, FILE *fp);
100         int save_vector(vector &v, FILE *fp);
101         BOOL confirm_deleting;
102         BOOL show_capital_ships;
103         BOOL show_elevations;
104         BOOL show_fighters;
105         BOOL show_grid;
106         BOOL show_misc_objects;
107         BOOL show_planets;
108         BOOL show_waypoints;
109         BOOL show_starfield;
110         char mission_pathname[256];
111
112 // Operations
113 public:
114         CString undo_desc[BACKUP_DEPTH + 1];
115
116 // Overrides
117         // ClassWizard generated virtual function overrides
118         //{{AFX_VIRTUAL(CFREDDoc)
119         public:
120         virtual BOOL OnNewDocument();
121         virtual void Serialize(CArchive& ar);
122         virtual void OnEditClearAll();
123         virtual void DeleteContents();
124         virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
125         virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
126         //}}AFX_VIRTUAL
127
128 // Implementation
129 public:
130         virtual ~CFREDDoc();
131         static void UpdateStatus(int flags = US_WORLD_CHANGED);
132
133 #ifdef _DEBUG
134         virtual void AssertValid() const;
135         virtual void Dump(CDumpContext &dc) const;
136 #endif
137
138 protected:
139
140 // Generated message map functions
141 protected:
142         //{{AFX_MSG(CFREDDoc)
143         afx_msg void OnEditDelete();
144         afx_msg void OnDuplicate();
145         afx_msg void OnEditCopy();
146         afx_msg void OnEditCut();
147         afx_msg void OnEditHold();
148         afx_msg void OnEditFetch();
149         afx_msg void OnEditPaste();
150         afx_msg void OnEditUndo();
151         afx_msg void OnFilePreferences();
152         afx_msg void OnFileSave();
153         afx_msg void OnFileNew();
154         afx_msg void editor_init_mission();
155         //}}AFX_MSG
156         DECLARE_MESSAGE_MAP()
157
158 private:
159         int save_waypoint_list(waypoint_list &w, FILE *fp);
160         int save_waypoints(FILE *fp);
161         int save_goals(FILE *fp);
162         int save_wings(FILE *fp);
163         int save_objects(FILE *fp);
164         int save_players(FILE *fp);
165         int save_briefing_info(FILE *fp);
166         int save_plot_info(FILE *fp);
167         int save_mission_info(FILE *FP);
168 };
169
170 extern int Local_modified;
171 extern int Undo_available;
172 extern int Undo_count;
173 extern CFREDDoc *FREDDoc_ptr;
174
175 void set_modified(BOOL arg = TRUE);
176
177 /////////////////////////////////////////////////////////////////////////////
178
179 #endif
180