FS2_Open
Open source remastering of the Freespace 2 engine
briefingeditordlg.cpp
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 #include "stdafx.h"
13 #include "FRED.h"
14 #include "BriefingEditorDlg.h"
15 #include "FREDDoc.h"
17 #include "mission/missionparse.h"
18 #include "FredRender.h"
19 #include "Management.h"
20 #include "globalincs/linklist.h"
21 #include "MainFrm.h"
22 #include "bmpman/bmpman.h"
23 #include "gamesnd/eventmusic.h"
24 #include "starfield/starfield.h"
25 #include "jumpnode/jumpnode.h"
26 #include "cfile/cfile.h"
27 #include "object/objectdock.h"
28 #include "iff_defs/iff_defs.h"
29 #include "sound/audiostr.h"
30 #include "localization/localize.h"
31 
32 #ifdef _DEBUG
33 #undef THIS_FILE
34 static char THIS_FILE[] = __FILE__;
35 #endif
36 
37 #define ID_MENU 9000
38 
39 static int Max_icons_for_lines;
40 
42 // briefing_editor_dlg dialog
43 
45  : CDialog(briefing_editor_dlg::IDD, pParent)
46 {
47  int i, z;
48 
49  // figure out max icons we can have with lines to each other less than max allowed lines.
50  // Basically, # lines = (# icons - 1) factorial
51  Max_icons_for_lines = 0;
52  do {
53  i = ++Max_icons_for_lines + 1;
54  z = 0;
55  while (--i)
56  z += i;
57 
58  } while (z < MAX_BRIEF_STAGE_LINES);
59 
60  //{{AFX_DATA_INIT(briefing_editor_dlg)
61  m_hilight = FALSE;
62  m_icon_image = -1;
63  m_icon_label = _T("");
64  m_stage_title = _T("");
65  m_text = _T("");
66  m_time = _T("");
67  m_voice = _T("");
68  m_icon_text = _T("");
69  m_icon_team = -1;
70  m_ship_type = -1;
72  m_id = 0;
73  m_briefing_music = -1;
75  m_cut_next = FALSE;
76  m_cut_prev = FALSE;
77  m_current_briefing = -1;
78  m_flipicon = FALSE;
79  m_use_wing = FALSE;
81  //}}AFX_DATA_INIT
82  m_voice_id = -1;
83  m_cur_stage = 0;
85  m_tree.link_modified(&modified); // provide way to indicate trees are modified in dialog
86 
87  // copy view initialization
88  m_copy_view_set = 0;
89 }
90 
91 void briefing_editor_dlg::DoDataExchange(CDataExchange* pDX)
92 {
93  CDialog::DoDataExchange(pDX);
94  //{{AFX_DATA_MAP(briefing_editor_dlg)
95  DDX_Control(pDX, IDC_TREE, m_tree);
96  DDX_Control(pDX, IDC_LINES, m_lines);
97  DDX_Check(pDX, IDC_HILIGHT, m_hilight);
98  DDX_CBIndex(pDX, IDC_ICON_IMAGE, m_icon_image);
99  DDX_Text(pDX, IDC_ICON_LABEL, m_icon_label);
100  DDX_Text(pDX, IDC_STAGE_TITLE, m_stage_title);
101  DDX_Text(pDX, IDC_TEXT, m_text);
102  DDX_Text(pDX, IDC_TIME, m_time);
103  DDX_Text(pDX, IDC_VOICE, m_voice);
104  DDX_Text(pDX, IDC_ICON_TEXT, m_icon_text);
105  DDX_CBIndex(pDX, IDC_TEAM, m_icon_team);
106  DDX_CBIndex(pDX, IDC_SHIP_TYPE, m_ship_type);
107  DDX_Check(pDX, IDC_LOCAL, m_change_local);
108  DDX_Text(pDX, IDC_ID, m_id);
109  DDX_CBIndex(pDX, IDC_BRIEFING_MUSIC, m_briefing_music);
111  DDX_Check(pDX, IDC_CUT_NEXT, m_cut_next);
112  DDX_Check(pDX, IDC_CUT_PREV, m_cut_prev);
113  DDX_Check(pDX, IDC_FLIP_ICON, m_flipicon);
114  DDX_Check(pDX, IDC_USE_WING_ICON, m_use_wing);
115  DDX_Check(pDX, IDC_USE_CARGO_ICON, m_use_cargo);
116  //}}AFX_DATA_MAP
117 
118  DDV_MaxChars(pDX, m_voice, MAX_FILENAME_LEN - 1);
119  DDV_MaxChars(pDX, m_icon_label, MAX_LABEL_LEN - 1);
120  DDV_MaxChars(pDX, m_icon_text, MAX_ICON_TEXT_LEN - 1);
121 }
122 
123 BEGIN_MESSAGE_MAP(briefing_editor_dlg, CDialog)
124  //{{AFX_MSG_MAP(briefing_editor_dlg)
125  ON_WM_CLOSE()
126  ON_BN_CLICKED(IDC_NEXT, OnNext)
127  ON_BN_CLICKED(IDC_PREV, OnPrev)
128  ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
129  ON_BN_CLICKED(IDC_ADD_STAGE, OnAddStage)
130  ON_BN_CLICKED(IDC_DELETE_STAGE, OnDeleteStage)
131  ON_BN_CLICKED(IDC_INSERT_STAGE, OnInsertStage)
132  ON_BN_CLICKED(IDC_MAKE_ICON, OnMakeIcon)
133  ON_BN_CLICKED(IDC_DELETE_ICON, OnDeleteIcon)
134  ON_BN_CLICKED(IDC_GOTO_VIEW, OnGotoView)
135  ON_BN_CLICKED(IDC_SAVE_VIEW, OnSaveView)
136  ON_CBN_SELCHANGE(IDC_ICON_IMAGE, OnSelchangeIconImage)
137  ON_CBN_SELCHANGE(IDC_TEAM, OnSelchangeTeam)
138  ON_CBN_SELCHANGE(IDC_SHIP_TYPE, OnSelchangeShipType)
139  ON_BN_CLICKED(IDC_PROPAGATE_ICONS, OnPropagateIcons)
140  ON_WM_INITMENU()
141  ON_BN_CLICKED(IDC_LINES, OnLines)
142  ON_NOTIFY(NM_RCLICK, IDC_TREE, OnRclickTree)
143  ON_NOTIFY(TVN_BEGINLABELEDIT, IDC_TREE, OnBeginlabeleditTree)
144  ON_NOTIFY(TVN_ENDLABELEDIT, IDC_TREE, OnEndlabeleditTree)
145  ON_BN_CLICKED(IDC_PLAY, OnPlay)
146  ON_BN_CLICKED(IDC_COPY_VIEW, OnCopyView)
147  ON_BN_CLICKED(IDC_PASTE_VIEW, OnPasteView)
148  ON_BN_CLICKED(IDC_FLIP_ICON, OnFlipIcon)
149  ON_BN_CLICKED(IDC_USE_WING_ICON, OnWingIcon)
150  ON_BN_CLICKED(IDC_USE_CARGO_ICON, OnCargoIcon)
151  //}}AFX_MSG_MAP
152 END_MESSAGE_MAP()
153 
155 // briefing_editor_dlg message handlers
156 
157 void briefing_editor_dlg::OnInitMenu(CMenu* pMenu)
158 {
159  int i;
160  CMenu *m;
161 
162  // disable any items we should disable
163  m = pMenu->GetSubMenu(0);
164 
165  // uncheck all menu items
166  for (i=0; i<Num_teams; i++)
167  m->CheckMenuItem(i, MF_BYPOSITION | MF_UNCHECKED);
168 
169  for (i=Num_teams; i<MAX_TVT_TEAMS; i++)
170  m->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED);
171 
172  // put a check next to the currently selected item
173  m->CheckMenuItem(m_current_briefing, MF_BYPOSITION | MF_CHECKED );
174 
175  // Karajorma - it might be nice to autobalance the briefings and debriefings but I'm not doing anything till I
176  // understand how the how system works better. disabling the option for now.
177  m = pMenu->GetSubMenu(1);
178  m->EnableMenuItem(ID_AUTOBALANCE, MF_GRAYED);
179 
180  CDialog::OnInitMenu(pMenu);
181 }
182 
184 {
185  int i;
186  CComboBox *box;
187 
188  CDialog::Create(IDD);
190  box = (CComboBox *) GetDlgItem(IDC_ICON_IMAGE);
191  for (i=0; i<MIN_BRIEF_ICONS; i++)
192  box->AddString(Icon_names[i]);
193 
194  box = (CComboBox *) GetDlgItem(IDC_TEAM);
195  for (i=0; i<Num_iffs; i++)
196  box->AddString(Iff_info[i].iff_name);
197 
198  box = (CComboBox *) GetDlgItem(IDC_SHIP_TYPE);
199  for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
200  box->AddString(it->name);
201 
202  box = (CComboBox *) GetDlgItem(IDC_BRIEFING_MUSIC);
203  box->AddString("None");
204  for (i=0; i<Num_music_files; i++)
205  box->AddString(Spooled_music[i].name);
206 
207  box = (CComboBox *) GetDlgItem(IDC_SUBSTITUTE_BRIEFING_MUSIC);
208  box->AddString("None");
209  for (i=0; i<Num_music_files; i++)
210  box->AddString(Spooled_music[i].name);
211 
212  m_play_bm.LoadBitmap(IDB_PLAY);
213  ((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
214 
215  m_current_briefing = 0;
219 
220  UpdateData(FALSE);
221  update_data();
222  OnGotoView();
224 }
225 
226 void briefing_editor_dlg::focus_sexp(int select_sexp_node)
227 {
228  int i, n;
229 
230  n = m_tree.select_sexp_node = select_sexp_node;
231  if (n != -1) {
232  for (i=0; i<Briefing->num_stages; i++)
234  break;
235 
236  if (i < Briefing->num_stages) {
237  m_cur_stage = i;
238  update_data();
239  GetDlgItem(IDC_TREE) -> SetFocus();
241  }
242  }
243 }
244 
246 {
247 }
248 
250 {
251  OnClose();
252 }
253 
255 {
256  int bs, i, j, s, t, dup = 0;
257  briefing_editor_dlg *ptr;
258  brief_stage *sp;
259 
260  m_cur_stage = -1;
261  update_data(1);
262 
264 
265  for ( bs = 0; bs < Num_teams; bs++ ) {
266  for (s=0; s<Briefing[bs].num_stages; s++) {
267  sp = &Briefing[bs].stages[s];
268  t = sp->num_icons;
269  for (i=0; i<t-1; i++)
270  for (j=i+1; j<t; j++) {
271  if ((sp->icons[i].id >= 0) && (sp->icons[i].id == sp->icons[j].id))
272  dup = 1;
273  }
274  }
275  }
276 
277  if (dup)
278  MessageBox("You have duplicate icons names. You should resolve these.", "Warning");
279 
281  ptr = Briefing_dialog;
282  Briefing_dialog = NULL;
283  delete ptr;
284 }
285 
287 {
289  m_voice_id = -1;
290 
291  m_cur_stage = -1;
292  update_data(0);
293 }
294 
295 // some kind of hackish code to get around the problem if saving (which implicitly loads,
296 // which implicitly clears all mission info) not affecting the editor's state at save.
298 {
301 }
302 
304 {
307 }
308 
310 {
311  char buf[MAX_LABEL_LEN], buf2[MAX_ICON_TEXT_LEN];
312  SCP_string buf3;
313  int i, j, l, lines, count, enable = TRUE, valid = 0, invalid = 0;
314  object *objp;
315  brief_stage *ptr = NULL;
316 
317  if (update)
318  UpdateData(TRUE);
319 
320  // save off current data before we update over it with new briefing stage/team stuff
322 
325  if (m_last_stage >= 0) {
326  ptr = &Briefing->stages[m_last_stage];
329  if (ptr->text != buf3)
330  set_modified();
331 
332  ptr->text = buf3;
333  MODIFY(ptr->camera_time, atoi(m_time));
335  i = ptr->flags;
336  if (m_cut_prev)
337  i |= BS_BACKWARD_CUT;
338  else
339  i &= ~BS_BACKWARD_CUT;
340 
341  if (m_cut_next)
342  i |= BS_FORWARD_CUT;
343  else
344  i &= ~BS_FORWARD_CUT;
345 
346  MODIFY(ptr->flags, i);
347  ptr->formula = m_tree.save_tree();
348  switch (m_lines.GetCheck()) {
349  case 1:
350  // add lines between every pair of 2 marked icons if there isn't one already.
351  for (i=0; i<ptr->num_icons - 1; i++)
352  for (j=i+1; j<ptr->num_icons; j++) {
353  if ( icon_marked[i] && icon_marked[j] ) {
354  for (l=0; l<ptr->num_lines; l++)
355  if ( ((ptr->lines[l].start_icon == i) && (ptr->lines[l].end_icon == j)) || ((ptr->lines[l].start_icon == j) && (ptr->lines[l].end_icon == i)) )
356  break;
357 
358  if ((l == ptr->num_lines) && (l < MAX_BRIEF_STAGE_LINES)) {
359  ptr->lines[l].start_icon = i;
360  ptr->lines[l].end_icon = j;
361  ptr->num_lines++;
362  }
363  }
364  }
365 
366  break;
367 
368  case 0:
369  // remove all existing lines between any 2 marked icons
370  i = ptr->num_lines;
371  while (i--)
372  if ( icon_marked[ptr->lines[i].start_icon] && icon_marked[ptr->lines[i].end_icon] ) {
373  ptr->num_lines--;
374  for (l=i; l<ptr->num_lines; l++)
375  ptr->lines[l] = ptr->lines[l + 1];
376  }
377 
378  break;
379  }
380 
381  //WMC - Safeguard against broken lines
382  i = ptr->num_lines;
383  while(i--)
384  {
385  if(ptr->lines[i].start_icon < 0 || ptr->lines[i].end_icon < 0 || ptr->lines[i].start_icon >= ptr->num_icons || ptr->lines[i].end_icon >= ptr->num_icons)
386  {
387  ptr->num_lines--;
388  for(l = i; l < ptr->num_lines; l++)
389  ptr->lines[l] = ptr->lines[l+1];
390  }
391  }
392 
393  if (m_last_icon >= 0) {
394  valid = (m_id != ptr->icons[m_last_icon].id);
395  if (m_id >= 0) {
396  if (valid && !m_change_local) {
397  for (i=m_last_stage+1; i<Briefing->num_stages; i++) {
398  if (find_icon(m_id, i) >= 0) {
399  char msg[1024];
400 
401  valid = 0;
402  sprintf(msg, "Icon ID #%d is already used in a later stage. You can only\n"
403  "change to that ID locally. Icon ID has been reset back to %d", m_id, ptr->icons[m_last_icon].id);
404 
405  m_id = ptr->icons[m_last_icon].id;
406  MessageBox(msg);
407  break;
408  }
409  }
410  }
411 
412  for (i=0; i<ptr->num_icons; i++)
413  if ((i != m_last_icon) && (ptr->icons[i].id == m_id)) {
414  char msg[1024];
415 
416  sprintf(msg, "Icon ID #%d is already used in this stage. Icon ID has been reset back to %d",
417  m_id, ptr->icons[m_last_icon].id);
418 
419  m_id = ptr->icons[m_last_icon].id;
420  MessageBox(msg);
421  break;
422  }
423 
424  if (valid && !m_change_local) {
425  set_modified();
427  while (get_next_icon(ptr->icons[m_last_icon].id))
428  iconp->id = m_id;
429  }
430  }
431 
432  ptr->icons[m_last_icon].id = m_id;
434  if (stricmp(ptr->icons[m_last_icon].label, buf) && !m_change_local) {
435  set_modified();
437  while (get_next_icon(m_id))
438  strcpy_s(iconp->label, buf);
439  }
440 
441  strcpy_s(ptr->icons[m_last_icon].label, buf);
442 
443  if ( m_hilight )
445  else
447 
448  if (m_flipicon)
450  else
452 
453  if (m_use_wing)
455  else
457 
458  if (m_use_cargo)
460  else
462 
463  if ((ptr->icons[m_last_icon].type != m_icon_image) && !m_change_local) {
464  set_modified();
466  while (get_next_icon(m_id))
468  }
470 
471  if ((ptr->icons[m_last_icon].team != m_icon_team) && !m_change_local) {
472  set_modified();
474  while (get_next_icon(m_id))
476  }
478 
480  set_modified();
482  while (get_next_icon(m_id))
484  }
486 
488 /*
489  if (stricmp(ptr->icons[m_last_icon].text, buf2) && !m_change_local) {
490  set_modified();
491  reset_icon_loop(m_last_stage);
492  while (get_next_icon(m_id))
493  strcpy_s(iconp->text, buf2);
494  }
495 
496  strcpy_s(ptr->icons[m_last_icon].text, buf2);
497 */
498  }
499  }
500 
501  if (!::IsWindow(m_hWnd))
502  return;
503 
504  // set briefing pointer to correct team
506 
507  if ((m_cur_stage >= 0) && (m_cur_stage < Briefing->num_stages)) {
508  ptr = &Briefing->stages[m_cur_stage];
509  m_stage_title.Format("Stage %d of %d", m_cur_stage + 1, Briefing->num_stages);
511  m_time.Format("%d", ptr->camera_time);
512  m_voice = ptr->voice;
513  m_cut_prev = (ptr->flags & BS_BACKWARD_CUT) ? 1 : 0;
514  m_cut_next = (ptr->flags & BS_FORWARD_CUT) ? 1 : 0;
515  m_tree.load_tree(ptr->formula);
516 
517  } else {
518  m_stage_title = _T("No stages");
519  m_text = _T("");
520  m_time = _T("");
521  m_voice = _T("");
522  m_cut_prev = m_cut_next = 0;
523  m_tree.clear_tree();
524  enable = FALSE;
525  m_cur_stage = -1;
526  }
527 
528  if (m_cur_stage == Briefing->num_stages - 1)
529  GetDlgItem(IDC_NEXT) -> EnableWindow(FALSE);
530  else
531  GetDlgItem(IDC_NEXT) -> EnableWindow(enable);
532 
533  if (m_cur_stage)
534  GetDlgItem(IDC_PREV) -> EnableWindow(enable);
535  else
536  GetDlgItem(IDC_PREV) -> EnableWindow(FALSE);
537 
539  GetDlgItem(IDC_ADD_STAGE) -> EnableWindow(FALSE);
540  else
541  GetDlgItem(IDC_ADD_STAGE) -> EnableWindow(TRUE);
542 
543  if (Briefing->num_stages) {
544  GetDlgItem(IDC_DELETE_STAGE) -> EnableWindow(enable);
545  GetDlgItem(IDC_INSERT_STAGE) -> EnableWindow(enable);
546  } else {
547  GetDlgItem(IDC_DELETE_STAGE) -> EnableWindow(FALSE);
548  GetDlgItem(IDC_INSERT_STAGE) -> EnableWindow(FALSE);
549  }
550 
551  GetDlgItem(IDC_TIME) -> EnableWindow(enable);
552  GetDlgItem(IDC_VOICE) -> EnableWindow(enable);
553  GetDlgItem(IDC_BROWSE) -> EnableWindow(enable);
554  GetDlgItem(IDC_TEXT) -> EnableWindow(enable);
555  GetDlgItem(IDC_SAVE_VIEW) -> EnableWindow(enable);
556  GetDlgItem(IDC_GOTO_VIEW) -> EnableWindow(enable);
557  GetDlgItem(IDC_CUT_PREV) -> EnableWindow(enable);
558  GetDlgItem(IDC_CUT_NEXT) -> EnableWindow(enable);
559  GetDlgItem(IDC_TREE) -> EnableWindow(enable);
560  GetDlgItem(IDC_PLAY) -> EnableWindow(enable);
561 
562  if ((m_cur_stage >= 0) && (m_cur_icon >= 0) && (m_cur_icon < ptr->num_icons)) {
563  m_hilight = (ptr->icons[m_cur_icon].flags & BI_HIGHLIGHT)?1:0;
571 // m_icon_text = convert_multiline_string(ptr->icons[m_cur_icon].text);
572  m_id = ptr->icons[m_cur_icon].id;
573  enable = TRUE;
574 
575  } else {
576  m_flipicon = FALSE;
577  m_hilight = FALSE;
578  m_use_wing = FALSE;
579  m_use_cargo = FALSE;
580  m_icon_image = -1;
581  m_icon_team = -1;
582  m_ship_type = -1;
583  m_icon_label = _T("");
584  m_cur_icon = -1;
585  m_id = 0;
586  enable = FALSE;
587  }
588 
589  // see if icon is overridden by ships.tbl
590  // if so, disable the icon type box
591  int sip_bii_ship = (m_ship_type >= 0) ? Ship_info[m_ship_type].bii_index_ship : -1;
592  int sip_bii_wing = (sip_bii_ship >= 0) ? Ship_info[m_ship_type].bii_index_wing : -1;
593  int sip_bii_cargo = (sip_bii_ship >= 0) ? Ship_info[m_ship_type].bii_index_ship_with_cargo : -1;
594 
595  GetDlgItem(IDC_USE_WING_ICON) -> ShowWindow(sip_bii_wing >= 0);
596  GetDlgItem(IDC_USE_CARGO_ICON) -> ShowWindow(sip_bii_cargo >= 0);
597 
598  GetDlgItem(IDC_ICON_TEXT) -> EnableWindow(enable);
599  GetDlgItem(IDC_ICON_LABEL) -> EnableWindow(enable);
600  GetDlgItem(IDC_ICON_IMAGE) -> EnableWindow(enable && (sip_bii_ship < 0));
601  GetDlgItem(IDC_SHIP_TYPE) -> EnableWindow(enable);
602  GetDlgItem(IDC_HILIGHT) -> EnableWindow(enable);
603  GetDlgItem(IDC_FLIP_ICON) -> EnableWindow(enable);
604  GetDlgItem(IDC_USE_WING_ICON) -> EnableWindow(enable);
605  GetDlgItem(IDC_USE_CARGO_ICON) -> EnableWindow(enable);
606  GetDlgItem(IDC_LOCAL) -> EnableWindow(enable);
607  GetDlgItem(IDC_TEAM) -> EnableWindow(enable);
608  GetDlgItem(IDC_ID) -> EnableWindow(enable);
609  GetDlgItem(IDC_DELETE_ICON) -> EnableWindow(enable);
610 
611  valid = invalid = 0;
612  objp = GET_FIRST(&obj_used_list);
613  while (objp != END_OF_LIST(&obj_used_list)) {
614  if (objp->flags & OF_MARKED) {
615  if ((objp->type == OBJ_SHIP) || (objp->type == OBJ_START) || (objp->type == OBJ_WAYPOINT) || (objp->type == OBJ_JUMP_NODE))
616  valid = 1;
617  else
618  invalid = 1;
619  }
620 
621  objp = GET_NEXT(objp);
622  }
623 
624  if (m_cur_stage >= 0)
625  ptr = &Briefing->stages[m_cur_stage];
626 
627  if (valid && !invalid && (m_cur_stage >= 0) && (ptr->num_icons < MAX_STAGE_ICONS))
628  GetDlgItem(IDC_MAKE_ICON) -> EnableWindow(TRUE);
629  else
630  GetDlgItem(IDC_MAKE_ICON) -> EnableWindow(FALSE);
631 
632  if (m_cur_stage >= 0)
633  for (i=0; i<ptr->num_icons; i++)
634  icon_marked[i] = 0;
635 
636  valid = invalid = 0;
637  objp = GET_FIRST(&obj_used_list);
638  while (objp != END_OF_LIST(&obj_used_list)) {
639  if (objp->flags & OF_MARKED) {
640  if (objp->type == OBJ_POINT) {
641  valid++;
642  icon_marked[objp->instance] = 1;
643 
644  } else
645  invalid++;
646  }
647 
648  objp = GET_NEXT(objp);
649  }
650 
651  if (valid && !invalid && (m_cur_stage >= 0))
652  GetDlgItem(IDC_PROPAGATE_ICONS) -> EnableWindow(TRUE);
653  else
654  GetDlgItem(IDC_PROPAGATE_ICONS) -> EnableWindow(FALSE);
655 
656  count = 0;
657  lines = 1; // default lines checkbox to checked
658 
659  if (m_cur_stage >= 0) {
660  for (i=0; i<ptr->num_lines; i++)
661  line_marked[i] = 0;
662 
663  // go through and locate all lines between marked icons
664  for (i=0; i<ptr->num_icons - 1; i++)
665  for (j=i+1; j<ptr->num_icons; j++) {
666  if ( icon_marked[i] && icon_marked[j] ) {
667  for (l=0; l<ptr->num_lines; l++)
668  if ( ((ptr->lines[l].start_icon == i) && (ptr->lines[l].end_icon == j)) || ((ptr->lines[l].start_icon == j) && (ptr->lines[l].end_icon == i)) ) {
669  line_marked[l] = 1;
670  count++; // track number of marked lines (lines between 2 icons that are both marked)
671  break;
672  }
673 
674  // at least 1 line missing between 2 marked icons, so use mixed state
675  if (l == ptr->num_lines)
676  lines = 2;
677  }
678  }
679  }
680 
681  // not even 1 line between any 2 marked icons? Set checkbox to unchecked.
682  if (!count)
683  lines = 0;
684 
685  i = 0;
686  if (m_cur_stage >= 0){
687  i = calc_num_lines_for_icons(valid) + ptr->num_lines - count;
688  }
689 
690  if ((valid > 1) && !invalid && (m_cur_stage >= 0) && (i <= MAX_BRIEF_STAGE_LINES))
691  GetDlgItem(IDC_LINES) -> EnableWindow(TRUE);
692  else
693  GetDlgItem(IDC_LINES) -> EnableWindow(FALSE);
694 
695  m_lines.SetCheck(lines);
696 
697  UpdateData(FALSE);
698  if ((m_last_stage != m_cur_stage) || (Briefing != save_briefing)) {
699  if (m_last_stage >= 0) {
700  for (i=0; i<save_briefing->stages[m_last_stage].num_icons; i++) {
701  // save positions of all icons, in case they have moved
703  // release objects being used by last stage
704  obj_delete(icon_obj[i]);
705  }
706  }
707 
708  if (m_cur_stage >= 0) {
709  for (i=0; i<ptr->num_icons; i++) {
710  // create an object for each icon for display/manipulation purposes
711  icon_obj[i] = obj_create(OBJ_POINT, -1, i, NULL, &ptr->icons[i].pos, 0.0f, OF_RENDERS);
712  }
713 
715  }
716 
718  }
719 
721  Update_window = 1;
723 }
724 
725 // Given a number of icons, figure out how many lines would be required to connect each one
726 // with all of the others.
727 //
729 {
730  int lines = 0;
731 
732  if (num < 2)
733  return 0;
734 
735  // Basically, this is # lines = (# icons - 1) factorial
736  while (--num)
737  lines += num;
738 
739  return lines;
740 }
741 
743 {
744  m_cur_stage++;
745  m_cur_icon = -1;
747  m_voice_id = -1;
748  update_data();
749  OnGotoView();
750 }
751 
753 {
754  m_cur_stage--;
755  m_cur_icon = -1;
757  m_voice_id = -1;
758  update_data();
759  OnGotoView();
760 }
761 
763 {
764  int z;
765  CString name;
766 
767  UpdateData(TRUE);
768 
770  m_voice_id = -1;
771 
774  else
776 
777  CFileDialog dlg(TRUE, "wav", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
778  "Voice Files (*.ogg, *.wav)|*.ogg;*.wav|Ogg Vorbis Files (*.ogg)|*.ogg|Wave Files (*.wav)|*.wav||");
779 
780  if (dlg.DoModal() == IDOK) {
781  m_voice = dlg.GetFileName();
782  UpdateData(FALSE);
783  }
784 
785  if (!z)
786  cfile_pop_dir();
787 }
788 
790 {
791  int i;
792 
794  return;
795 
797  copy_stage(i - 1, i);
799  m_voice_id = -1;
800  update_data(1);
801 }
802 
804 {
805  int i, z;
806 
807  if (m_cur_stage < 0)
808  return;
809 
811  m_voice_id = -1;
812 
814  z = m_cur_stage;
815  m_cur_stage = -1;
816  update_data(1);
817  for (i=z+1; i<Briefing->num_stages; i++) {
818  copy_stage(i, i-1);
819  }
820 
821  Briefing->num_stages--;
822  m_cur_stage = z;
825 
826  update_data(0);
827 }
828 
830 {
831  if (m_cur_stage < 0)
832  return;
833 
834  brief_render_icon(m_cur_stage, objp->instance, 1.0f/30.0f, objp->flags & OF_MARKED,
835  (float) True_rw / BRIEF_GRID_W, (float) True_rh / BRIEF_GRID_H);
836 }
837 
839 {
840  int i, num_lines;
841 
842 
843  if (m_cur_stage < 0)
844  return;
845 
846  num_lines = Briefing->stages[m_cur_stage].num_lines;
847  for (i=0; i<num_lines; i++)
849 }
850 
852 {
853  m_cur_icon = num;
854  update_data(1);
855 }
856 
858 {
859  int i, z;
860 
862  return;
863 
864  if (!Briefing->num_stages) {
865  OnAddStage();
866  return;
867  }
868 
870  m_voice_id = -1;
871 
872  z = m_cur_stage;
873  m_cur_stage = -1;
874  update_data(1);
875  for (i=Briefing->num_stages; i>z; i--) {
876  copy_stage(i-1, i);
877  }
878 
879  Briefing->num_stages++;
880  copy_stage(z, z + 1);
881  m_cur_stage = z;
882  update_data(0);
883 }
884 
885 void briefing_editor_dlg::copy_stage(int from, int to)
886 {
887  if ((from < 0) || (from >= Briefing->num_stages)) {
888  Briefing->stages[to].text = "<Text here>";
889  strcpy_s(Briefing->stages[to].voice, "none.wav");
892  Briefing->stages[to].camera_time = 500;
893  Briefing->stages[to].num_icons = 0;
895  return;
896  }
897 
898  // Copy all the data in the stage structure.
899  Briefing->stages[to].text = Briefing->stages[from].text;
904  Briefing->stages[to].flags = Briefing->stages[from].flags;
908 
909  memmove( Briefing->stages[to].icons, Briefing->stages[from].icons, sizeof(brief_icon)*MAX_STAGE_ICONS );
910  memmove( Briefing->stages[to].lines, Briefing->stages[from].lines, sizeof(brief_line)*MAX_BRIEF_STAGE_LINES );
911 }
912 
914 {
915  int i, s, z;
916  vec3d v1, v2;
917 
918  if (m_cur_stage < 0)
919  return;
920 
921  for (i=0; i<Briefing->stages[m_cur_stage].num_icons; i++) {
923  v2 = Objects[icon_obj[i]].pos;
924  if ((v1.xyz.x != v2.xyz.x) || (v1.xyz.y != v2.xyz.y) || (v1.xyz.z != v2.xyz.z)) {
926  if (!m_change_local) // propagate changes through rest of stages..
927  for (s=m_cur_stage+1; s<Briefing->num_stages; s++) {
929  if (z >= 0)
931  }
932  }
933  }
934 }
935 
937 {
938  char *name;
939  int z, len, team, ship, waypoint, count = -1;
940  int cargo = 0, cargo_count = 0, freighter_count = 0;
941  object *ptr;
942  vec3d min, max, pos;
943  brief_icon *iconp;
944 
946  return;
947 
950  ship = waypoint = -1;
951  team = 0;
953 
954  vm_vec_make(&min, 9e19f, 9e19f, 9e19f);
955  vm_vec_make(&max, -9e19f, -9e19f, -9e19f);
956  ptr = GET_FIRST(&obj_used_list);
957  while (ptr != END_OF_LIST(&obj_used_list)) {
958  if (ptr->flags & OF_MARKED) {
959  if (ptr->pos.xyz.x < min.xyz.x)
960  min.xyz.x = ptr->pos.xyz.x;
961  if (ptr->pos.xyz.x > max.xyz.x)
962  max.xyz.x = ptr->pos.xyz.x;
963  if (ptr->pos.xyz.y < min.xyz.y)
964  min.xyz.y = ptr->pos.xyz.y;
965  if (ptr->pos.xyz.y > max.xyz.y)
966  max.xyz.y = ptr->pos.xyz.y;
967  if (ptr->pos.xyz.z < min.xyz.z)
968  min.xyz.z = ptr->pos.xyz.z;
969  if (ptr->pos.xyz.z > max.xyz.z)
970  max.xyz.z = ptr->pos.xyz.z;
971 
972  switch (ptr->type) {
973  case OBJ_SHIP:
974  case OBJ_START:
975  ship = ptr->instance;
976  break;
977 
978  case OBJ_WAYPOINT:
979  waypoint = ptr->instance;
980  break;
981 
982  case OBJ_JUMP_NODE:
983  for (jnp = Jump_nodes.begin(); jnp != Jump_nodes.end(); ++jnp) {
984  if(jnp->GetSCPObject() == ptr)
985  break;
986  }
987  break;
988 
989  default:
990  Int3();
991  }
992 
993  if (ship >= 0) {
994  team = Ships[ship].team;
995 
996  z = ship_query_general_type(ship);
997  if (Ship_info[Ships[ship].ship_info_index].flags & SIF_CARGO)
998  cargo_count++;
999 
1000  if (Ship_info[Ships[ship].ship_info_index].flags & SIF_FREIGHTER)
1001  {
1002  // direct docked with any marked cargo?
1003  for (dock_instance *dock_ptr = ptr->dock_list; dock_ptr != NULL; dock_ptr = dock_ptr->next)
1004  {
1005  if (dock_ptr->docked_objp->flags & OF_MARKED)
1006  {
1007  if (Ship_info[Ships[dock_ptr->docked_objp->instance].ship_info_index].flags & SIF_CARGO)
1008  freighter_count++;
1009  }
1010  }
1011  }
1012  }
1013 
1014  count++;
1015  }
1016 
1017  ptr = GET_NEXT(ptr);
1018  }
1019 
1020  if (cargo_count && cargo_count == freighter_count)
1021  cargo = 1;
1022 
1023  vm_vec_avg(&pos, &min, &max);
1024  if (ship >= 0)
1025  name = Ships[ship].ship_name;
1026  else if (waypoint >= 0)
1027  {
1028  waypoint_list *wp_list = find_waypoint_list_with_instance(waypoint);
1029  Assert(wp_list != NULL);
1030  name = wp_list->get_name();
1031  }
1032  else if (jnp != Jump_nodes.end())
1033  name = jnp->GetName();
1034  else
1035  return;
1036 
1037  len = strlen(name);
1038  if (len >= MAX_LABEL_LEN - 1)
1039  len = MAX_LABEL_LEN - 1;
1040 
1041  strncpy(iconp->label, name, len);
1042  iconp->label[len] = 0;
1043 // iconp->text[0] = 0;
1044  iconp->type = 0;
1045  iconp->team = team;
1046  iconp->pos = pos;
1047  iconp->flags = 0;
1048  iconp->id = Cur_brief_id++;
1049  if (ship >= 0) {
1050  iconp->ship_class = Ships[ship].ship_info_index;
1051  switch (Ship_info[Ships[ship].ship_info_index].flags & SIF_ALL_SHIP_TYPES) {
1052  case SIF_KNOSSOS_DEVICE:
1053  iconp->type = ICON_KNOSSOS_DEVICE;
1054  break;
1055 
1056  case SIF_CORVETTE:
1057  iconp->type = ICON_CORVETTE;
1058  break;
1059 
1060  case SIF_GAS_MINER:
1061  iconp->type = ICON_GAS_MINER;
1062  break;
1063 
1064  case SIF_SUPERCAP:
1065  iconp->type = ICON_SUPERCAP;
1066  break;
1067 
1068  case SIF_SENTRYGUN:
1069  iconp->type = ICON_SENTRYGUN;
1070  break;
1071 
1072  case SIF_AWACS:
1073  iconp->type = ICON_AWACS;
1074  break;
1075 
1076  case SIF_CARGO:
1077  if (cargo)
1079  else
1080  iconp->type = count ? ICON_CARGO_WING : ICON_CARGO;
1081 
1082  break;
1083 
1084  case SIF_SUPPORT:
1085  iconp->type = ICON_SUPPORT_SHIP;
1086  break;
1087 
1088  case SIF_FIGHTER:
1089  iconp->type = count ? ICON_FIGHTER_WING : ICON_FIGHTER;
1090  break;
1091 
1092  case SIF_BOMBER:
1093  iconp->type = count ? ICON_BOMBER_WING : ICON_BOMBER;
1094  break;
1095 
1096  case SIF_FREIGHTER:
1097  if (cargo)
1099  else
1101 
1102  break;
1103 
1104  case SIF_CRUISER:
1105  iconp->type = count ? ICON_CRUISER_WING : ICON_CRUISER;
1106  break;
1107 
1108  case SIF_TRANSPORT:
1109  iconp->type = count ? ICON_TRANSPORT_WING : ICON_TRANSPORT;
1110  break;
1111 
1112  case SIF_CAPITAL:
1113  case SIF_DRYDOCK:
1114  iconp->type = ICON_CAPITAL;
1115  break;
1116 
1117  case SIF_NAVBUOY:
1118  iconp->type = ICON_WAYPOINT;
1119  break;
1120 
1121  default:
1122  iconp->type = ICON_ASTEROID_FIELD;
1123  break;
1124  }
1125  }
1126  // jumpnodes
1127  else if(jnp != Jump_nodes.end()){
1128  // find the first navbuoy
1129  iconp->ship_class = -1;
1130  for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
1131  {
1132  if (it->flags & SIF_NAVBUOY)
1133  {
1134  iconp->ship_class = std::distance(Ship_info.cbegin(), it);
1135  break;
1136  }
1137  }
1138  iconp->type = ICON_JUMP_NODE;
1139  }
1140  // everything else
1141  else {
1142  // find the first navbuoy
1143  iconp->ship_class = -1;
1144  for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
1145  {
1146  if (it->flags & SIF_NAVBUOY)
1147  {
1148  iconp->ship_class = std::distance(Ship_info.cbegin(), it);
1149  break;
1150  }
1151  }
1152  iconp->type = ICON_WAYPOINT;
1153  }
1154 
1155  if (!m_change_local){
1157  }
1158 
1159  icon_obj[m_cur_icon] = obj_create(OBJ_POINT, -1, m_cur_icon, NULL, &pos, 0.0f, OF_RENDERS);
1160  Assert(icon_obj[m_cur_icon] >= 0);
1162  unmark_all();
1164  GetDlgItem(IDC_MAKE_ICON) -> EnableWindow(FALSE);
1165  GetDlgItem(IDC_PROPAGATE_ICONS) -> EnableWindow(TRUE);
1166  update_data(1);
1167 }
1168 
1170 {
1172 }
1173 
1175 {
1176  int i, z;
1177 
1178  if (num < 0)
1179  num = m_cur_icon;
1180 
1181  if (num < 0)
1182  return;
1183 
1184  Assert(m_cur_stage >= 0);
1186  z = m_cur_icon;
1187  if (z == num)
1188  z = -1;
1189  if (z > num)
1190  z--;
1191 
1192  m_cur_icon = -1;
1193  update_data(1);
1194  obj_delete(icon_obj[num]);
1195  for (i=num+1; i<Briefing->stages[m_cur_stage].num_icons; i++) {
1197  icon_obj[i-1] = icon_obj[i];
1198  Objects[icon_obj[i-1]].instance = i - 1;
1199  }
1200 
1202  if (z >= 0) {
1203  m_cur_icon = z;
1204  update_data(0);
1205  }
1206 }
1207 
1209 {
1210  if (m_cur_stage < 0)
1211  return;
1212 
1215  Update_window = 1;
1216 }
1217 
1219 {
1220  if (m_cur_stage < 0)
1221  return;
1222 
1225 }
1226 
1228 {
1229  update_data(1);
1230 }
1231 
1233 {
1234  update_data(1);
1235 }
1236 
1238 {
1239  update_data(1);
1240 }
1241 
1243 {
1244  int i;
1245  brief_icon *ptr;
1246 
1247  if (m_cur_stage < 0)
1248  return -1;
1249 
1250  for (i=0; i<Briefing->stages[m_cur_stage].num_icons; i++) {
1251  ptr = &Briefing->stages[m_cur_stage].icons[i];
1252  if ((x > ptr->x) && (x < ptr->x + ptr->w) && (y > ptr->y) && (y < ptr->y + ptr->h)) {
1253  return icon_obj[i];
1254  }
1255  }
1256 
1257  return -1;
1258 }
1259 
1261 {
1262  object *ptr;
1263 
1264  ptr = GET_FIRST(&obj_used_list);
1265  while (ptr != END_OF_LIST(&obj_used_list)) {
1266  if ((ptr->type == OBJ_POINT) && (ptr->flags & OF_MARKED)) {
1267  propagate_icon(ptr->instance);
1268  }
1269 
1270  ptr = GET_NEXT(ptr);
1271  }
1272 }
1273 
1275 {
1276  int i, s;
1277 
1278  for (s=m_cur_stage+1; s<Briefing->num_stages; s++) {
1279  i = Briefing->stages[s].num_icons;
1280  if (i >= MAX_STAGE_ICONS)
1281  continue;
1282 
1283  if (find_icon(Briefing->stages[m_cur_stage].icons[num].id, s) >= 0)
1284  continue; // don't change if icon exists here already.
1285 
1287  Briefing->stages[s].num_icons++;
1288  }
1289 }
1290 
1291 int briefing_editor_dlg::find_icon(int id, int stage)
1292 {
1293  int i;
1294 
1295  if (id >= 0)
1296  for (i=0; i<Briefing->stages[stage].num_icons; i++)
1297  if (Briefing->stages[stage].icons[i].id == id)
1298  return i;
1299 
1300  return -1;
1301 }
1302 
1304 {
1305  stage_loop = stage + 1;
1306  icon_loop = -1;
1307 }
1308 
1310 {
1311  while (1) {
1312  icon_loop++;
1314  stage_loop++;
1316  return 0;
1317 
1318  icon_loop = -1;
1319  continue;
1320  }
1321 
1323  if ((id >= 0) && (iconp->id == id))
1324  return 1;
1325  }
1326 }
1327 
1329 {
1330  int id;
1331 
1332  // deal with figuring out menu stuff
1333  id = LOWORD(wParam);
1334  if ( (id >= ID_TEAM_1) && (id < ID_TEAM_3) ) {
1336 
1337  // put user back at first stage for this team (or no current stage is there are none).
1339  if ( Briefing->num_stages > 0 )
1340  m_cur_stage = 0;
1341  else
1342  m_cur_stage = -1;
1343 
1344  update_data(1);
1345  OnGotoView();
1346  return 1;
1347  }
1348 
1349  return CDialog::OnCommand(wParam, lParam);
1350 }
1351 
1353 {
1354  if (m_lines.GetCheck() == 1)
1355  m_lines.SetCheck(0);
1356  else
1357  m_lines.SetCheck(1);
1358 
1359  update_data(1);
1360 }
1361 
1362 void briefing_editor_dlg::OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult)
1363 {
1364  m_tree.right_clicked();
1365  *pResult = 0;
1366 }
1367 
1369 {
1370  TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
1371 
1372  if (m_tree.edit_label(pTVDispInfo->item.hItem) == 1) {
1373  *pResult = 0;
1374  modified = 1;
1375 
1376  } else
1377  *pResult = 1;
1378 }
1379 
1380 void briefing_editor_dlg::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult)
1381 {
1382  TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
1383 
1384  *pResult = m_tree.end_label_edit(pTVDispInfo->item);
1385 }
1386 
1388 {
1389  m_play_bm.DeleteObject();
1391  return CDialog::DestroyWindow();
1392 }
1393 
1395 {
1396  GetDlgItem(IDC_VOICE)->GetWindowText(m_voice);
1397 
1398  if (m_voice_id >= 0) {
1400  m_voice_id = -1;
1401  return;
1402  }
1403 
1404  // we use ASF_EVENTMUSIC here so that it will keep the extension in place
1405  m_voice_id = audiostream_open((char *)(LPCSTR) m_voice, ASF_EVENTMUSIC);
1406 
1407  if (m_voice_id >= 0) {
1408  audiostream_play(m_voice_id, 1.0f, 0);
1409  }
1410 }
1411 
1413 {
1414  // TODO: Add your control notification handler code here
1415 
1416  m_copy_view_set = 1;
1419 }
1420 
1422 {
1423  // TODO: Add your control notification handler code here
1424  if (m_cur_stage < 0)
1425  return;
1426 
1427  if (m_copy_view_set == 0) {
1428  MessageBox("No view set", "Unable to copy view");
1429  } else {
1432 
1433  update_data(1);
1434  OnGotoView();
1435  }
1436 }
1437 
1439 {
1440  update_data(1);
1441 }
1442 
1444 {
1445  update_data(1);
1446 }
1447 
1449 {
1450  update_data(1);
1451 }
void brief_render_icon_line(int stage_num, int line_num)
void record_window_data(window_data *wndd, CWnd *wnd)
Definition: fred.cpp:670
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
#define ICON_CRUISER
virtual BOOL DestroyWindow()
int i
Definition: multi_pxo.cpp:466
CFREDApp theApp
Definition: fred.cpp:115
#define BI_HIGHLIGHT
#define IDC_MAKE_ICON
Definition: resource.h:847
int team
Definition: ship.h:606
char * get_name()
Definition: waypoint.cpp:84
#define ID_AUTOBALANCE
Definition: resource.h:1462
#define ICON_SUPERCAP
int game_type
Definition: missionparse.h:138
int Mission_music[NUM_SCORES]
Definition: eventmusic.cpp:253
afx_msg void OnEndlabeleditTree(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_ICON_LABEL
Definition: resource.h:850
#define SIF_SUPERCAP
Definition: ship.h:901
#define ASF_EVENTMUSIC
Definition: audiostr.h:19
#define IDC_DELETE_STAGE
Definition: resource.h:568
void unmark_all()
void reset_icon_loop(int stage)
brief_stage stages[MAX_BRIEF_STAGES]
waypoint_list * find_waypoint_list_with_instance(int waypoint_instance, int *waypoint_index)
Definition: waypoint.cpp:254
#define SIF_CRUISER
Definition: ship.h:887
#define ICON_SUPPORT_SHIP
Assert(pm!=NULL)
Definition: pstypes.h:88
int init_window(window_data *wndd, CWnd *wnd, int adjust=0, int pre=0)
Definition: fred.cpp:639
#define ICON_CARGO_WING
#define OF_RENDERS
Definition: object.h:103
#define SIF_CARGO
Definition: ship.h:884
struct vec3d::@225::@227 xyz
CButton * team
int cfile_pop_dir()
Definition: cfile.cpp:381
#define IDC_ID
Definition: resource.h:887
GLclampf f
Definition: Glext.h:7097
void link_modified(int *ptr)
Definition: sexp_tree.cpp:3156
#define ICON_TRANSPORT
dock_instance * next
Definition: objectdock.h:19
#define TRUE
Definition: pstypes.h:399
afx_msg void OnBeginlabeleditTree(NMHDR *pNMHDR, LRESULT *pResult)
#define ICON_WAYPOINT
UINT WPARAM wParam
Definition: msacm.h:1064
#define ID_TEAM_1
Definition: resource.h:1428
object obj_used_list
Definition: object.cpp:53
#define IDC_TEAM
Definition: resource.h:588
#define IDC_TEXT
Definition: resource.h:771
#define ICON_FIGHTER_WING
#define IDC_BROWSE
Definition: resource.h:729
int edit_label(HTREEITEM h)
Definition: sexp_tree.cpp:1349
#define ICON_SENTRYGUN
UINT WPARAM LPARAM lParam
Definition: msacm.h:1064
#define MAX_STAGE_ICONS
#define SCORE_BRIEFING
Definition: eventmusic.h:51
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
void obj_merge_created_list(void)
Definition: object.cpp:651
object * objp
Definition: lua.cpp:3105
#define IDC_BRIEFING_MUSIC
Definition: resource.h:650
#define IDC_CUT_PREV
Definition: resource.h:911
GLfloat GLfloat GLfloat v2
Definition: Glext.h:5640
void deconvert_multiline_string(char *dest, const CString &str, int max_len)
Definition: management.cpp:184
#define Int3()
Definition: pstypes.h:292
briefing Briefings[MAX_TVT_TEAMS]
vec3d pos
Definition: object.h:152
#define MODIFY(a, b)
Definition: fred.h:26
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: Glext.h:7308
vec3d view_pos
Definition: fredrender.cpp:103
#define SIF_GAS_MINER
Definition: ship.h:909
#define IDC_ICON_TEXT
Definition: resource.h:854
#define IDC_PROPAGATE_ICONS
Definition: resource.h:882
void right_clicked(int mode=0)
Definition: sexp_tree.cpp:570
#define ICON_JUMP_NODE
long LPARAM
Definition: config.h:101
SCP_list< CJumpNode > Jump_nodes
Definition: jumpnode.cpp:16
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam)
#define BI_USE_WING_ICON
#define IDC_USE_CARGO_ICON
Definition: resource.h:1120
#define BI_MIRROR_ICON
iff_info Iff_info[MAX_IFFS]
Definition: iff_defs.cpp:20
#define ICON_FREIGHTER_WITH_CARGO
afx_msg void OnSelchangeIconImage()
#define IDC_DELETE_ICON
Definition: resource.h:848
#define IDC_HILIGHT
Definition: resource.h:185
#define IDC_USE_WING_ICON
Definition: resource.h:1117
#define SIF_CAPITAL
Definition: ship.h:889
int cfile_push_chdir(int type)
Push current directory onto a 'stack' and change to a new directory.
Definition: cfile.cpp:342
#define SIF_BOMBER
Definition: ship.h:886
brief_icon * icons
int Num_music_files
Definition: eventmusic.cpp:250
int Locked_sexp_true
Definition: sexp.cpp:828
void convert_multiline_string(CString &dest, const SCP_string &src)
Definition: management.cpp:169
#define OBJ_WAYPOINT
Definition: object.h:36
int instance
Definition: object.h:150
#define IDC_TREE
Definition: resource.h:704
#define IDC_FLIP_ICON
Definition: resource.h:1114
void brief_render_icon(int stage_num, int icon_num, float frametime, int selected, float w_scale_factor, float h_scale_factor)
#define OBJ_START
Definition: object.h:35
char voice[MAX_FILENAME_LEN]
dock_instance * dock_list
Definition: object.h:166
int True_rw
Definition: fredrender.cpp:98
#define SIF_NAVBUOY
Definition: ship.h:891
matrix view_orient
Definition: fredrender.cpp:112
int check_mouse_hit(int x, int y)
#define ICON_CAPITAL
void set_cur_object_index(int obj)
afx_msg void OnPropagateIcons()
int obj_create(ubyte type, int parent_obj, int instance, matrix *orient, vec3d *pos, float radius, uint flags)
Definition: object.cpp:467
afx_msg void OnInsertStage()
#define ICON_BOMBER_WING
#define IDC_LOCAL
Definition: resource.h:883
int end_label_edit(TVITEMA &item)
Definition: sexp_tree.cpp:1412
#define BS_BACKWARD_CUT
int icon_marked[MAX_STAGE_ICONS]
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
GLdouble GLdouble z
Definition: Glext.h:5451
#define SIF_SENTRYGUN
Definition: ship.h:892
#define CF_TYPE_VOICE_BRIEFINGS
Definition: cfile.h:55
#define ICON_AWACS
#define ICON_FREIGHTER_WING_NO_CARGO
#define IDC_SAVE_VIEW
Definition: resource.h:857
#define ICON_CRUISER_WING
int Num_teams
GLdouble s
Definition: Glext.h:5321
#define IDC_VOICE
Definition: resource.h:800
briefing_editor_dlg(CWnd *pParent=NULL)
int icon_obj[MAX_STAGE_ICONS]
#define ICON_KNOSSOS_DEVICE
Definition: ship.h:534
GLenum GLuint id
Definition: Glext.h:5156
GLdouble GLdouble t
Definition: Glext.h:5329
afx_msg void OnRclickTree(NMHDR *pNMHDR, LRESULT *pResult)
char name[NAME_LENGTH]
Definition: eventmusic.h:65
#define BRIEF_GRID_W
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
object Objects[MAX_OBJECTS]
Definition: object.cpp:62
int find_icon(int id, int stage)
GLclampd n
Definition: Glext.h:7286
#define IDC_COPY_VIEW
Definition: resource.h:564
void string_copy(char *dest, const CString &src, int max_len, int modify)
Definition: management.cpp:142
#define ICON_FIGHTER
#define SIF_DRYDOCK
Definition: ship.h:902
#define IDC_STAGE_TITLE
Definition: resource.h:849
#define OF_MARKED
Definition: object.h:125
int query_node_in_sexp(int node, int sexp)
Definition: sexp.cpp:1437
#define vm_vec_make(v, _x, _y, _z)
Definition: vecmat.h:48
int ship_query_general_type(int ship)
Definition: ship.cpp:14475
#define ICON_CARGO
window_data Briefing_wnd_data
Definition: fred.cpp:70
#define OBJ_SHIP
Definition: object.h:32
GLfloat GLfloat v1
Definition: Glext.h:5639
#define IDC_PREV
Definition: resource.h:851
GLbitfield flags
Definition: Glext.h:6722
menu_music Spooled_music[MAX_SPOOLED_MUSIC]
Definition: eventmusic.cpp:249
void set_modified(BOOL arg)
Definition: freddoc.cpp:676
GLuint const GLchar * name
Definition: Glext.h:5608
#define MAX_LABEL_LEN
CString m_substitute_briefing_music
GLboolean enable
Definition: Glext.h:10591
char * Icon_names[MIN_BRIEF_ICONS]
int BOOL
Definition: config.h:80
#define MISSION_TYPE_TRAINING
Definition: missionparse.h:63
#define SIF_SUPPORT
Definition: ship.h:878
#define SIF_ALL_SHIP_TYPES
Definition: ship.h:942
#define SIF_FREIGHTER
Definition: ship.h:888
ship Ships[MAX_SHIPS]
Definition: ship.cpp:122
#define ICON_FREIGHTER_WING_WITH_CARGO
void audiostream_close_file(int i, int fade)
Definition: audiostr.cpp:1772
#define ID_TEAM_3
Definition: resource.h:1430
briefing * Briefing
GLuint GLuint num
Definition: Glext.h:9089
#define ICON_ASTEROID_FIELD
#define IDC_PLAY
Definition: resource.h:333
#define MAX_BRIEF_STAGE_LINES
void obj_delete(int objnum)
Definition: object.cpp:522
afx_msg void OnSelchangeShipType()
#define IDC_CUT_NEXT
Definition: resource.h:910
#define IDC_TIME
Definition: resource.h:786
#define BRIEF_GRID_H
int save_tree(int node=-1)
Definition: sexp_tree.cpp:237
long LRESULT
Definition: config.h:100
#define BI_USE_CARGO_ICON
afx_msg void OnSelchangeTeam()
#define MAX_BRIEF_STAGES
int ship_info_index
Definition: ship.h:539
char substitute_briefing_music_name[NAME_LENGTH]
Definition: missionparse.h:165
virtual void DoDataExchange(CDataExchange *pDX)
int True_rh
Definition: fredrender.cpp:98
#define IDC_LINES
Definition: resource.h:935
#define ICON_CORVETTE
SCP_vector< ship_info > Ship_info
Definition: ship.cpp:164
#define SIF_KNOSSOS_DEVICE
Definition: ship.h:912
#define SIF_TRANSPORT
Definition: ship.h:890
void update_data(int update=1)
vec3d * vm_vec_avg(vec3d *dest, const vec3d *src0, const vec3d *src1)
Definition: vecmat.cpp:217
#define SIF_AWACS
Definition: ship.h:910
int MessageBox(HWND h, const char *s1, const char *s2, int i)
#define SIF_FIGHTER
Definition: ship.h:885
#define IDC_PASTE_VIEW
Definition: resource.h:977
#define ICON_TRANSPORT_WING
#define BS_FORWARD_CUT
#define ICON_FREIGHTER_NO_CARGO
hull_check pos
Definition: lua.cpp:5050
void audiostream_play(int i, float volume, int looping)
Definition: audiostr.cpp:1803
const GLfloat * m
Definition: Glext.h:10319
void load_tree(int index, const char *deflt="true")
Definition: sexp_tree.cpp:124
#define IDC_GOTO_VIEW
Definition: resource.h:856
#define MAX_TVT_TEAMS
Definition: globals.h:57
GLint GLsizei count
Definition: Gl.h:1491
GLenum GLsizei len
Definition: Glext.h:6283
void hilite_item(int node)
Definition: sexp_tree.cpp:3139
#define IDB_PLAY
Definition: resource.h:87
#define ICON_GAS_MINER
int audiostream_open(const char *filename, int type)
Definition: audiostr.cpp:1713
#define IDC_INSERT_STAGE
Definition: resource.h:853
#define IDC_ICON_IMAGE
Definition: resource.h:524
int Num_iffs
Definition: iff_defs.cpp:19
void copy_stage(int from, int to)
briefing_editor_dlg * Briefing_dialog
Definition: fred.cpp:59
#define MAX_ICON_TEXT_LEN
int select_sexp_node
Definition: sexp_tree.h:283
uint flags
Definition: object.h:151
#define IDC_SHIP_TYPE
Definition: resource.h:642
mission The_mission
#define IDC_ADD_STAGE
Definition: resource.h:845
afx_msg void OnDeleteStage()
void draw_icon(object *objp)
int line_marked[MAX_BRIEF_STAGE_LINES]
#define CF_TYPE_VOICE_TRAINING
Definition: cfile.h:60
char type
Definition: object.h:146
#define FALSE
Definition: pstypes.h:400
#define OBJ_POINT
Definition: object.h:40
char label[MAX_LABEL_LEN]
void lcl_fred_replace_stuff(char *text, size_t max_len)
Definition: localize.cpp:610
char iff_name[NAME_LENGTH]
Definition: iff_defs.h:36
int calc_num_lines_for_icons(int num)
#define stricmp(s1, s2)
Definition: config.h:271
#define OBJ_JUMP_NODE
Definition: object.h:45
#define IDC_SUBSTITUTE_BRIEFING_MUSIC
Definition: resource.h:1124
char ship_name[NAME_LENGTH]
Definition: ship.h:604
void focus_sexp(int select_sexp_node)
void clear_tree(const char *op=NULL)
Definition: sexp_tree.cpp:99
#define MIN_BRIEF_ICONS
#define SIF_CORVETTE
Definition: ship.h:908
GLint y
Definition: Gl.h:1505
int Update_window
Definition: fred.cpp:48
#define ICON_BOMBER
brief_line * lines
#define strcpy_s(...)
Definition: safe_strings.h:67
void update_map_window()
Definition: fred.cpp:532
int Cur_brief_id
#define IDC_NEXT
Definition: resource.h:844