initializes all the data (for constructors)
| 190 | |
| 191 | // initializes all the data (for constructors) |
| 192 | void pilot::initialize(void) { |
| 193 | int i; |
| 194 | |
| 195 | filename = NULL; |
| 196 | name = NULL; |
| 197 | ship_model = mem_strdup("Pyro-GL"); |
| 198 | ship_logo = NULL; |
| 199 | audio1_file = NULL; |
| 200 | audio2_file = NULL; |
| 201 | audio3_file = NULL; |
| 202 | audio4_file = NULL; |
| 203 | guidebot_name = mem_strdup("GB"); |
| 204 | picture_id = PPIC_INVALID_ID; |
| 205 | difficulty = DIFFICULTY_ROOKIE; |
| 206 | hud_mode = (uint8_t)HUD_COCKPIT; |
| 207 | hud_stat = 0; |
| 208 | hud_graphical_stat = STAT_STANDARD; |
| 209 | game_window_w = Video_res_list[Game_video_resolution].width; |
| 210 | game_window_h = Video_res_list[Game_video_resolution].height; |
| 211 | num_missions_flown = 0; |
| 212 | mission_data = NULL; |
| 213 | mouselook_control = false; |
| 214 | key_ramping = 0.35f; |
| 215 | lrearview_enabled = false; |
| 216 | rrearview_enabled = false; |
| 217 | |
| 218 | bool kiddie_settings = true; |
| 219 | |
| 220 | if (Database) { |
| 221 | Database->read("ProfanityPrevention", &kiddie_settings); |
| 222 | } |
| 223 | |
| 224 | if (kiddie_settings) { |
| 225 | profanity_filter_on = true; |
| 226 | audiotaunts = false; |
| 227 | } else { |
| 228 | profanity_filter_on = false; |
| 229 | audiotaunts = true; |
| 230 | } |
| 231 | |
| 232 | gameplay_toggles.guided_mainview = false; |
| 233 | gameplay_toggles.show_reticle = true; |
| 234 | gameplay_toggles.ship_noises = true; |
| 235 | |
| 236 | // Copy taunts |
| 237 | for (i = 0; i < MAX_PILOT_TAUNTS; i++) { |
| 238 | strcpy(taunts[i], TXT(TXT_TAUNT_TEXT + i)); |
| 239 | } |
| 240 | |
| 241 | read_controller = READF_MOUSE + READF_JOY; |
| 242 | |
| 243 | if (Controller) { |
| 244 | for (i = 0; i < NUM_CONTROLLER_FUNCTIONS; i++) { |
| 245 | Controller->get_controller_function(Controller_needs[i].id, controls[i].type, &controls[i].value, |
| 246 | controls[i].flags); |
| 247 | controls[i].id = Controller_needs[i].id; |
| 248 | } |
| 249 | } else { |
nothing calls this directly
no test coverage detected