Open source remastering of the Freespace 2 engine
management.cpp File Reference
#include "stdafx.h"
#include "FRED.h"
#include "MainFrm.h"
#include "FREDDoc.h"
#include "FREDView.h"
#include "FredRender.h"
#include "ai/aigoals.h"
#include "ship/ship.h"
#include "globalincs/linklist.h"
#include "globalincs/version.h"
#include "globalincs/alphacolors.h"
#include "mission/missionparse.h"
#include "mission/missionmessage.h"
#include "mission/missiongoals.h"
#include "mission/missionbriefcommon.h"
#include "Management.h"
#include "cfile/cfile.h"
#include "palman/palman.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "weapon/weapon.h"
#include "io/key.h"
#include "parse/parselo.h"
#include "math/fvi.h"
#include "starfield/starfield.h"
#include "parse/sexp.h"
#include "io/mouse.h"
#include "mission/missioncampaign.h"
#include "wing.h"
#include "MessageEditorDlg.h"
#include "EventEditor.h"
#include "MissionGoalsDlg.h"
#include "ShieldSysDlg.h"
#include "gamesnd/eventmusic.h"
#include "DebriefingEditorDlg.h"
#include "starfield/nebula.h"
#include "asteroid/asteroid.h"
#include "hud/hudsquadmsg.h"
#include "jumpnode/jumpnode.h"
#include "stats/medals.h"
#include "localization/localize.h"
#include "osapi/osregistry.h"
#include "localization/fhash.h"
#include "io/timer.h"
#include "nebula/neb.h"
#include "nebula/neblightning.h"
#include "species_defs/species_defs.h"
#include "osapi/osapi.h"
#include "graphics/font.h"
#include "object/objectdock.h"
#include "gamesnd/gamesnd.h"
#include "iff_defs/iff_defs.h"
#include "menuui/techmenu.h"
#include "missionui/fictionviewer.h"
#include "mod_table/mod_table.h"
#include <direct.h>
#include "cmdline/cmdline.h"

Go to the source code of this file.


#define MAX_DOCKS   1000
#define UNKNOWN_USER   "Unknown"


void ssm_init ()
void set_cur_indices (int obj)
int common_object_delete (int obj)
int create_waypoint (vec3d *pos, int waypoint_instance)
int create_ship (matrix *orient, vec3d *pos, int ship_type)
int query_ship_name_duplicate (int ship)
char * reg_read_string (char *section, char *name, char *default_value)
void string_copy (char *dest, const CString &src, int max_len, int modify)
void string_copy (SCP_string &dest, const CString &src, int modify)
void convert_multiline_string (CString &dest, const SCP_string &src)
void convert_multiline_string (CString &dest, const char *src)
void deconvert_multiline_string (char *dest, const CString &str, int max_len)
void deconvert_multiline_string (SCP_string &dest, const CString &str)
void parse_init (bool basic=false)
void brief_init_colors ()
void fred_preload_all_briefing_icons ()
bool fred_init ()
void set_physics_controls ()
int create_object_on_grid (int waypoint_instance)
void fix_ship_name (int ship)
void copy_bits (int *dest, int src, int mask)
int dup_object (object *objp)
int create_object (vec3d *pos, int waypoint_instance)
int create_player (int num, vec3d *pos, matrix *orient, int type, int init)
void create_new_mission ()
void reset_mission ()
void clear_mission ()
int query_valid_object (int index)
int query_valid_ship (int index)
int query_valid_waypoint (int index)
void set_cur_object_index (int obj)
void set_cur_wing (int wing)
int update_dialog_boxes ()
int delete_object (int obj)
int delete_object (object *ptr)
int delete_ship (int ship)
void delete_marked ()
void delete_reinforcement (int num)
int delete_ship_from_wing (int ship)
int query_object_in_wing (int obj)
void mark_object (int obj)
void unmark_object (int obj)
void unmark_all ()
void clear_menu (CMenu *ptr)
void generate_wing_popup_menu (CMenu *mptr, int first_id, int state)
void generate_ship_popup_menu (CMenu *mptr, int first_id, int state, int filter)
int string_lookup (const CString &str1, char *strlist[], int max)
int gray_menu_tree (CMenu *base)
int query_initial_orders_conflict (int wing)
int query_initial_orders_empty (ai_goal *ai_goals)
int set_reinforcement (char *name, int state)
int get_docking_list (int model_index)
int rename_ship (int ship, char *name)
int invalidate_references (char *name, int type)
int internal_integrity_check ()
void correct_marking ()
void set_valid_dock_points (int ship, int type, CComboBox *box)
int get_ship_from_obj (int obj)
int get_ship_from_obj (object *objp)
void ai_update_goal_references (int type, const char *old_name, const char *new_name)
int query_referenced_in_ai_goals (int type, const char *name)
int advanced_stricmp (char *one, char *two)
int reference_handler (char *name, int type, int obj)
int orders_reference_handler (int code, char *msg)
int sexp_reference_handler (int node, int code, char *msg)
char * object_name (int obj)
char * get_order_name (int order)
void object_moved (object *objp)
int query_whole_wing_marked (int wing)
void generate_ship_usage_list (int *arr, int wing)
void generate_weaponry_usage_list (int *arr, int wing)
void generate_weaponry_usage_list (int team, int *arr)
CJumpNodejumpnode_get_by_name (const CString &name)
void management_add_ships_to_combo (CComboBox *box, int flags)
int wing_is_player_wing (int wing)
void update_custom_wing_indexes ()
void stuff_special_arrival_anchor_name (char *buf, int iff_index, int restrict_to_players, int retail_format)
void stuff_special_arrival_anchor_name (char *buf, int anchor_num, int retail_format)
void update_texture_replacements (const char *old_name, const char *new_name)


int cur_wing = -1
int cur_wing_index
int cur_object_index = -1
int cur_ship = -1
int cur_model_index = 0
waypointcur_waypoint = NULL
waypoint_listcur_waypoint_list = NULL
int delete_flag
int bypass_update = 0
int Default_player_model = 0
int Update_ship = 0
int Update_wing = 0
char Fred_exe_dir [512] = ""
char Fred_base_dir [512] = ""
char Fred_alt_names [MAX_SHIPS][NAME_LENGTH+1]
char Fred_callsigns [MAX_SHIPS][NAME_LENGTH+1]
int wing_objects [MAX_WINGS][MAX_SHIPS_PER_WING]
char * Docking_bay_list [MAX_DOCKS]
bool Show_iff [MAX_IFFS]
CCriticalSection CS_cur_object_index
ai_goal_list Ai_goal_list []
int Ai_goal_list_size = sizeof(Ai_goal_list) / sizeof(ai_goal_list)
int Nmodel_num
int Nmodel_instance_num
matrix Nmodel_orient
int Nmodel_bitmap

Macro Definition Documentation

#define MAX_DOCKS   1000

Definition at line 71 of file management.cpp.

#define UNKNOWN_USER   "Unknown"

Definition at line 73 of file management.cpp.

Function Documentation

int advanced_stricmp ( char *  one,
char *  two 

Definition at line 1971 of file management.cpp.

void ai_update_goal_references ( int  type,
const char *  old_name,
const char *  new_name 

Definition at line 1941 of file management.cpp.

void brief_init_colors ( )

Definition at line 544 of file missionbriefcommon.cpp.

void clear_menu ( CMenu *  ptr)

Definition at line 1549 of file management.cpp.

void clear_mission ( )

Definition at line 790 of file management.cpp.

int common_object_delete ( int  obj)

Definition at line 1231 of file management.cpp.

void convert_multiline_string ( CString &  dest,
const SCP_string src 

Definition at line 169 of file management.cpp.

void convert_multiline_string ( CString &  dest,
const char *  src 

Definition at line 177 of file management.cpp.

void copy_bits ( int dest,
int  src,
int  mask 

Definition at line 602 of file management.cpp.

void correct_marking ( )

Definition at line 1869 of file management.cpp.

void create_new_mission ( )

Definition at line 776 of file management.cpp.

int create_object ( vec3d pos,
int  waypoint_instance 

Definition at line 695 of file management.cpp.

int create_object_on_grid ( int  waypoint_instance)

Definition at line 469 of file management.cpp.

int create_player ( int  num,
vec3d pos,
matrix orient,
int  type,
int  init 

Definition at line 747 of file management.cpp.

int create_ship ( matrix orient,
vec3d pos,
int  ship_type 

Definition at line 502 of file management.cpp.

int create_waypoint ( vec3d pos,
int  waypoint_instance 

Definition at line 769 of file management.cpp.

void deconvert_multiline_string ( char *  dest,
const CString &  str,
int  max_len 

Definition at line 184 of file management.cpp.

void deconvert_multiline_string ( SCP_string dest,
const CString &  str 

Definition at line 194 of file management.cpp.

void delete_marked ( )

Definition at line 1386 of file management.cpp.

int delete_object ( int  obj)

Definition at line 1201 of file management.cpp.

int delete_object ( object ptr)

Definition at line 1211 of file management.cpp.

void delete_reinforcement ( int  num)

Definition at line 1407 of file management.cpp.

int delete_ship ( int  ship)

Definition at line 1221 of file management.cpp.

int delete_ship_from_wing ( int  ship)

Definition at line 1419 of file management.cpp.

int dup_object ( object objp)

Definition at line 608 of file management.cpp.

void fix_ship_name ( int  ship)

Definition at line 493 of file management.cpp.

bool fred_init ( )

Definition at line 272 of file management.cpp.

void fred_preload_all_briefing_icons ( )

Definition at line 262 of file management.cpp.

void generate_ship_popup_menu ( CMenu *  mptr,
int  first_id,
int  state,
int  filter 

Definition at line 1586 of file management.cpp.

void generate_ship_usage_list ( int arr,
int  wing 

Definition at line 2371 of file management.cpp.

void generate_weaponry_usage_list ( int arr,
int  wing 

Definition at line 2385 of file management.cpp.

void generate_weaponry_usage_list ( int  team,
int arr 

Definition at line 2412 of file management.cpp.

void generate_wing_popup_menu ( CMenu *  mptr,
int  first_id,
int  state 

Definition at line 1559 of file management.cpp.

int get_docking_list ( int  model_index)

Definition at line 1787 of file management.cpp.

char* get_order_name ( int  order)

Definition at line 2312 of file management.cpp.

int get_ship_from_obj ( int  obj)

Definition at line 1923 of file management.cpp.

int get_ship_from_obj ( object objp)

Definition at line 1932 of file management.cpp.

int gray_menu_tree ( CMenu *  base)

Definition at line 1646 of file management.cpp.

int internal_integrity_check ( )

Definition at line 1840 of file management.cpp.

int invalidate_references ( char *  name,
int  type 

Definition at line 1823 of file management.cpp.

CJumpNode* jumpnode_get_by_name ( const CString &  name)

Definition at line 2433 of file management.cpp.

void management_add_ships_to_combo ( CComboBox *  box,
int  flags 

Definition at line 2441 of file management.cpp.

void mark_object ( int  obj)

Definition at line 1491 of file management.cpp.

void object_moved ( object objp)

Definition at line 2326 of file management.cpp.

char* object_name ( int  obj)

Definition at line 2285 of file management.cpp.

int orders_reference_handler ( int  code,
char *  msg 

Definition at line 2146 of file management.cpp.

void parse_init ( bool  basic = false)

Initialize the mission parse process.

Definition at line 5929 of file missionparse.cpp.

int query_initial_orders_conflict ( int  wing)

Definition at line 1671 of file management.cpp.

int query_initial_orders_empty ( ai_goal ai_goals)

Definition at line 1695 of file management.cpp.

int query_object_in_wing ( int  obj)

Definition at line 1480 of file management.cpp.

int query_referenced_in_ai_goals ( int  type,
const char *  name 

Definition at line 1954 of file management.cpp.

int query_ship_name_duplicate ( int  ship)

Definition at line 590 of file management.cpp.

int query_valid_object ( int  index)

Definition at line 1000 of file management.cpp.

int query_valid_ship ( int  index)

Definition at line 1021 of file management.cpp.

int query_valid_waypoint ( int  index)

Definition at line 1042 of file management.cpp.

int query_whole_wing_marked ( int  wing)

Definition at line 2347 of file management.cpp.

int reference_handler ( char *  name,
int  type,
int  obj 

Definition at line 1988 of file management.cpp.

char * reg_read_string ( char *  section,
char *  name,
char *  default_value 

Definition at line 2490 of file management.cpp.

int rename_ship ( int  ship,
char *  name 

Definition at line 1801 of file management.cpp.

void reset_mission ( )

Definition at line 784 of file management.cpp.

void set_cur_indices ( int  obj)

Definition at line 1093 of file management.cpp.

void set_cur_object_index ( int  obj)

Definition at line 1065 of file management.cpp.

void set_cur_wing ( int  wing)

Definition at line 1080 of file management.cpp.

void set_physics_controls ( )

Definition at line 454 of file management.cpp.

int set_reinforcement ( char *  name,
int  state 

Definition at line 1708 of file management.cpp.

void set_valid_dock_points ( int  ship,
int  type,
CComboBox *  box 

Definition at line 1907 of file management.cpp.

int sexp_reference_handler ( int  node,
int  code,
char *  msg 

Definition at line 2192 of file management.cpp.

void ssm_init ( )

Definition at line 195 of file hudartillery.cpp.

void string_copy ( char *  dest,
const CString &  src,
int  max_len,
int  modify 

Definition at line 142 of file management.cpp.

void string_copy ( SCP_string dest,
const CString &  src,
int  modify 

Definition at line 158 of file management.cpp.

int string_lookup ( const CString &  str1,
char *  strlist[],
int  max 

Definition at line 1631 of file management.cpp.

void stuff_special_arrival_anchor_name ( char *  buf,
int  iff_index,
int  restrict_to_players,
int  retail_format 

Definition at line 2590 of file management.cpp.

void stuff_special_arrival_anchor_name ( char *  buf,
int  anchor_num,
int  retail_format 

Definition at line 2607 of file management.cpp.

void unmark_all ( )

Definition at line 1534 of file management.cpp.

void unmark_object ( int  obj)

Definition at line 1506 of file management.cpp.

void update_custom_wing_indexes ( )

Definition at line 2569 of file management.cpp.

int update_dialog_boxes ( )

Definition at line 1163 of file management.cpp.

void update_texture_replacements ( const char *  old_name,
const char *  new_name 

Definition at line 2622 of file management.cpp.

int wing_is_player_wing ( int  wing)

Definition at line 2539 of file management.cpp.

Variable Documentation

ai_goal_list Ai_goal_list[]
Initial value:
= {
{ "Waypoints", AI_GOAL_WAYPOINTS, 0 },
{ "Waypoints once", AI_GOAL_WAYPOINTS_ONCE, 0 },
{ "Warp", AI_GOAL_WARP, 0 },
{ "Destroy subsystem", AI_GOAL_DESTROY_SUBSYSTEM, 0 },
{ "Dock", AI_GOAL_DOCK, 0 },
{ "Undock", AI_GOAL_UNDOCK, 0 },
{ "Attack any ship", AI_GOAL_CHASE_ANY, 0 },
{ "Disable ship", AI_GOAL_DISABLE_SHIP, 0 },
{ "Disarm ship", AI_GOAL_DISARM_SHIP, 0 },
{ "Evade ship", AI_GOAL_EVADE_SHIP, 0 },
{ "Ignore ship", AI_GOAL_IGNORE, 0 },
{ "Ignore ship (new)", AI_GOAL_IGNORE_NEW, 0 },
{ "Stay near ship", AI_GOAL_STAY_NEAR_SHIP, 0 },
{ "Keep safe distance", AI_GOAL_KEEP_SAFE_DISTANCE, 0 },
{ "Stay still", AI_GOAL_STAY_STILL, 0 },
{ "Play dead", AI_GOAL_PLAY_DEAD, 0 }
Definition: aigoals.h:36
Definition: aigoals.h:37
#define AI_GOAL_DOCK
Definition: aigoals.h:30
Definition: aigoals.h:31
Definition: aigoals.h:38
Definition: aigoals.h:47
Definition: aigoals.h:41
#define AI_GOAL_WARP
Definition: aigoals.h:33
Definition: aigoals.h:42
Definition: aigoals.h:40
Definition: aigoals.h:52
Definition: aigoals.h:44
Definition: aigoals.h:57
Definition: aigoals.h:53
Definition: aigoals.h:32
Definition: aigoals.h:43
Definition: aigoals.h:48
Definition: aigoals.h:39
Definition: aigoals.h:29
Definition: aigoals.h:34

Definition at line 106 of file management.cpp.

int Ai_goal_list_size = sizeof(Ai_goal_list) / sizeof(ai_goal_list)

Definition at line 127 of file management.cpp.

int bypass_update = 0

Definition at line 85 of file management.cpp.

CCriticalSection CS_cur_object_index

Definition at line 104 of file management.cpp.

int cur_model_index = 0

Definition at line 81 of file management.cpp.

int cur_object_index = -1

Definition at line 79 of file management.cpp.

int cur_ship = -1

Definition at line 80 of file management.cpp.

waypoint* cur_waypoint = NULL

Definition at line 82 of file management.cpp.

waypoint_list* cur_waypoint_list = NULL

Definition at line 83 of file management.cpp.

int cur_wing = -1

Definition at line 77 of file management.cpp.

int cur_wing_index

Definition at line 78 of file management.cpp.

int Default_player_model = 0

Definition at line 86 of file management.cpp.

int delete_flag

Definition at line 84 of file management.cpp.

char* Docking_bay_list[MAX_DOCKS]

Definition at line 99 of file management.cpp.

char Fred_alt_names[MAX_SHIPS][NAME_LENGTH+1]

Definition at line 93 of file management.cpp.

char Fred_base_dir[512] = ""

Definition at line 91 of file management.cpp.

char Fred_callsigns[MAX_SHIPS][NAME_LENGTH+1]

Definition at line 94 of file management.cpp.

char Fred_exe_dir[512] = ""

Definition at line 90 of file management.cpp.

int Nmodel_bitmap

Definition at line 170 of file starfield.cpp.

int Nmodel_instance_num

Definition at line 167 of file starfield.cpp.

int Nmodel_num

Definition at line 166 of file starfield.cpp.

matrix Nmodel_orient

Definition at line 168 of file starfield.cpp.

bool Show_iff[MAX_IFFS]

Definition at line 102 of file management.cpp.

int Update_ship = 0

Definition at line 87 of file management.cpp.

int Update_wing = 0

Definition at line 88 of file management.cpp.

Definition at line 97 of file management.cpp.