Open source remastering of the Freespace 2 engine
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 */
12 #ifndef __MANAGEMENT_H__
13 #define __MANAGEMENT_H__
15 #include <afxmt.h>
16 #include "globalincs/pstypes.h"
17 #include "ship/ship.h"
18 #include "ai/aigoals.h"
19 #include "jumpnode/jumpnode.h"
22 #define SHIP_FILTER_PLAYERS (1<<0) // set: add players to list as well
23 #define SHIP_FILTER_FLYABLE (1<<1) // set: filter out non-flyable ships
25 extern int cur_object_index;
26 extern int cur_ship;
27 extern int cur_wing;
28 extern int cur_wing_index;
29 extern int cur_model_index;
30 extern waypoint *cur_waypoint;
32 extern int Update_ship;
33 extern int Update_wing;
35 extern ai_goal_list Ai_goal_list[];
36 extern int Ai_goal_list_size;
38 // alternate ship name and callsign stuff
39 extern char Fred_alt_names[MAX_SHIPS][NAME_LENGTH+1];
40 extern char Fred_callsigns[MAX_SHIPS][NAME_LENGTH+1];
44 extern char *Docking_bay_list[];
46 extern char Fred_exe_dir[512];
47 extern char Fred_base_dir[512];
49 // Goober5000 - for voice acting manager
56 extern bool Voice_no_replace_filenames;
58 extern int Voice_export_selection;
60 // Goober5000
61 extern bool Show_iff[];
63 extern CCriticalSection CS_cur_object_index;
65 void string_copy(char *dest, const CString &src, int max_len, int modify = 0);
66 void string_copy(SCP_string &dest, const CString &src, int modify = 0);
67 void convert_multiline_string(CString &dest, const SCP_string &src);
68 void convert_multiline_string(CString &dest, const char *src);
69 void deconvert_multiline_string(char *dest, const CString &str, int max_len);
70 void deconvert_multiline_string(SCP_string &dest, const CString &str);
72 bool fred_init();
74 int dup_object(object *objp);
75 int create_object_on_grid(int waypoint_instance = -1);
76 int create_object(vec3d *pos, int waypoint_instance = -1);
77 int create_player(int num, vec3d *pos, matrix *orient, int type = -1, int init = 1);
78 void create_new_mission();
79 void reset_mission();
80 void clear_mission();
84 void set_cur_indices(int obj = -1);
85 void set_cur_object_index(int obj = -1);
86 int delete_object(int obj);
87 int delete_object(object *ptr);
88 int delete_ship(int ship);
89 void delete_marked();
90 void delete_reinforcement(int num);
92 int find_free_wing();
94 void mark_object(int obj);
95 void unmark_object(int obj);
96 void unmark_all();
97 void clear_menu(CMenu *ptr);
98 void generate_wing_popup_menu(CMenu *mptr, int first_id, int state);
99 void generate_ship_popup_menu(CMenu *mptr, int first_id, int state, int filter = 0);
100 int string_lookup(const CString &str1, char *strlist[], int max);
101 int update_dialog_boxes();
102 void set_cur_wing(int wing);
103 int gray_menu_tree(CMenu *base);
105 int query_initial_orders_empty(ai_goal *ai_goals);
106 int set_reinforcement(char *name, int state);
107 int get_docking_list(int model_index);
108 int rename_ship(int ship, char *name);
109 void fix_ship_name(int ship);
111 void correct_marking();
112 int get_ship_from_obj(int obj);
113 int get_ship_from_obj(object *objp);
114 void set_valid_dock_points(int ship, int type, CComboBox *box);
115 void ai_update_goal_references(int type, const char *old_name, const char *new_name);
116 int query_referenced_in_ai_goals(int type, const char *name);
117 int advanced_stricmp(char *one, char *two);
118 int reference_handler(char *name, int type, int obj);
119 int orders_reference_handler(int code, char *msg);
120 int sexp_reference_handler(int node, int code, char *msg);
121 char *object_name(int obj);
122 char *get_order_name(int order);
123 void object_moved(object *ptr);
124 int invalidate_references(char *name, int type);
126 void generate_weaponry_usage_list(int team, int *arr);
127 void generate_weaponry_usage_list(int *arr, int wing);
128 void generate_ship_usage_list(int *arr, int wing);
130 CJumpNode *jumpnode_get_by_name(const CString& name);
132 // function and defines to use when adding ships to combo boxes
133 #define SHIPS_2_COMBO_SPECIAL (1<<0)
134 #define SHIPS_2_COMBO_ALL_SHIPS (1<<1)
135 #define SHIPS_2_COMBO_DOCKING_BAY_ONLY (1<<2)
137 extern void management_add_ships_to_combo( CComboBox *box, int flags );
139 // Goober5000
140 extern int wing_is_player_wing(int wing);
141 extern void update_custom_wing_indexes();
142 extern void stuff_special_arrival_anchor_name(char *buf, int iff_index, int restrict_to_players, int retail_format);
143 extern void stuff_special_arrival_anchor_name(char *buf, int anchor_num, int retail_format);
144 extern void update_texture_replacements(const char *old_name, const char *new_name);
146 #endif
void delete_marked()
void ai_update_goal_references(int type, const char *old_name, const char *new_name)
int cur_ship
Definition: management.cpp:80
char Voice_abbrev_command_briefing[NAME_LENGTH]
int delete_object(int obj)
int rename_ship(int ship, char *name)
int Update_ship
Definition: management.cpp:87
int gray_menu_tree(CMenu *base)
ai_goal_list Ai_goal_list[]
Definition: management.cpp:106
int create_player(int num, vec3d *pos, matrix *orient, int type=-1, int init=1)
Definition: management.cpp:747
int wing_is_player_wing(int wing)
int sexp_reference_handler(int node, int code, char *msg)
int Ai_goal_list_size
Definition: management.cpp:127
void fix_ship_name(int ship)
Definition: management.cpp:493
GLuint index
Definition: Glext.h:5608
int query_valid_ship(int index=cur_object_index)
#define MAX_WINGS
Definition: globals.h:50
#define MAX_SHIPS
Definition: globals.h:37
int dup_object(object *objp)
Definition: management.cpp:608
waypoint * cur_waypoint
Definition: management.cpp:82
int create_object_on_grid(int waypoint_instance=-1)
Definition: management.cpp:469
int set_reinforcement(char *name, int state)
Definition: pstypes.h:88
void delete_reinforcement(int num)
CButton * team
Definition: ship.h:1516
char * Docking_bay_list[]
Definition: management.cpp:99
void mark_object(int obj)
Definition: globals.h:52
hull_check orient
Definition: lua.cpp:5049
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
void generate_ship_usage_list(int *arr, int wing)
object * objp
Definition: lua.cpp:3105
void unmark_object(int obj)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: Glext.h:7308
char * get_order_name(int order)
void convert_multiline_string(CString &dest, const SCP_string &src)
Definition: management.cpp:169
int advanced_stricmp(char *one, char *two)
GLenum type
Definition: Gl.h:1492
char Fred_base_dir[512]
Definition: management.cpp:91
char Fred_alt_names[MAX_SHIPS][NAME_LENGTH+1]
Definition: management.cpp:93
Definition: vddraw.h:425
void set_physics_controls()
Definition: management.cpp:454
void unmark_all()
void stuff_special_arrival_anchor_name(char *buf, int iff_index, int restrict_to_players, int retail_format)
void generate_wing_popup_menu(CMenu *mptr, int first_id, int state)
char Fred_callsigns[MAX_SHIPS][NAME_LENGTH+1]
Definition: management.cpp:94
int query_valid_waypoint(int index=cur_object_index)
char Voice_abbrev_briefing[NAME_LENGTH]
void deconvert_multiline_string(char *dest, const CString &str, int max_len)
Definition: management.cpp:184
int string_lookup(const CString &str1, char *strlist[], int max)
char Voice_script_entry_format[NOTES_LENGTH]
int query_initial_orders_empty(ai_goal *ai_goals)
char Voice_abbrev_debriefing[NAME_LENGTH]
void set_cur_object_index(int obj=-1)
int query_whole_wing_marked(int wing)
void reset_mission()
Definition: management.cpp:784
int Voice_export_selection
void object_moved(object *ptr)
void update_texture_replacements(const char *old_name, const char *new_name)
int orders_reference_handler(int code, char *msg)
Definition: ship.h:534
char Voice_abbrev_message[NAME_LENGTH]
int cur_wing_index
Definition: management.cpp:78
int find_free_wing()
Definition: wing.cpp:41
bool Voice_no_replace_filenames
int delete_ship(int ship)
void create_new_mission()
Definition: management.cpp:776
int internal_integrity_check()
GLbitfield flags
Definition: Glext.h:6722
CJumpNode * jumpnode_get_by_name(const CString &name)
GLuint const GLchar * name
Definition: Glext.h:5608
int create_object(vec3d *pos, int waypoint_instance=-1)
Definition: management.cpp:695
void set_cur_indices(int obj=-1)
GLuint GLuint num
Definition: Glext.h:9089
int query_referenced_in_ai_goals(int type, const char *name)
int cur_object_index
Definition: management.cpp:79
int wing_objects[MAX_WINGS][MAX_SHIPS_PER_WING]
Definition: management.cpp:97
int invalidate_references(char *name, int type)
int reference_handler(char *name, int type, int obj)
Definition: globals.h:15
CCriticalSection CS_cur_object_index
Definition: management.cpp:104
int cur_wing
Definition: management.cpp:77
int get_ship_from_obj(int obj)
int get_docking_list(int model_index)
void set_cur_wing(int wing)
void management_add_ships_to_combo(CComboBox *box, int flags)
char * object_name(int obj)
GLenum src
Definition: Glext.h:5917
bool fred_init()
Definition: management.cpp:272
hull_check pos
Definition: lua.cpp:5050
GLsizei GLsizei GLuint * obj
Definition: Glext.h:5619
int update_dialog_boxes()
int Update_wing
Definition: management.cpp:88
GLuint GLdouble GLdouble GLint GLint order
Definition: Glext.h:10665
Definition: ai.h:134
void set_valid_dock_points(int ship, int type, CComboBox *box)
char Voice_abbrev_mission[NAME_LENGTH]
bool Show_iff[]
Definition: management.cpp:102
void string_copy(char *dest, const CString &src, int max_len, int modify=0)
Definition: management.cpp:142
void generate_weaponry_usage_list(int team, int *arr)
int delete_ship_from_wing(int ship=cur_ship)
Definition: globals.h:20
void generate_ship_popup_menu(CMenu *mptr, int first_id, int state, int filter=0)
void update_custom_wing_indexes()
char Fred_exe_dir[512]
Definition: management.cpp:90
char Voice_abbrev_campaign[NAME_LENGTH]
void correct_marking()
waypoint_list * cur_waypoint_list
Definition: management.cpp:83
int query_valid_object(int index=cur_object_index)
int cur_model_index
Definition: management.cpp:81
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: Glext.h:6566
void clear_mission()
Definition: management.cpp:790
void clear_menu(CMenu *ptr)
int query_initial_orders_conflict(int wing)
int query_object_in_wing(int obj=cur_object_index)