]> icculus.org git repositories - taylor/freespace2.git/blob - include/fred.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / fred.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/FRED.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * FRED.h : main header file for the FRED application
16  * Global editor dialog box classes are instantiated here, initializes the
17  * application (MFC level at least), processes the INI file.
18  *
19  * $Log$
20  * Revision 1.2  2002/06/09 04:41:13  relnev
21  * added copyright header
22  *
23  * Revision 1.1.1.1  2002/05/03 03:28:12  root
24  * Initial import.
25  *
26  * 
27  * 2     10/07/98 6:28p Dave
28  * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
29  * Fred. Globalized mission and campaign file extensions. Removed Silent
30  * Threat specific code.
31  * 
32  * 1     10/07/98 3:01p Dave
33  * 
34  * 1     10/07/98 3:00p Dave
35  * 
36  * 32    3/23/98 4:04p Hoffoss
37  * Fixed dialog window initialization so it looks better at startup (they
38  * don't flash on for a second).
39  * 
40  * 31    9/09/97 10:25a Hoffoss
41  * Fixed a potential problem.
42  * 
43  * 30    8/01/97 3:10p Hoffoss
44  * Made Sexp help hidable.
45  * 
46  * 29    6/18/97 11:46a Hoffoss
47  * Fixed initial order object reference updating and added briefing dialog
48  * window tracking data.
49  * 
50  * 28    6/05/97 6:10p Hoffoss
51  * Added features: Autosaving, object hiding.  Also fixed some minor bugs.
52  * 
53  * 27    6/02/97 11:52a Hoffoss
54  * Custom cursors displayed when over objects in different modes.
55  * 
56  * 26    5/29/97 5:15p Allender
57  * fixed macro for MODIFY so that it will work properly within 'if'
58  * statements
59  * 
60  * 25    4/29/97 12:24p Adam
61  * JAS:   Added code for delayed point to vec.   Fixed some FRED
62  * sequencing problems with g3_start_frame / g3_end_frame.
63  * 
64  * 24    4/17/97 2:01p Hoffoss
65  * All dialog box window states are saved between sessions now.
66  * 
67  * 23    4/01/97 11:07p Mike
68  * Clean up game sequencing functions.  Get rid of Multiplayer and add
69  * Game_mode.  Add SystemVars.cpp
70  * 
71  * 22    3/26/97 11:45a Hoffoss
72  * Fred uses fvi_ray_* functions now (as much as possible) for checking
73  * mouse selection stuff.
74  * 
75  * 21    2/28/97 11:31a Hoffoss
76  * Implemented modeless dialog saving and restoring, and changed some
77  * variables names.
78  * 
79  * 20    2/27/97 5:54p Hoffoss
80  * Implemented support for saving and restoring window positions.
81  * 
82  * 19    2/24/97 12:50p Hoffoss
83  * First attempt at non-continuous redrawing.
84  * 
85  * 18    2/20/97 5:42p Hoffoss
86  * Fixed bug in modification checking and updating macro.
87  * 
88  * 17    2/20/97 4:28p Hoffoss
89  * Added modification tracking to ship editor dialog box, and support
90  * functions.
91  * 
92  * 16    2/20/97 4:03p Hoffoss
93  * Several ToDo items: new reinforcement clears arrival cue, reinforcement
94  * control from ship and wing dialogs, show grid toggle.
95  * 
96  * 15    2/17/97 5:28p Hoffoss
97  * Checked RCS headers, added them were missing, changing description to
98  * something better, etc where needed.
99  * 
100  * 14    2/12/97 12:25p Hoffoss
101  * Expanded on global error checker, added initial orders conflict
102  * checking and warning, added waypoint editor dialog and code.
103  * 
104  * 13    1/30/97 2:24p Hoffoss
105  * Added remaining mission file structures and implemented load/save of
106  * them.
107  *
108  * $NoKeywords: $
109  */
110
111 #ifndef __AFXWIN_H__
112         #error include 'stdafx.h' before including this file for PCH
113 #endif
114
115 #include "systemvars.h"         //      Low level variables, common to FreeSpace and Fred
116 #include "resource.h"       // main symbols
117 #include "missionparse.h"
118 #include "shipeditordlg.h"
119 #include "wing_editor.h"
120 #include "waypointpathdlg.h"
121 #include "bgbitmapdlg.h"
122 #include "briefingeditordlg.h"
123 #include "systemvars.h"
124
125 #define MODIFY(a, b) do {       \
126         if (a != (b)) {                 \
127                 a = (b);                                        \
128                 set_modified();         \
129         }                                                               \
130 } while(0)
131
132 #define F_RENDER_SHIP_MODELS    0x01
133 #define F_RENDER_SHIP_ICONS     0x02
134
135 // user interface types
136 #define HOFFOSS_INTERFACE       1
137 #define ALLENDER_INTERFACE      2
138
139 typedef struct window_data {
140         WINDOWPLACEMENT p;
141         int visible;
142         int valid;
143         int processed;
144 } window_data;
145
146 /////////////////////////////////////////////////////////////////////////////
147 // CFREDApp:
148 // See FRED.cpp for the implementation of this class
149 //
150
151 class CFREDApp : public CWinApp
152 {
153         int app_init;
154
155 public:
156         void record_window_data(window_data *wndd, CWnd *wnd);
157         int init_window(window_data *wndd, CWnd *wnd, int adjust = 0, int pre = 0);
158         void read_window(char *name, window_data *wndd);
159         void write_window(char *name, window_data *wndd);
160         void write_ini_file(int degree = 0);
161         CFREDApp();
162
163         // Overrides
164         // ClassWizard generated virtual function overrides
165         //{{AFX_VIRTUAL(CFREDApp)
166         public:
167         virtual BOOL InitInstance();
168         virtual BOOL OnIdle(LONG lCount);
169         //}}AFX_VIRTUAL
170
171 // Implementation
172
173         //{{AFX_MSG(CFREDApp)
174         afx_msg void OnAppAbout();
175                 // NOTE - the ClassWizard will add and remove member functions here.
176                 //    DO NOT EDIT what you see in these blocks of generated code !
177         //}}AFX_MSG
178         DECLARE_MESSAGE_MAP()
179 };
180
181 /////////////////////////////////////////////////////////////////////////////
182
183 //      Add a message to be processed at the end of this frame.
184 //      This is useful if you need the display to update before it's useful
185 //      to process the message.  For example, right click brings up a popup menu.
186 //      But the menu it brings up depends on where you right clicked.  If you
187 //      right click on a ship, you get a message that pertains to the chosen
188 //      ship.  It is useful to have a visual indication that you have changed the
189 //      current ship.
190 void add_pending_message(HWND hwnd, int id, int wparam, int lparam, int skip_count);
191 void init_pending_messages(void);
192 void update_map_window();
193
194 extern int User_interface;
195 extern int Fred_active;
196 extern int Update_window;
197 extern HCURSOR h_cursor_move, h_cursor_rotate;
198
199 extern CWnd *Prev_window;
200 extern CShipEditorDlg   Ship_editor_dialog;
201 extern wing_editor              Wing_editor_dialog;
202 extern waypoint_path_dlg        Waypoint_editor_dialog;
203 extern bg_bitmap_dlg            *Bg_bitmap_dialog;
204 extern briefing_editor_dlg      *Briefing_dialog;
205
206 extern CFREDApp theApp;
207
208 extern window_data Main_wnd_data;
209 extern window_data Ship_wnd_data;
210 extern window_data Wing_wnd_data;
211 extern window_data Object_wnd_data;
212 extern window_data Mission_goals_wnd_data;
213 extern window_data Messages_wnd_data;
214 extern window_data Player_wnd_data;
215 extern window_data Events_wnd_data;
216 extern window_data Bg_wnd_data;
217 extern window_data Briefing_wnd_data;
218 extern window_data Reinforcement_wnd_data;
219 extern window_data Waypoint_wnd_data;
220 extern window_data Starfield_wnd_data;
221 extern window_data Asteroid_wnd_data;
222 extern window_data Mission_notes_wnd_data;
223