mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
*drum roll* Pilot Code! Originated by taylor. Additional direct work by: The E, niffiwan, CommanderDJ, Pyro3D, Echelon9 (PVS-Studio), Karajorma and Eli2. (If I missed you, don't kill me.)
MASSIVE thanks to Mjn.Mixael and Blue Planet for tireless constant testing. (It's still not perfect, but it probably wouldn't be where it is at without them) Spans a lot from initial commit to AP Branch in r6835. git-svn-id: svn://svn.icculus.org/fs2open/trunk@9561 387891d4-d844-0410-90c0-e4c51a9137d3
This commit is contained in:
1 parent
222f632943
commit
593be42e66
67 files changed
+8111
-4157
No files matched your search
@@ -600,6 +600,14 @@ FS2_SOURCES = \
|
||||
particle/particle.h \
|
||||
pcxutils/pcxutils.cpp \
|
||||
pcxutils/pcxutils.h \
|
||||
pilotfile/pilotfile.cpp \
|
||||
pilotfile/pilotfile.h \
|
||||
pilotfile/pilotfile_convert.cpp \
|
||||
pilotfile/pilotfile_convert.h \
|
||||
pilotfile/plr.cpp \
|
||||
pilotfile/csg.cpp \
|
||||
pilotfile/plr_convert.cpp \
|
||||
pilotfile/csg_convert.cpp \
|
||||
pngutils/pngutils.cpp \
|
||||
pngutils/pngutils.h \
|
||||
physics/physics.cpp \
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "missionui/missionscreencommon.h"
|
||||
#include "graphics/font.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "popup/popup.h"
|
||||
#include "ui/uidefs.h"
|
||||
@@ -1350,7 +1350,12 @@ void control_config_close()
|
||||
common_free_interface_palette(); // restore game palette
|
||||
hud_squadmsg_save_keys(); // rebuild map for saving/restoring keys in squadmsg mode
|
||||
game_flush();
|
||||
write_pilot_file();
|
||||
|
||||
if (Game_mode & GM_MULTIPLAYER) {
|
||||
Pilot.save_player();
|
||||
} else {
|
||||
Pilot.save_savefile();
|
||||
}
|
||||
|
||||
// free strings
|
||||
for(idx=0; idx<NUM_JOY_AXIS_ACTIONS; idx++){
|
||||
|
||||
@@ -207,6 +207,9 @@ enum IoActionId {
|
||||
//Gliding
|
||||
TOGGLE_GLIDING =117, //!< TOGGLE_GLIDING
|
||||
|
||||
//Inflight configurable firing sequence
|
||||
CYCLE_PRIMARY_WEAPON_SEQUENCE =118, //!< cycle num primaries to fire at once
|
||||
|
||||
/**
|
||||
* This must always be below the last defined action
|
||||
*/
|
||||
|
||||
@@ -187,7 +187,8 @@ config_item Control_config[CCFG_MAX + 1] = {
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot"},
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points"},
|
||||
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, false, "Toggle Gliding"},
|
||||
{ -1, -1, -1, false, "" }
|
||||
{ KEY_O, -1, WEAPON_TAB, false, "Cycle Primary Weapon Firing Rate" },
|
||||
{ -1, -1, -1, false, "" }
|
||||
};
|
||||
|
||||
char *Scan_code_text_german[] = {
|
||||
|
||||
+18
-17
@@ -35,11 +35,9 @@ char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
|
||||
"2_ViewFootage-m"
|
||||
};
|
||||
|
||||
int Cutscenes_viewable;
|
||||
int Description_index;
|
||||
SCP_vector<cutscene_info> Cutscenes;
|
||||
|
||||
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
|
||||
void cutscene_close()
|
||||
{
|
||||
for(SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut)
|
||||
@@ -72,6 +70,8 @@ void cutscene_init()
|
||||
skip_to_string("#Cutscenes");
|
||||
ignore_white_space();
|
||||
|
||||
bool isFirstCutscene = true;
|
||||
|
||||
while ( required_string_either("#End", "$Filename:") )
|
||||
{
|
||||
memset(&cutinfo, 0, sizeof(cutscene_info));
|
||||
@@ -91,13 +91,22 @@ void cutscene_init()
|
||||
required_string("$cd:");
|
||||
stuff_int( &cutinfo.cd );
|
||||
|
||||
if (isFirstCutscene) {
|
||||
isFirstCutscene = false;
|
||||
// The original code assumes the first movie is the intro, so always viewable
|
||||
cutinfo.viewable = true;
|
||||
}
|
||||
|
||||
if (optional_string("$Always Viewable:")) {
|
||||
stuff_boolean(&cutinfo.viewable);
|
||||
}
|
||||
|
||||
|
||||
Cutscenes.push_back(cutinfo);
|
||||
}
|
||||
|
||||
required_string("#End");
|
||||
|
||||
Cutscenes_viewable = INTRO_CUTSCENE_FLAG;
|
||||
|
||||
// close localization
|
||||
lcl_ext_close();
|
||||
}
|
||||
@@ -140,7 +149,7 @@ void cutscene_mark_viewable(char *filename)
|
||||
|
||||
// see if the stripped filename matches the cutscene filename
|
||||
if ( strstr(cut_file, file) != NULL ) {
|
||||
Cutscenes_viewable |= (1<<i);
|
||||
cut->viewable = true;
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
@@ -473,20 +482,12 @@ void cutscenes_screen_init()
|
||||
Scroll_offset = Selected_line = 0;
|
||||
Description_index = -1;
|
||||
|
||||
// when doing a debug version, just put all of the movie files here.
|
||||
#ifndef NDEBUG
|
||||
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
|
||||
#endif
|
||||
|
||||
// if (All_movies_enabled)
|
||||
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
|
||||
|
||||
Cutscene_list.clear();
|
||||
|
||||
size_t size = Cutscenes.size();
|
||||
for (size_t j=0;j < size;j++) {
|
||||
if ( Cutscenes_viewable & (1<<j) ) {
|
||||
Cutscene_list.push_back((int)j);
|
||||
int u = 0;
|
||||
for (SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut, u++) {
|
||||
if ( (*cut).viewable ) {
|
||||
Cutscene_list.push_back(u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
@@ -15,25 +13,24 @@
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// this cutscene is always available.
|
||||
#define INTRO_CUTSCENE_FLAG (1<<0)
|
||||
typedef struct cutscene_info {
|
||||
cutscene_info() :
|
||||
viewable(false)
|
||||
{}
|
||||
|
||||
typedef struct cutscene_info
|
||||
{
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
char name[NAME_LENGTH];
|
||||
char *description;
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
char name[NAME_LENGTH];
|
||||
char *description;
|
||||
int cd;
|
||||
bool viewable;
|
||||
} cutscene_info;
|
||||
|
||||
extern SCP_vector<cutscene_info> Cutscenes;
|
||||
extern int Cutscenes_viewable;
|
||||
|
||||
// initializa table data
|
||||
void cutscene_init();
|
||||
int cutscene_get_cd_num(char *filename);
|
||||
|
||||
|
||||
void cutscenes_screen_init();
|
||||
void cutscenes_screen_close();
|
||||
void cutscenes_screen_do_frame();
|
||||
|
||||
@@ -259,7 +259,7 @@ void campaign_editor::mission_selected(int num)
|
||||
bc_dialog->SetWindowText(Campaign.missions[num].briefing_cutscene);
|
||||
|
||||
// new main hall stuff
|
||||
sprintf(mainhalltext, "%d", Campaign.missions[num].main_hall);
|
||||
sprintf(mainhalltext, "%s", const_cast<char*>(Campaign.missions[num].main_hall.c_str()));
|
||||
bc_hall->SetWindowText(CString(mainhalltext));
|
||||
|
||||
// new debriefing persona stuff
|
||||
@@ -334,11 +334,13 @@ void campaign_editor::load_tree(int save_first)
|
||||
if (Cur_campaign_mission < 0) {
|
||||
GetDlgItem(IDC_SEXP_TREE)->EnableWindow(FALSE);
|
||||
GetDlgItem(IDC_BRIEFING_CUTSCENE)->EnableWindow(FALSE);
|
||||
GetDlgItem(IDC_MAIN_HALL)->EnableWindow(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
GetDlgItem(IDC_SEXP_TREE)->EnableWindow(TRUE);
|
||||
GetDlgItem(IDC_BRIEFING_CUTSCENE)->EnableWindow(TRUE);
|
||||
GetDlgItem(IDC_MAIN_HALL)->EnableWindow(TRUE);
|
||||
|
||||
GetDlgItem(IDC_MISSISON_LOOP_DESC)->EnableWindow(FALSE);
|
||||
GetDlgItem(IDC_LOOP_BRIEF_ANIM)->EnableWindow(FALSE);
|
||||
@@ -855,19 +857,12 @@ void campaign_editor::OnBrowseLoopSound()
|
||||
void campaign_editor::OnChangeMainHall()
|
||||
{
|
||||
CString str;
|
||||
int hall;
|
||||
|
||||
UpdateData(TRUE);
|
||||
|
||||
if (Cur_campaign_mission >= 0)
|
||||
{
|
||||
GetDlgItem(IDC_MAIN_HALL)->GetWindowText(str);
|
||||
hall = atoi(str);
|
||||
|
||||
if (hall > 255) hall = 255;
|
||||
if (hall < 0) hall = 0;
|
||||
|
||||
Campaign.missions[Cur_campaign_mission].main_hall = (ubyte) hall;
|
||||
Campaign.missions[Cur_campaign_mission].main_hall = SCP_string((LPCTSTR)(str));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ protected:
|
||||
afx_msg void OnEndEdit();
|
||||
afx_msg void OnChangeBriefingCutscene();
|
||||
afx_msg void OnSelchangeType();
|
||||
afx_msg void MainHallChange();
|
||||
afx_msg void OnToggleLoop();
|
||||
afx_msg void OnBrowseLoopAni();
|
||||
afx_msg void OnBrowseLoopSound();
|
||||
|
||||
@@ -4017,12 +4017,12 @@ int CFred_mission_save::save_campaign_file(char *pathname)
|
||||
else
|
||||
fout("\n+Main Hall:");
|
||||
|
||||
fout(" %d", Campaign.missions[m].main_hall);
|
||||
fout(" %s", Campaign.missions[m].main_hall.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// save Bastion flag properly
|
||||
fout(" %d", Campaign.missions[m].flags | ((Campaign.missions[m].main_hall > 0) ? CMISSION_FLAG_BASTION : 0));
|
||||
fout(" %d", Campaign.missions[m].flags | ((Campaign.missions[m].main_hall != "") ? CMISSION_FLAG_BASTION : 0));
|
||||
}
|
||||
|
||||
if ( Campaign.missions[m].debrief_persona_index > 0 ) {
|
||||
|
||||
@@ -157,9 +157,12 @@
|
||||
#include "weapon/shockwave.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "fs2netd/fs2netd_client.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
extern int Om_tracker_flag; // needed for FS2OpenPXO config
|
||||
|
||||
|
||||
@@ -1998,7 +2001,7 @@ void game_init()
|
||||
|
||||
if(!Cmdline_reparse_mainhall)
|
||||
{
|
||||
main_hall_read_table();
|
||||
main_hall_table_init();
|
||||
}
|
||||
|
||||
if (Cmdline_env) {
|
||||
@@ -2013,6 +2016,9 @@ void game_init()
|
||||
|
||||
game_title_screen_close();
|
||||
|
||||
// convert old pilot files (if they need it)
|
||||
convert_pilot_files();
|
||||
|
||||
#ifdef _WIN32
|
||||
timeBeginPeriod(1);
|
||||
#endif
|
||||
@@ -5880,9 +5886,7 @@ void game_enter_state( int old_state, int new_state )
|
||||
|
||||
// remove any multiplayer flags from the game mode
|
||||
Game_mode &= ~(GM_MULTIPLAYER);
|
||||
|
||||
// determine which ship this guy is currently based on
|
||||
main_hall_init(Player->main_hall);
|
||||
|
||||
// set the game_mode based on the type of player
|
||||
Assert( Player != NULL );
|
||||
|
||||
@@ -5892,6 +5896,17 @@ void game_enter_state( int old_state, int new_state )
|
||||
Game_mode = GM_NORMAL;
|
||||
}
|
||||
|
||||
// determine which ship this guy is currently based on
|
||||
mission_load_up_campaign(Player);
|
||||
|
||||
// if we're coming from the end of a campaign, we want to load the first mainhall of the campaign
|
||||
// otherwise load the mainhall for the mission the player's up to
|
||||
if (Campaign.next_mission == -1) {
|
||||
main_hall_init(Campaign.missions[0].main_hall);
|
||||
} else {
|
||||
main_hall_init(Campaign.missions[Campaign.next_mission].main_hall);
|
||||
}
|
||||
|
||||
//if ( (Cmdline_start_netgame || (Cmdline_connect_addr != NULL)) && !Main_hall_netgame_started ) {
|
||||
// Main_hall_netgame_started = 1;
|
||||
// main_hall_do_multi_ready();
|
||||
@@ -7250,8 +7265,8 @@ void game_shutdown(void)
|
||||
// if the player has left the "player select" screen and quit the game without actually choosing
|
||||
// a player, Player will be NULL, in which case we shouldn't write the player file out!
|
||||
if (!(Game_mode & GM_STANDALONE_SERVER) && (Player!=NULL) && !Is_standalone){
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
Pilot.save_player();
|
||||
Pilot.save_savefile();
|
||||
}
|
||||
|
||||
// load up common multiplayer icons
|
||||
@@ -7263,7 +7278,7 @@ void game_shutdown(void)
|
||||
ship_close(); // free any memory that was allocated for the ships
|
||||
hud_free_scrollback_list();// free space allocated to store hud messages in hud scrollback
|
||||
unload_animating_pointer();// frees the frames used for the animating mouse pointer
|
||||
mission_campaign_close(); // close out the campaign stuff
|
||||
mission_campaign_clear(); // clear out the campaign stuff
|
||||
message_mission_close(); // clear loaded table data from message.tbl
|
||||
mission_parse_close(); // clear out any extra memory that may be in use by mission parsing
|
||||
multi_voice_close(); // close down multiplayer voice (including freeing buffers, etc)
|
||||
|
||||
@@ -1580,13 +1580,13 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
|
||||
static player new_plr;
|
||||
|
||||
if (first_call) {
|
||||
memset( &new_plr, 0, sizeof(player) );
|
||||
new_plr.reset();
|
||||
strncpy( new_plr.callsign, callsign, CALLSIGN_LEN );
|
||||
|
||||
// initialize the stats to default values
|
||||
init_scoring_element( &new_plr.stats );
|
||||
|
||||
memset( out_plr, 0, sizeof(player) );
|
||||
out_plr->reset();
|
||||
|
||||
Local_timeout = timer_get_seconds() + 30;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void gamesnd_play_iface(int n)
|
||||
*/
|
||||
int gamesnd_lookup_name(const char* name, const SCP_vector<game_snd>& sounds)
|
||||
{
|
||||
//if we get passed -1, don't bother trying to look it up.
|
||||
// if we get passed -1, don't bother trying to look it up.
|
||||
if (name == NULL || *name == 0 || !strcmp(name, "-1"))
|
||||
{
|
||||
return -1;
|
||||
@@ -60,7 +60,7 @@ int gamesnd_lookup_name(const char* name, const SCP_vector<game_snd>& sounds)
|
||||
return -1;
|
||||
}
|
||||
|
||||
//WMC - now ignores file extension.
|
||||
// WMC - now ignores file extension.
|
||||
int gamesnd_get_by_name(const char* name)
|
||||
{
|
||||
Assert( Snds.size() <= INT_MAX );
|
||||
|
||||
@@ -173,6 +173,12 @@ typedef struct flag_def_list {
|
||||
ubyte var;
|
||||
} def_list;
|
||||
|
||||
// weapon count list (mainly for pilot files)
|
||||
typedef struct wep_t {
|
||||
int index;
|
||||
int count;
|
||||
} wep_t;
|
||||
|
||||
//This are defined in MainWin.c
|
||||
extern void _cdecl WinAssert(char * text,char *filename, int line);
|
||||
void _cdecl WinAssert(char * text, char * filename, int linenum, const char * format, ... );
|
||||
|
||||
@@ -50,11 +50,11 @@ typedef struct HUD_CONFIG_TYPE {
|
||||
int show_flags2; // whether to show gauge
|
||||
int popup_flags; // whether gauge is popup
|
||||
int popup_flags2; // whether gauge is popup
|
||||
int num_msg_window_lines;
|
||||
int rp_flags; // see RP_ flags above
|
||||
int rp_dist; // one of RR_ #defines above
|
||||
int is_observer; // 1 or 0, observer mode or not, respectively
|
||||
int main_color; // the main color
|
||||
ubyte num_msg_window_lines;
|
||||
|
||||
// colors for all the gauges
|
||||
color clr[NUM_HUD_GAUGES];
|
||||
@@ -94,6 +94,7 @@ void hud_config_popup_flag_set(int i);
|
||||
void hud_config_popup_flag_clear(int i);
|
||||
|
||||
void hud_config_record_color(int color);
|
||||
void hud_config_set_color(int color);
|
||||
|
||||
// load up the given hcf file
|
||||
void hud_config_color_load(char *name);
|
||||
|
||||
+34
-76
@@ -91,11 +91,6 @@ int shifted_ascii_table[128] =
|
||||
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
|
||||
255,255,255,255,255,255,255,255 };
|
||||
|
||||
// used to limit the keypresses that are accepted from the keyboard
|
||||
#define MAX_FILTER_KEYS 64
|
||||
int Num_filter_keys;
|
||||
int Key_filter[MAX_FILTER_KEYS];
|
||||
|
||||
static int Key_numlock_was_on = 0; // Flag to indicate whether NumLock is on at start
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -729,13 +724,13 @@ void key_mark( uint code, int state, uint latency )
|
||||
scancode = code & (NUM_KEYS-1);
|
||||
breakbit = !state;
|
||||
|
||||
if (breakbit) {
|
||||
if (breakbit) {
|
||||
// Key going up
|
||||
keyd_last_released = scancode;
|
||||
keyd_pressed[scancode] = 0;
|
||||
key_data.NumUps[scancode]++;
|
||||
|
||||
// What is the point of this code? "temp" is never used!
|
||||
// What is the point of this code? "temp" is never used!
|
||||
temp = 0;
|
||||
temp |= keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT];
|
||||
temp |= keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT];
|
||||
@@ -743,20 +738,25 @@ void key_mark( uint code, int state, uint latency )
|
||||
//#ifndef NDEBUG
|
||||
temp |= keyd_pressed[KEY_DEBUG_KEY];
|
||||
//#endif
|
||||
if (event_time < key_data.TimeKeyWentDown[scancode])
|
||||
if (event_time < key_data.TimeKeyWentDown[scancode]) {
|
||||
key_data.TimeKeyHeldDown[scancode] = 0;
|
||||
else
|
||||
} else {
|
||||
key_data.TimeKeyHeldDown[scancode] += event_time - key_data.TimeKeyWentDown[scancode];
|
||||
)
|
||||
|
||||
Current_key_down = scancode;
|
||||
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] )
|
||||
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) {
|
||||
Current_key_down |= KEY_SHIFTED;
|
||||
}
|
||||
|
||||
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] )
|
||||
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) {
|
||||
Current_key_down |= KEY_ALTED;
|
||||
}
|
||||
|
||||
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] )
|
||||
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) {
|
||||
Current_key_down |= KEY_CTRLED;
|
||||
}
|
||||
|
||||
Script_system.SetHookVar("Key", 's', textify_scancode(Current_key_down));
|
||||
Script_system.RunCondition(CHA_KEYRELEASED);
|
||||
Script_system.RemHookVar("Key");
|
||||
@@ -764,7 +764,7 @@ void key_mark( uint code, int state, uint latency )
|
||||
// Key going down
|
||||
keyd_last_pressed = scancode;
|
||||
keyd_time_when_last_pressed = event_time;
|
||||
if (!keyd_pressed[scancode]) {
|
||||
if (!keyd_pressed[scancode]) {
|
||||
// First time down
|
||||
key_data.TimeKeyWentDown[scancode] = event_time;
|
||||
keyd_pressed[scancode] = 1;
|
||||
@@ -773,14 +773,18 @@ void key_mark( uint code, int state, uint latency )
|
||||
|
||||
//WMC - For scripting
|
||||
Current_key_down = scancode;
|
||||
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] )
|
||||
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) {
|
||||
Current_key_down |= KEY_SHIFTED;
|
||||
}
|
||||
|
||||
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] )
|
||||
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) {
|
||||
Current_key_down |= KEY_ALTED;
|
||||
}
|
||||
|
||||
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] )
|
||||
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) {
|
||||
Current_key_down |= KEY_CTRLED;
|
||||
}
|
||||
|
||||
Script_system.SetHookVar("Key", 's', textify_scancode(Current_key_down));
|
||||
Script_system.RunCondition(CHA_KEYPRESSED);
|
||||
Script_system.RemHookVar("Key");
|
||||
@@ -792,18 +796,22 @@ void key_mark( uint code, int state, uint latency )
|
||||
if ( scancode!=0xAA ) {
|
||||
keycode = (unsigned short)scancode;
|
||||
|
||||
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] )
|
||||
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) {
|
||||
keycode |= KEY_SHIFTED;
|
||||
}
|
||||
|
||||
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] )
|
||||
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) {
|
||||
keycode |= KEY_ALTED;
|
||||
}
|
||||
|
||||
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] )
|
||||
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) {
|
||||
keycode |= KEY_CTRLED;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
if ( keyd_pressed[KEY_DEBUG_KEY] )
|
||||
if ( keyd_pressed[KEY_DEBUG_KEY] ) {
|
||||
keycode |= KEY_DEBUGGED;
|
||||
}
|
||||
#else
|
||||
if ( keyd_pressed[KEY_DEBUG_KEY] ) {
|
||||
mprintf(("Cheats_enabled = %i, Key_normal_game = %i\n", Cheats_enabled, Key_normal_game));
|
||||
@@ -814,33 +822,20 @@ void key_mark( uint code, int state, uint latency )
|
||||
|
||||
#endif
|
||||
|
||||
if ( keycode ) {
|
||||
if ( keycode ) {
|
||||
temp = key_data.keytail+1;
|
||||
if ( temp >= KEY_BUFFER_SIZE ) temp=0;
|
||||
|
||||
if (temp!=key_data.keyhead) {
|
||||
int i, accept_key = 1;
|
||||
// Num_filter_keys will only be non-zero when a key filter has
|
||||
// been explicity set up via key_set_filter()
|
||||
for ( i = 0; i < Num_filter_keys; i++ ) {
|
||||
accept_key = 0;
|
||||
if ( Key_filter[i] == keycode ) {
|
||||
accept_key = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( accept_key ) {
|
||||
key_data.keybuffer[key_data.keytail] = keycode;
|
||||
key_data.time_pressed[key_data.keytail] = keyd_time_when_last_pressed;
|
||||
key_data.keytail = temp;
|
||||
}
|
||||
if (temp!=key_data.keyhead) {
|
||||
key_data.keybuffer[key_data.keytail] = keycode;
|
||||
key_data.time_pressed[key_data.keytail] = keyd_time_when_last_pressed;
|
||||
key_data.keytail = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LEAVE_CRITICAL_SECTION( key_lock );
|
||||
LEAVE_CRITICAL_SECTION( key_lock );
|
||||
}
|
||||
|
||||
#ifdef USE_DIRECTINPUT
|
||||
@@ -888,9 +883,6 @@ void key_init()
|
||||
// Clear the keyboard array
|
||||
key_flush();
|
||||
|
||||
// Clear key filter
|
||||
key_clear_filter();
|
||||
|
||||
LEAVE_CRITICAL_SECTION( key_lock );
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -937,40 +929,6 @@ void key_got_focus()
|
||||
key_flush();
|
||||
}
|
||||
|
||||
// Restricts the keys that are accepted from the keyboard
|
||||
//
|
||||
// filter_array => array of keys to act as a filter
|
||||
// num => number of keys in filter_array
|
||||
//
|
||||
void key_set_filter(int *filter_array, int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( num >= MAX_FILTER_KEYS ) {
|
||||
Int3();
|
||||
num = MAX_FILTER_KEYS;
|
||||
}
|
||||
|
||||
Num_filter_keys = num;
|
||||
|
||||
for ( i = 0; i < num; i++ ) {
|
||||
Key_filter[i] = filter_array[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the key filter, so all keypresses are accepted from keyboard
|
||||
//
|
||||
void key_clear_filter()
|
||||
{
|
||||
int i;
|
||||
|
||||
Num_filter_keys = 0;
|
||||
for ( i = 0; i < MAX_FILTER_KEYS; i++ ) {
|
||||
Key_filter[i] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_DIRECTINPUT
|
||||
|
||||
// JAS - April 18, 1998
|
||||
|
||||
+8
-12
@@ -56,21 +56,17 @@ int key_check(int key);
|
||||
// Put "key" back in the input buffer.
|
||||
void key_outkey(int key);
|
||||
|
||||
// used to restrict keys that are read into keyboard buffer
|
||||
void key_set_filter(int *filter_array, int num);
|
||||
void key_clear_filter();
|
||||
|
||||
extern int Cheats_enabled;
|
||||
extern int Key_normal_game;
|
||||
|
||||
#define KEY_SHIFTED 0x1000
|
||||
#define KEY_ALTED 0x2000
|
||||
#define KEY_CTRLED 0x4000
|
||||
#define KEY_DEBUGGED 0x8000
|
||||
#define KEY_DEBUGGED1 0x0800 // Cheat bit in release version of game.
|
||||
#define KEY_MASK 0x00FF
|
||||
#define KEY_DEBUGGED 0x8000
|
||||
#define KEY_DEBUGGED1 0x0800 // Cheat bit in release version of game.
|
||||
#define KEY_MASK 0x00FF
|
||||
|
||||
#define KEY_DEBUG_KEY 0x29 // KEY_LAPOSTRO (shifted = tilde, near upper-left of keyboard)
|
||||
#define KEY_DEBUG_KEY 0x29 // KEY_LAPOSTRO (shifted = tilde, near upper-left of keyboard)
|
||||
|
||||
#define KEY_0 0x0B
|
||||
#define KEY_1 0x02
|
||||
@@ -114,7 +110,7 @@ extern int Key_normal_game;
|
||||
#define KEY_EQUAL 0x0D
|
||||
#define KEY_DIVIDE 0x35
|
||||
#define KEY_SLASH 0x2B
|
||||
#define KEY_SLASH_UK 0x56
|
||||
#define KEY_SLASH_UK 0x56
|
||||
#define KEY_COMMA 0x33
|
||||
#define KEY_PERIOD 0x34
|
||||
#define KEY_SEMICOL 0x27
|
||||
@@ -185,9 +181,9 @@ extern int Key_normal_game;
|
||||
#define KEY_LEFT 0xCB
|
||||
#define KEY_RIGHT 0xCD
|
||||
|
||||
#define KEY_PRINT_SCRN 0xB7
|
||||
#define KEY_PAUSE 0x45 //DOS: 0x61
|
||||
#define KEY_BREAK 0xc6
|
||||
#define KEY_PRINT_SCRN 0xB7
|
||||
#define KEY_PAUSE 0x45 //DOS: 0x61
|
||||
#define KEY_BREAK 0xc6
|
||||
|
||||
/*
|
||||
#ifdef __cplusplus
|
||||
|
||||
+454
-419
File diff suppressed because it is too large.
Load diff
@@ -30,6 +30,8 @@
|
||||
( (v)->xyz.y > -1e-36 ) && ( (v)->xyz.y < 1e-36 ) && \
|
||||
( (v)->xyz.z > -1e-36 ) && ( (v)->xyz.z < 1e-36 ) )
|
||||
|
||||
#define IS_MAT_NULL(v) (IS_VEC_NULL(&(v)->vec.fvec) && IS_VEC_NULL(&(v)->vec.uvec) && IS_VEC_NULL(&(v)->vec.rvec))
|
||||
|
||||
//macro to set a vector to zero. we could do this with an in-line assembly
|
||||
//macro, but it's probably better to let the compiler optimize it.
|
||||
//Note: NO RETURN VALUE
|
||||
|
||||
+59
-129
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "menuui/barracks.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "ui/ui.h"
|
||||
#include "graphics/font.h"
|
||||
#include "io/key.h"
|
||||
@@ -36,7 +37,7 @@
|
||||
|
||||
|
||||
//Returns 0 on failure, 1 on success
|
||||
int delete_pilot_file( char *pilot_name, int single ); // manage_pilot.cpp
|
||||
int delete_pilot_file( char *pilot_name ); // manage_pilot.cpp
|
||||
|
||||
// stats defines
|
||||
//#define NUM_STAT_LINES (21 + MAX_SHIP_CLASSES) // Goober5000
|
||||
@@ -270,7 +271,7 @@ static int Num_stat_lines;
|
||||
static char (*Stat_labels)[STAT_COLUMN1_W];
|
||||
static char (*Stats)[STAT_COLUMN2_W];
|
||||
|
||||
extern int Player_sel_mode;
|
||||
static int Player_sel_mode;
|
||||
|
||||
static player *Cur_pilot;
|
||||
static int Num_pilots;
|
||||
@@ -511,8 +512,7 @@ int barracks_new_pilot_selected()
|
||||
|
||||
// save the previous pilot first, so changes to it are kept
|
||||
if (strlen(Cur_pilot->callsign)) {
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
Pilot.save_player(Cur_pilot);
|
||||
}
|
||||
|
||||
// check if we have a valid pilot hilighted. If so, attempt to active it
|
||||
@@ -521,27 +521,11 @@ int barracks_new_pilot_selected()
|
||||
return -1;
|
||||
}
|
||||
|
||||
// check to see if we are going to try and upgrade or not
|
||||
if ( pilot_file_upgrade_check(Pilots[Selected_line], !Player_sel_mode) )
|
||||
return -1;
|
||||
|
||||
if (read_pilot_file(Pilots[Selected_line], !Player_sel_mode, Cur_pilot)) {
|
||||
if ( !Pilot.load_player(Pilots[Selected_line], Cur_pilot) ) {
|
||||
Cur_pilot->callsign[0] = 0; // this indicates no pilot active
|
||||
return -1;
|
||||
} else {
|
||||
// we need to load up the current campaign file now so we can get at the stats - taylor
|
||||
// had to change this to import the values to a specific player rather than global
|
||||
if (Player_sel_mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
mission_load_up_campaign(Cur_pilot);
|
||||
|
||||
/* if (Campaign_file_missing) {
|
||||
// error popup for a missing campaign file, abort loading of pilot in this case
|
||||
// TODO: need to handle reading of info without the risk of saving improper data later
|
||||
popup( PF_NO_NETWORKING, 1, POPUP_OK, XSTR( "The currently active campaign for this pilot cannot be found. Unable to safely open pilot.", -1));
|
||||
Cur_pilot->callsign[0] = 0; // this indicates no pilot active
|
||||
return -1;
|
||||
} */
|
||||
}
|
||||
Pilot.load_savefile(Cur_pilot->current_campaign);
|
||||
}
|
||||
|
||||
// init stuff to reflect new pilot
|
||||
@@ -602,8 +586,7 @@ void barracks_create_new_pilot()
|
||||
|
||||
// only write pilot file if there is an active pilot
|
||||
if (strlen(Player->callsign)) {
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
Pilot.save_player(Player);
|
||||
}
|
||||
|
||||
// move other pilot names and ranks down to make room for the new one
|
||||
@@ -633,8 +616,6 @@ void barracks_create_new_pilot()
|
||||
// exiting screen without canceling, so load in the new pilot selected here
|
||||
int barracks_pilot_accepted()
|
||||
{
|
||||
char str[CALLSIGN_LEN + 1];
|
||||
|
||||
// check if pilot active. If not, don't allow accept.
|
||||
if (!Cur_pilot->callsign[0]){
|
||||
return -1;
|
||||
@@ -647,14 +628,10 @@ int barracks_pilot_accepted()
|
||||
|
||||
// MWA -- I think that we should be writing Cur_pilot here.
|
||||
//write_pilot_file(!is_pilot_multi(Cur_pilot));
|
||||
write_pilot_file( Cur_pilot );
|
||||
|
||||
// when we store the LastPlayer key, we have to mark it as being single or multiplayer, so we know where to look for him
|
||||
// (since we could have a single and a multiplayer pilot with the same callsign)
|
||||
// we'll distinguish them by putting an M and the end of the multiplayer callsign and a P at the end of a single player
|
||||
strcpy_s(str, Cur_pilot->callsign);
|
||||
strcat_s(str, is_pilot_multi(Cur_pilot) ? NOX("M") : NOX("S"));
|
||||
os_config_write_string( NULL, "LastPlayer", str );
|
||||
Pilot.save_player(Cur_pilot);
|
||||
|
||||
os_config_write_string(NULL, "LastPlayer", Cur_pilot->callsign);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -821,6 +798,14 @@ void barracks_delete_pilot()
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player_sel_mode == PLAYER_SELECT_MODE_MULTI) {
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
popup(PF_TITLE_BIG | PF_TITLE_RED | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Disabled!\n\nMulti and single player pilots are now identical. "
|
||||
"Deleting a multi-player pilot will also delete all single-player data for that pilot.\n\nAs a safety precaution, pilots can only be "
|
||||
"deleted from the single-player menu.", -1));
|
||||
return;
|
||||
}
|
||||
|
||||
int popup_rval = popup(PF_TITLE_BIG | PF_TITLE_RED, 2, POPUP_NO, POPUP_YES, XSTR( "Warning!\n\nAre you sure you wish to delete this pilot?", 65));
|
||||
if (popup_rval != 1) {
|
||||
return;
|
||||
@@ -832,7 +817,7 @@ void barracks_delete_pilot()
|
||||
|
||||
strcpy_s(buf, Pilots[Selected_line]);
|
||||
|
||||
del_rval = delete_pilot_file(buf, (Player_sel_mode == PLAYER_SELECT_MODE_SINGLE) ? 1 : 0);
|
||||
del_rval = delete_pilot_file(buf);
|
||||
|
||||
if ( !del_rval ) {
|
||||
popup(PF_USE_AFFIRMATIVE_ICON | PF_TITLE_BIG | PF_TITLE_RED, 1, POPUP_OK, XSTR("Error\nFailed to delete pilot file. File may be read-only.", -1));
|
||||
@@ -867,17 +852,19 @@ void barracks_delete_pilot()
|
||||
// Filter out pilots of wrong type (which shouldn't be in the directory we are checking, but just to be safe..)
|
||||
int barracks_pilot_filter(char *filename)
|
||||
{
|
||||
int r, rank;
|
||||
bool r = false;
|
||||
int rank = 0;
|
||||
|
||||
r = Pilot.verify(filename, &rank);
|
||||
|
||||
r = verify_pilot_file(filename, Player_sel_mode == PLAYER_SELECT_MODE_SINGLE, &rank);
|
||||
if (rank >= Rank_pips_count)
|
||||
rank = Rank_pips_count - 1;
|
||||
|
||||
if (!r) {
|
||||
if (r) {
|
||||
Pilot_ranks[Num_pilots++] = rank;
|
||||
}
|
||||
|
||||
return !r;
|
||||
return (int)r;
|
||||
}
|
||||
|
||||
// callback handler for the squadon selection buttons when they are disabled (in single player)
|
||||
@@ -899,32 +886,13 @@ void barracks_init_player_stuff(int mode)
|
||||
Num_pilots = 0;
|
||||
Get_file_list_filter = barracks_pilot_filter;
|
||||
|
||||
Num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
// single player specific stuff
|
||||
if (mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
int old_pilot_num = 0;
|
||||
int new_pilot_num = 0;
|
||||
char old_pilots_arr[MAX_PILOTS][MAX_FILENAME_LEN];
|
||||
char *old_pilots[MAX_PILOTS];
|
||||
|
||||
Game_mode &= ~GM_MULTIPLAYER;
|
||||
Game_mode |= GM_NORMAL;
|
||||
|
||||
Num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_SINGLE_PLAYERS, NOX("*.pl2"), CF_SORT_TIME);
|
||||
old_pilot_num = cf_get_file_list_preallocated(MAX_PILOTS, old_pilots_arr, old_pilots, CF_TYPE_SINGLE_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
new_pilot_num = MIN((Num_pilots + old_pilot_num), MAX_PILOTS);
|
||||
|
||||
for (i = Num_pilots; i<new_pilot_num;) {
|
||||
for (j = 0; j<old_pilot_num; j++) {
|
||||
if ( i >= MAX_PILOTS )
|
||||
break;
|
||||
|
||||
strcpy( Pilots[i], old_pilots[j] );
|
||||
Num_pilots++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// disable squad logo switching
|
||||
Buttons[gr_screen.res][B_SQUAD_PREV_BUTTON].button.hide();
|
||||
Buttons[gr_screen.res][B_SQUAD_PREV_BUTTON].button.disable();
|
||||
@@ -934,12 +902,10 @@ void barracks_init_player_stuff(int mode)
|
||||
Buttons[gr_screen.res][B_SQUAD_NEXT_BUTTON].button.set_disabled_action(barracks_squad_change_popup);
|
||||
}
|
||||
// multiplayer specific stuff
|
||||
else {
|
||||
else if (mode == PLAYER_SELECT_MODE_MULTI) {
|
||||
Game_mode &= ~GM_NORMAL;
|
||||
Game_mode |= GM_MULTIPLAYER;
|
||||
|
||||
Num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_MULTI_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
// enable squad logo switching
|
||||
Buttons[gr_screen.res][B_SQUAD_PREV_BUTTON].button.enable();
|
||||
Buttons[gr_screen.res][B_SQUAD_PREV_BUTTON].button.unhide();
|
||||
@@ -1008,14 +974,8 @@ void barracks_button_pressed(int n)
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
|
||||
// if it's just the missing campaign file that failed for us then don't give the second popup
|
||||
if (Campaign_file_missing)
|
||||
if (Campaign_file_missing) {
|
||||
break;
|
||||
|
||||
// throw up a popup telling the player that he should create a pilot first
|
||||
if(Player_sel_mode == PLAYER_SELECT_MODE_SINGLE){
|
||||
popup(PF_USE_AFFIRMATIVE_ICON,1,POPUP_OK,XSTR( "You must create a single player pilot.", 66));
|
||||
} else {
|
||||
popup(PF_USE_AFFIRMATIVE_ICON,1,POPUP_OK,XSTR( "You must create a multi player pilot.", 67));
|
||||
}
|
||||
} else {
|
||||
gamesnd_play_iface(SND_SCROLL);
|
||||
@@ -1041,14 +1001,8 @@ void barracks_button_pressed(int n)
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
|
||||
// if it's just the missing campaign file that failed for us then don't give the second popup
|
||||
if (Campaign_file_missing)
|
||||
if (Campaign_file_missing) {
|
||||
break;
|
||||
|
||||
// throw up a popup telling the player that he should create a pilot first
|
||||
if(Player_sel_mode == PLAYER_SELECT_MODE_SINGLE){
|
||||
popup(PF_USE_AFFIRMATIVE_ICON,1,POPUP_OK,XSTR( "You must create a single player pilot.", 66));
|
||||
} else {
|
||||
popup(PF_USE_AFFIRMATIVE_ICON,1,POPUP_OK,XSTR( "You must create a multi player pilot.", 67));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1064,52 +1018,22 @@ void barracks_button_pressed(int n)
|
||||
break;
|
||||
|
||||
case B_PILOT_CONVERT_BUTTON: {
|
||||
char temp[256], *str;
|
||||
char old_pic[256] = "";
|
||||
char old_squad_pic[256] = "";
|
||||
char old_squad[256] = "";
|
||||
int z;
|
||||
|
||||
if (!barracks_new_pilot_selected()) {
|
||||
if (Player_sel_mode == PLAYER_SELECT_MODE_SINGLE)
|
||||
str = XSTR( "multiplayer", 68);
|
||||
else
|
||||
str = XSTR( "single player", 69);
|
||||
|
||||
sprintf(temp, XSTR( "This will overwrite your %s pilot. Proceed?", 70), str);
|
||||
if (!verify_pilot_file(Cur_pilot->callsign, Player_sel_mode == PLAYER_SELECT_MODE_MULTI)) {
|
||||
z = popup(0, 2, POPUP_CANCEL, POPUP_OK, temp);
|
||||
if (z != 1)
|
||||
break;
|
||||
}
|
||||
|
||||
strcpy_s(old_pic, Cur_pilot->image_filename);
|
||||
strcpy_s(old_squad_pic, Cur_pilot->squad_filename);
|
||||
strcpy_s(old_squad, Cur_pilot->squad_name);
|
||||
init_new_pilot(Cur_pilot, 0);
|
||||
strcpy_s(Cur_pilot->image_filename, old_pic);
|
||||
strcpy_s(Cur_pilot->squad_filename, old_squad_pic);
|
||||
strcpy_s(Cur_pilot->squad_name, old_squad);
|
||||
if (Player_sel_mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
Cur_pilot->flags |= PLAYER_FLAGS_IS_MULTI;
|
||||
write_pilot_file();
|
||||
barracks_init_player_stuff(PLAYER_SELECT_MODE_MULTI);
|
||||
|
||||
} else {
|
||||
// make sure we don't carry over the multi flag
|
||||
if (Cur_pilot->flags & PLAYER_FLAGS_IS_MULTI)
|
||||
Cur_pilot->flags &= ~PLAYER_FLAGS_IS_MULTI;
|
||||
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
barracks_init_player_stuff(PLAYER_SELECT_MODE_SINGLE);
|
||||
}
|
||||
|
||||
gamesnd_play_iface(SND_USER_SELECT);
|
||||
|
||||
/* New Pilot code no longer needs a conversion function. */
|
||||
popup(PF_TITLE_BIG | PF_TITLE_BLUE | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK,
|
||||
XSTR("Disabled!\n\n\nMulti and Single Player Pilot files are now identical.\n\n"
|
||||
"Conversion between the two is no longer necessary.", -1));
|
||||
/* // no actual conversion with new pilot code
|
||||
if (Player_sel_mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
barracks_init_player_stuff(PLAYER_SELECT_MODE_MULTI);
|
||||
} else {
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
// make sure we don't carry over the multi flag
|
||||
if (Cur_pilot->flags & PLAYER_FLAGS_IS_MULTI) {
|
||||
Cur_pilot->flags &= ~PLAYER_FLAGS_IS_MULTI;
|
||||
}
|
||||
barracks_init_player_stuff(PLAYER_SELECT_MODE_SINGLE);
|
||||
}
|
||||
|
||||
gamesnd_play_iface(SND_USER_SELECT); */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1140,8 +1064,13 @@ void barracks_button_pressed(int n)
|
||||
case B_PILOT_SINGLE_MODE_BUTTON:
|
||||
if (Player_sel_mode != PLAYER_SELECT_MODE_SINGLE) {
|
||||
gamesnd_play_iface(SND_USER_SELECT);
|
||||
// make sure we don't carry over the multi flag
|
||||
if (Cur_pilot->flags & PLAYER_FLAGS_IS_MULTI) {
|
||||
Cur_pilot->flags &= ~PLAYER_FLAGS_IS_MULTI;
|
||||
}
|
||||
Pilot.save_player(Cur_pilot);
|
||||
barracks_init_player_stuff(PLAYER_SELECT_MODE_SINGLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case B_PILOT_MULTI_MODE_BUTTON:
|
||||
@@ -1152,6 +1081,8 @@ void barracks_button_pressed(int n)
|
||||
|
||||
if (Player_sel_mode != PLAYER_SELECT_MODE_MULTI) {
|
||||
gamesnd_play_iface(SND_USER_SELECT);
|
||||
Cur_pilot->flags |= PLAYER_FLAGS_IS_MULTI;
|
||||
Pilot.save_player(Cur_pilot);
|
||||
barracks_init_player_stuff(PLAYER_SELECT_MODE_MULTI);
|
||||
}
|
||||
break;
|
||||
@@ -1174,7 +1105,7 @@ void barracks_display_pilot_callsigns(int prospective_pilot)
|
||||
if (cur_pilot_idx >= Num_pilots)
|
||||
break;
|
||||
|
||||
if (!stricmp(Cur_pilot->callsign, Pilots[cur_pilot_idx]) && (is_pilot_multi(Cur_pilot) == multi)) {
|
||||
if (!stricmp(Cur_pilot->callsign, Pilots[cur_pilot_idx]) && multi) {
|
||||
gr_set_color_fast(&Color_text_active);
|
||||
} else {
|
||||
if (cur_pilot_idx == Selected_line) {
|
||||
@@ -1269,7 +1200,7 @@ void barracks_accept_new_pilot_callsign()
|
||||
}
|
||||
|
||||
Num_pilots--;
|
||||
delete_pilot_file(name, Player_sel_mode == PLAYER_SELECT_MODE_SINGLE ? 1 : 0);
|
||||
delete_pilot_file(name);
|
||||
z = 0;
|
||||
}
|
||||
return;
|
||||
@@ -1299,7 +1230,7 @@ void barracks_accept_new_pilot_callsign()
|
||||
}
|
||||
|
||||
if ( !(Game_mode & GM_STANDALONE_SERVER) ) {
|
||||
write_pilot_file(Cur_pilot);
|
||||
Pilot.save_player(Cur_pilot);
|
||||
}
|
||||
|
||||
Selected_line = 0;
|
||||
@@ -1367,8 +1298,7 @@ void barracks_init()
|
||||
UI_WINDOW *w = &Ui_window;
|
||||
|
||||
// save current pilot file, so we don't possibly loose it.
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
Pilot.save_player();
|
||||
|
||||
// create interface
|
||||
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
|
||||
@@ -1408,7 +1338,7 @@ void barracks_init()
|
||||
w->add_XSTR("Clone", 1040, Buttons[gr_screen.res][13].text_x, Buttons[gr_screen.res][13].text_y, &Buttons[gr_screen.res][13].button, UI_XSTR_COLOR_GREEN);
|
||||
w->add_XSTR("Single", 1041, Buttons[gr_screen.res][14].text_x, Buttons[gr_screen.res][14].text_y, &Buttons[gr_screen.res][14].button, UI_XSTR_COLOR_GREEN);
|
||||
w->add_XSTR("Multi", 1042, Buttons[gr_screen.res][15].text_x, Buttons[gr_screen.res][15].text_y, &Buttons[gr_screen.res][15].button, UI_XSTR_COLOR_GREEN);
|
||||
w->add_XSTR("Convert",1043, Buttons[gr_screen.res][16].text_x, Buttons[gr_screen.res][16].text_y, &Buttons[gr_screen.res][16].button, UI_XSTR_COLOR_GREEN);
|
||||
// w->add_XSTR("Convert",1043, Buttons[gr_screen.res][16].text_x, Buttons[gr_screen.res][16].text_y, &Buttons[gr_screen.res][16].button, UI_XSTR_COLOR_GREEN);
|
||||
for(i=0; i<BARRACKS_NUM_TEXT; i++) {
|
||||
w->add_XSTR(&Barracks_text[gr_screen.res][i]);
|
||||
}
|
||||
@@ -1467,7 +1397,7 @@ void barracks_init()
|
||||
barracks_init_stats(&Cur_pilot->stats);
|
||||
|
||||
// base the mode we're in (single or multi) on the status of the currently selected pilot
|
||||
barracks_init_player_stuff(is_pilot_multi(Player));
|
||||
barracks_init_player_stuff((Game_mode & GM_MULTIPLAYER) == GM_MULTIPLAYER);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
+456
-464
File diff suppressed because it is too large.
Load diff
+113
-7
@@ -7,18 +7,116 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#ifndef _MAIN_HALL_MENU_HEADER_FILE
|
||||
#define _MAIN_HALL_MENU_HEADER_FILE
|
||||
|
||||
// the # of main halls we're supporting
|
||||
#define MAIN_HALLS_MAX 10 // Goober5000 - bumped down to 10; don't go above 256 (size of ubyte)
|
||||
|
||||
void main_hall_init(int main_hall_num);
|
||||
// CommanderDJ - this is now dynamic
|
||||
// #define MAIN_HALLS_MAX 10
|
||||
|
||||
// read in mainhall.tbl
|
||||
void main_hall_read_table();
|
||||
typedef struct main_hall_defines {
|
||||
// mainhall name identifier
|
||||
SCP_string name;
|
||||
|
||||
// bitmap and mask
|
||||
SCP_string bitmap;
|
||||
SCP_string mask;
|
||||
|
||||
// music
|
||||
SCP_string music_name;
|
||||
SCP_string substitute_music_name;
|
||||
|
||||
// intercom defines -------------------
|
||||
|
||||
// # of intercom sounds
|
||||
int num_random_intercom_sounds;
|
||||
|
||||
// random (min/max) delays between playing intercom sounds
|
||||
SCP_vector<SCP_vector<int> > intercom_delay;
|
||||
|
||||
// intercom sounds themselves
|
||||
SCP_vector<int> intercom_sounds;
|
||||
|
||||
// intercom sound pan values
|
||||
SCP_vector<float> intercom_sound_pan;
|
||||
|
||||
|
||||
// misc animations --------------------
|
||||
|
||||
// # of misc animations
|
||||
int num_misc_animations;
|
||||
|
||||
// filenames of the misc animations
|
||||
SCP_vector<SCP_string> misc_anim_name;
|
||||
|
||||
// Time until we will next play a given misc animation, min delay, and max delay
|
||||
SCP_vector<SCP_vector<int> > misc_anim_delay;
|
||||
|
||||
// Goober5000, used in preference to the flag in generic_anim
|
||||
SCP_vector<int> misc_anim_paused;
|
||||
|
||||
// Goober5000, used when we want to play one of several anims
|
||||
SCP_vector<int> misc_anim_group;
|
||||
|
||||
// coords of where to play the misc anim
|
||||
SCP_vector<SCP_vector<int> > misc_anim_coords;
|
||||
|
||||
// misc anim play modes (see MISC_ANIM_MODE_* above)
|
||||
SCP_vector<int> misc_anim_modes;
|
||||
|
||||
// panning values for each of the misc anims
|
||||
SCP_vector<float> misc_anim_sound_pan;
|
||||
|
||||
//sounds for each of the misc anims
|
||||
SCP_vector<SCP_vector<int> > misc_anim_special_sounds;
|
||||
|
||||
//frame number triggers for each of the misc anims
|
||||
SCP_vector<SCP_vector<int> > misc_anim_special_trigger;
|
||||
|
||||
//flags for each of the misc anim sounds
|
||||
SCP_vector<SCP_vector<int> > misc_anim_sound_flag;
|
||||
|
||||
|
||||
// door animations --------------------
|
||||
|
||||
// # of door animations
|
||||
int num_door_animations;
|
||||
|
||||
// filenames of the door animations
|
||||
SCP_vector<SCP_string> door_anim_name;
|
||||
|
||||
// first pair : coords of where to play a given door anim
|
||||
// second pair : center of a given door anim in windowed mode
|
||||
SCP_vector<SCP_vector<int> > door_anim_coords;
|
||||
|
||||
// sounds for each region (open/close)
|
||||
SCP_vector<SCP_vector<int> > door_sounds;
|
||||
|
||||
// pan values for the door sounds
|
||||
SCP_vector<float> door_sound_pan;
|
||||
|
||||
// region descriptions ----------------
|
||||
|
||||
// text (tooltip) description
|
||||
SCP_vector<char*> region_descript;
|
||||
|
||||
// y coord of where to draw tooltip text
|
||||
int region_yval;
|
||||
|
||||
} main_hall_defines;
|
||||
|
||||
extern SCP_vector<SCP_vector<main_hall_defines> > Main_hall_defines;
|
||||
|
||||
// initialize the main hall proper
|
||||
void main_hall_init(SCP_string main_hall_name);
|
||||
|
||||
// parse mainhall table files
|
||||
void main_hall_table_init();
|
||||
|
||||
// read in mainhall tables
|
||||
void parse_main_hall_table(char* filename);
|
||||
|
||||
// do a frame for the main hall
|
||||
void main_hall_do(float frametime);
|
||||
@@ -35,9 +133,17 @@ void main_hall_stop_music();
|
||||
// get the music index
|
||||
int main_hall_get_music_index(int main_hall_num);
|
||||
|
||||
main_hall_defines* main_hall_get_pointer(SCP_string name_to_find);
|
||||
|
||||
int main_hall_get_index(SCP_string name_to_find);
|
||||
|
||||
SCP_string main_hall_get_name(unsigned int index);
|
||||
|
||||
// what main hall we're on
|
||||
int main_hall_id();
|
||||
|
||||
SCP_string main_hall_name();
|
||||
|
||||
// Vasudan?
|
||||
int main_hall_is_vasudan();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "io/key.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
@@ -1021,8 +1021,6 @@ void options_menu_init()
|
||||
|
||||
Gamma_colors_inited = 0;
|
||||
|
||||
// used to allow all keystrokes, even when called from a demo playback
|
||||
key_clear_filter();
|
||||
Options_menu_inited = 1;
|
||||
|
||||
// hide options crap
|
||||
@@ -1053,7 +1051,8 @@ void options_menu_close()
|
||||
|
||||
Ui_window.destroy();
|
||||
common_free_interface_palette(); // restore game palette
|
||||
write_pilot_file();
|
||||
Pilot.save_player();
|
||||
Pilot.save_savefile();
|
||||
game_flush();
|
||||
|
||||
// unpause all sounds, since we could be headed back to the game
|
||||
|
||||
+66
-111
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "playerman/player.h"
|
||||
#include "io/key.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
@@ -155,7 +156,7 @@ int Player_select_clone_flag; // clone the currently selected pilot
|
||||
char Player_select_last_pilot[CALLSIGN_LEN + 10]; // callsign of the last used pilot, or none if there wasn't one
|
||||
int Player_select_last_is_multi;
|
||||
|
||||
int Player_select_force_main_hall = -1;
|
||||
SCP_string Player_select_force_main_hall = "";
|
||||
|
||||
static int Player_select_no_save_pilot = 0; // to skip save of pilot in pilot_select_close()
|
||||
|
||||
@@ -200,16 +201,8 @@ void player_select_eval_very_first_pilot();
|
||||
void player_select_commit();
|
||||
void player_select_cancel_create();
|
||||
|
||||
extern int delete_pilot_file(char *pilot_name, int single);
|
||||
extern int delete_pilot_file(char *pilot_name);
|
||||
|
||||
/**
|
||||
* Sets Player values to 0/NULL/whatever appropriate default value
|
||||
*/
|
||||
void zero_player() {
|
||||
player *tmp_Player = new player();
|
||||
memcpy(Player,tmp_Player,sizeof(player));
|
||||
delete tmp_Player;
|
||||
}
|
||||
|
||||
// basically, gray out all controls (gray == 1), or ungray the controls (gray == 0)
|
||||
void player_select_set_controls(int gray)
|
||||
@@ -235,7 +228,7 @@ void player_select_init()
|
||||
// start a looping ambient sound
|
||||
main_hall_start_ambient();
|
||||
|
||||
Player_select_force_main_hall = -1;
|
||||
Player_select_force_main_hall = "";
|
||||
|
||||
Player_select_screen_active = 1;
|
||||
|
||||
@@ -466,18 +459,29 @@ void player_select_close()
|
||||
Player = &Players[0];
|
||||
Player->flags |= PLAYER_FLAGS_STRUCTURE_IN_USE;
|
||||
|
||||
// New pilot file makes no distinction between multi pilots and regular ones, so let's do this here.
|
||||
if (Player_select_mode == PLAYER_SELECT_MODE_MULTI) {
|
||||
Player->flags |= PLAYER_FLAGS_IS_MULTI;
|
||||
}
|
||||
|
||||
// WMC - Set appropriate game mode
|
||||
if ( Player->flags & PLAYER_FLAGS_IS_MULTI ) {
|
||||
Game_mode = GM_MULTIPLAYER;
|
||||
} else {
|
||||
Game_mode = GM_NORMAL;
|
||||
}
|
||||
|
||||
// now read in a the pilot data
|
||||
if (read_pilot_file(Pilots[Player_select_pilot], !Player_select_mode, Player) != 0) {
|
||||
if ( !Pilot.load_player(Pilots[Player_select_pilot], Player) ) {
|
||||
Error(LOCATION,"Couldn't load pilot file, bailing");
|
||||
Player = NULL;
|
||||
} else {
|
||||
if (Player_select_mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
mission_load_up_campaign(); // load up campaign savefile - taylor
|
||||
}
|
||||
// NOTE: this may fail if there is no current campaign, it's not fatal
|
||||
Pilot.load_savefile(Player->current_campaign);
|
||||
}
|
||||
|
||||
if (Player_select_force_main_hall >= 0) {
|
||||
Player->main_hall = (ubyte)Player_select_force_main_hall;
|
||||
if (Player_select_force_main_hall != "") {
|
||||
main_hall_init(Player_select_force_main_hall);
|
||||
}
|
||||
|
||||
// free memory from all parsing so far, all tbls found during game_init()
|
||||
@@ -485,13 +489,6 @@ void player_select_close()
|
||||
stop_parse();
|
||||
|
||||
Player_select_screen_active = 0;
|
||||
|
||||
//WMC - Set appropriate game mode
|
||||
if ( Player->flags & PLAYER_FLAGS_IS_MULTI ) {
|
||||
Game_mode = GM_MULTIPLAYER;
|
||||
} else {
|
||||
Game_mode = GM_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
void player_select_set_input_mode(int n)
|
||||
@@ -562,14 +559,10 @@ void player_select_button_pressed(int n)
|
||||
}
|
||||
|
||||
// attempt to read in the pilot file of the guy to be cloned
|
||||
if (read_pilot_file(Pilots[Player_select_pilot], !Player_select_mode, Player) != 0) {
|
||||
if ( !Pilot.load_player(Pilots[Player_select_pilot], Player) ) {
|
||||
Error(LOCATION,"Couldn't load pilot file, bailing");
|
||||
Player = NULL;
|
||||
Int3();
|
||||
} else {
|
||||
if (Player_select_mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
mission_load_up_campaign(); // get campaign file - taylor
|
||||
}
|
||||
}
|
||||
|
||||
// set the clone flag
|
||||
@@ -579,7 +572,7 @@ void player_select_button_pressed(int n)
|
||||
if ( !player_select_create_new_pilot() ) {
|
||||
player_select_set_bottom_text(XSTR( "Error creating new pilot file!", 380));
|
||||
Player_select_clone_flag = 0;
|
||||
zero_player();
|
||||
Player->reset();
|
||||
Player = NULL;
|
||||
break;
|
||||
}
|
||||
@@ -620,12 +613,18 @@ void player_select_button_pressed(int n)
|
||||
player_select_set_bottom_text("");
|
||||
|
||||
if (Player_select_pilot >= 0) {
|
||||
// display a popup requesting confirmation
|
||||
ret = popup(PF_TITLE_BIG | PF_TITLE_RED, 2, POPUP_NO, POPUP_YES, XSTR( "Warning!\n\nAre you sure you wish to delete this pilot?", 382));
|
||||
if (Player_select_mode == PLAYER_SELECT_MODE_MULTI) {
|
||||
popup(PF_TITLE_BIG | PF_TITLE_RED | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Disabled!\n\nMulti and single player pilots are now identical. "
|
||||
"Deleting a multi-player pilot will also delete all single-player data for that pilot.\n\nAs a safety precaution, pilots can only be "
|
||||
"deleted from the single-player menu.", -1));
|
||||
} else {
|
||||
// display a popup requesting confirmation
|
||||
ret = popup(PF_TITLE_BIG | PF_TITLE_RED, 2, POPUP_NO, POPUP_YES, XSTR( "Warning!\n\nAre you sure you wish to delete this pilot?", 382));
|
||||
|
||||
// delete the pilot
|
||||
if (ret == 1) {
|
||||
player_select_delete_pilot();
|
||||
// delete the pilot
|
||||
if (ret == 1) {
|
||||
player_select_delete_pilot();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -726,7 +725,7 @@ void player_select_delete_pilot()
|
||||
// make sure we do this based upon whether we're in single or multiplayer mode
|
||||
strcpy_s( filename, Pilots[Player_select_pilot] );
|
||||
|
||||
del_rval = delete_pilot_file(filename, (Player_select_mode == PLAYER_SELECT_MODE_SINGLE) ? 1 : 0);
|
||||
del_rval = delete_pilot_file(filename);
|
||||
|
||||
if ( !del_rval ) {
|
||||
popup(PF_USE_AFFIRMATIVE_ICON | PF_TITLE_BIG | PF_TITLE_RED, 1, POPUP_OK, XSTR("Error\nFailed to delete pilot file. File may be read-only.", -1));
|
||||
@@ -785,6 +784,8 @@ void player_select_scroll_list_down()
|
||||
// fill in the data on the last played pilot (callsign and is_multi or not)
|
||||
int player_select_get_last_pilot_info()
|
||||
{
|
||||
// TODO: Replace this with a function that does this properly for the new pilot code.
|
||||
|
||||
char *last_player;
|
||||
|
||||
last_player = os_config_read_string( NULL, "LastPlayer", NULL);
|
||||
@@ -795,8 +796,10 @@ int player_select_get_last_pilot_info()
|
||||
strcpy_s(Player_select_last_pilot,last_player);
|
||||
}
|
||||
|
||||
// determine if he was a single or multi-player based upon the last character in his callsign
|
||||
Player_select_last_is_multi = Player_select_last_pilot[strlen(Player_select_last_pilot)-1] == 'M' ? 1 : 0;
|
||||
//// determine if he was a single or multi-player based upon the last character in his callsign
|
||||
// Player_select_last_is_multi = Player_select_last_pilot[strlen(Player_select_last_pilot)-1] == 'M' ? 1 : 0;
|
||||
Player_select_last_is_multi = 0;
|
||||
|
||||
Player_select_last_pilot[strlen(Player_select_last_pilot)-1]='\0';
|
||||
|
||||
return 1;
|
||||
@@ -813,31 +816,8 @@ int player_select_get_last_pilot()
|
||||
}
|
||||
|
||||
Get_file_list_filter = player_select_pilot_file_filter;
|
||||
if (Player_select_last_is_multi) {
|
||||
Player_select_num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_MULTI_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
} else {
|
||||
int i,j, new_pilot_num = 0;
|
||||
int old_pilot_num = 0;
|
||||
char old_pilots_arr[MAX_PILOTS][MAX_FILENAME_LEN];
|
||||
char *old_pilots[MAX_PILOTS];
|
||||
|
||||
Player_select_num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_SINGLE_PLAYERS, NOX("*.pl2"), CF_SORT_TIME);
|
||||
old_pilot_num = cf_get_file_list_preallocated(MAX_PILOTS, old_pilots_arr, old_pilots, CF_TYPE_SINGLE_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
new_pilot_num = MIN((Player_select_num_pilots + old_pilot_num), MAX_PILOTS);
|
||||
|
||||
for (i = Player_select_num_pilots; i<new_pilot_num;) {
|
||||
for (j = 0; j<old_pilot_num; j++) {
|
||||
if ( i >= MAX_PILOTS ) {
|
||||
break;
|
||||
}
|
||||
|
||||
strcpy( Pilots[i], old_pilots[j] );
|
||||
Player_select_num_pilots++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Player_select_num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
Player_select_pilot = -1;
|
||||
idx = 0;
|
||||
@@ -856,10 +836,7 @@ int player_select_get_last_pilot()
|
||||
// if we've actually found a valid pilot, load him up
|
||||
if (Player_select_pilot != -1) {
|
||||
Player = &Players[0];
|
||||
read_pilot_file(Pilots_arr[idx],!Player_select_last_is_multi,Player);
|
||||
if (Player_select_mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
mission_load_up_campaign(); // load up campaign file now - taylor
|
||||
}
|
||||
Pilot.load_player(Pilots_arr[idx], Player);
|
||||
Player->flags |= PLAYER_FLAGS_STRUCTURE_IN_USE;
|
||||
return 1;
|
||||
}
|
||||
@@ -877,31 +854,8 @@ void player_select_init_player_stuff(int mode)
|
||||
|
||||
// load up the list of players based upon the Player_select_mode (single or multiplayer)
|
||||
Get_file_list_filter = player_select_pilot_file_filter;
|
||||
if (mode == PLAYER_SELECT_MODE_SINGLE) {
|
||||
int i,j, new_pilot_num = 0;
|
||||
int old_pilot_num = 0;
|
||||
char old_pilots_arr[MAX_PILOTS][MAX_FILENAME_LEN];
|
||||
char *old_pilots[MAX_PILOTS];
|
||||
|
||||
Player_select_num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_SINGLE_PLAYERS, NOX("*.pl2"), CF_SORT_TIME);
|
||||
old_pilot_num = cf_get_file_list_preallocated(MAX_PILOTS, old_pilots_arr, old_pilots, CF_TYPE_SINGLE_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
new_pilot_num = MIN((Player_select_num_pilots + old_pilot_num), MAX_PILOTS);
|
||||
|
||||
for (i = Player_select_num_pilots; i<new_pilot_num;) {
|
||||
for (j = 0; j<old_pilot_num; j++) {
|
||||
if ( i >= MAX_PILOTS ) {
|
||||
break;
|
||||
}
|
||||
|
||||
strcpy( Pilots[i], old_pilots[j] );
|
||||
Player_select_num_pilots++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Player_select_num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_MULTI_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
}
|
||||
Player_select_num_pilots = cf_get_file_list_preallocated(MAX_PILOTS, Pilots_arr, Pilots, CF_TYPE_PLAYERS, NOX("*.plr"), CF_SORT_TIME);
|
||||
|
||||
Player = NULL;
|
||||
|
||||
@@ -976,12 +930,16 @@ void player_select_process_noninput(int k)
|
||||
if (Player_select_pilot >= 0) {
|
||||
int ret;
|
||||
|
||||
// display a popup requesting confirmation
|
||||
ret = popup(PF_USE_AFFIRMATIVE_ICON | PF_USE_NEGATIVE_ICON,2,POPUP_NO,POPUP_YES,XSTR( "Are you sure you want to delete this pilot?", 383));
|
||||
if (Player_select_mode == PLAYER_SELECT_MODE_MULTI) {
|
||||
popup(PF_TITLE_BIG | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Pilots can only be deleted from the single player menu!", -1));
|
||||
} else {
|
||||
// display a popup requesting confirmation
|
||||
ret = popup(PF_USE_AFFIRMATIVE_ICON | PF_USE_NEGATIVE_ICON,2,POPUP_NO,POPUP_YES,XSTR( "Are you sure you want to delete this pilot?", 383));
|
||||
|
||||
// delete the pilot
|
||||
if (ret == 1) {
|
||||
player_select_delete_pilot();
|
||||
// delete the pilot
|
||||
if (ret == 1) {
|
||||
player_select_delete_pilot();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1074,7 +1032,7 @@ void player_select_process_input(int k)
|
||||
// if this is the first guy, we should set the Player struct
|
||||
if (Player == NULL) {
|
||||
Player = &Players[0];
|
||||
zero_player();
|
||||
Player->reset();
|
||||
Player->flags |= PLAYER_FLAGS_STRUCTURE_IN_USE;
|
||||
}
|
||||
|
||||
@@ -1088,10 +1046,10 @@ void player_select_process_input(int k)
|
||||
}
|
||||
|
||||
// create his pilot file
|
||||
write_pilot_file(Player);
|
||||
Pilot.save_player(Player);
|
||||
|
||||
// unset the player
|
||||
zero_player();
|
||||
Player->reset();
|
||||
Player = NULL;
|
||||
|
||||
// make this guy the selected pilot and put him first on the list
|
||||
@@ -1177,7 +1135,7 @@ void player_select_display_all_text()
|
||||
|
||||
int player_select_pilot_file_filter(char *filename)
|
||||
{
|
||||
return !verify_pilot_file(filename, Player_select_mode == PLAYER_SELECT_MODE_SINGLE);
|
||||
return (int)Pilot.verify(filename);
|
||||
}
|
||||
|
||||
void player_select_set_bottom_text(char *txt)
|
||||
@@ -1219,11 +1177,6 @@ void player_select_commit()
|
||||
// if we've gotten to this point, we should have ensured this was the case
|
||||
Assert(Player_select_num_pilots > 0);
|
||||
|
||||
// check to see if we are going to try and upgrade or not
|
||||
if ( pilot_file_upgrade_check(Pilots[Player_select_pilot], !Player_select_mode) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
gameseq_post_event(GS_EVENT_MAIN_MENU);
|
||||
gamesnd_play_iface(SND_COMMIT_PRESSED);
|
||||
|
||||
@@ -1276,15 +1229,16 @@ DCF(bastion,"Sets the player to be on the bastion (or any other main hall)")
|
||||
if (Dc_arg_type & ARG_INT) {
|
||||
int idx = Dc_arg_int;
|
||||
|
||||
if (idx < 0 || idx >= MAIN_HALLS_MAX) {
|
||||
Assert(Main_hall_defines.at(gr_screen.res).size() < INT_MAX);
|
||||
if (idx < 0 || idx >= (int) Main_hall_defines.at(gr_screen.res).size()) {
|
||||
dc_printf("Main hall index out of range\n");
|
||||
} else {
|
||||
Player_select_force_main_hall = idx;
|
||||
dc_printf("Player is now on main hall #%d\n", idx);
|
||||
Player_select_force_main_hall = main_hall_get_name(idx);
|
||||
dc_printf("Player is now on main hall '%d'\n", Player_select_force_main_hall.c_str());
|
||||
}
|
||||
} else {
|
||||
Player_select_force_main_hall = 1;
|
||||
dc_printf("Player is now on the Bastion\n");
|
||||
Player_select_force_main_hall = "1";
|
||||
dc_printf("Player is now on the Bastion... hopefully\n");
|
||||
}
|
||||
Dc_status = 0;
|
||||
}
|
||||
@@ -1389,7 +1343,8 @@ void player_tips_popup()
|
||||
case 2:
|
||||
ret = 0;
|
||||
Player->tips = 0;
|
||||
write_pilot_file(Player);
|
||||
Pilot.save_player(Player);
|
||||
Pilot.save_savefile();
|
||||
break;
|
||||
}
|
||||
} while(ret > 0);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "freespace2/freespace.h"
|
||||
#include "playerman/player.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "popup/popup.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
@@ -217,7 +218,6 @@ static int list_w1;
|
||||
static int list_w2;
|
||||
static int list_h;
|
||||
static int Background_bitmap;
|
||||
static int Old_main_hall = 0;
|
||||
static UI_WINDOW Ui_window;
|
||||
static UI_BUTTON List_buttons[LIST_BUTTONS_MAX]; // buttons for each line of text in list
|
||||
|
||||
@@ -401,38 +401,6 @@ int sim_room_line_add(int type, char *name, char *filename, int x, int y, int fl
|
||||
return Num_lines++;
|
||||
}
|
||||
|
||||
// filter out all multiplayer campaigns
|
||||
int campaign_room_campaign_filter(char *filename)
|
||||
{
|
||||
Int3();
|
||||
|
||||
return 0;
|
||||
|
||||
// obsolete, moved all of this to global mission_campaign_build_list() - taylor
|
||||
|
||||
/* int type, max_players;
|
||||
char name[NAME_LENGTH], *desc = NULL;
|
||||
|
||||
#ifdef OEM_BUILD
|
||||
// also need to check if this is the builtin campaign
|
||||
if ( game_find_builtin_mission(filename) && mission_campaign_get_info(filename, name, &type, &max_players, &desc) ) {
|
||||
#else
|
||||
if ( mission_campaign_get_info(filename, name, &type, &max_players, &desc) ) {
|
||||
#endif
|
||||
if ( type == CAMPAIGN_TYPE_SINGLE ) {
|
||||
Campaign_file_names_temp[Num_campaigns] = vm_strdup(filename);
|
||||
Campaign_descs_temp[Num_campaigns++] = desc;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (desc){
|
||||
vm_free(desc);
|
||||
}
|
||||
|
||||
return 0;*/
|
||||
}
|
||||
|
||||
// build up a list of all missions in all campaigns.
|
||||
int sim_room_campaign_mission_filter(char *filename)
|
||||
{
|
||||
@@ -1092,6 +1060,8 @@ void sim_room_init()
|
||||
} else {
|
||||
Campaign.filename[0] = 0;
|
||||
Campaign.num_missions = 0;
|
||||
|
||||
mission_campaign_load_failure_popup();
|
||||
}
|
||||
|
||||
Num_campaign_missions = 0;
|
||||
@@ -1188,8 +1158,7 @@ void sim_room_close()
|
||||
|
||||
Ui_window.destroy();
|
||||
common_free_interface_palette(); // restore game palette
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
Pilot.save_player();
|
||||
|
||||
// unload special mission icons
|
||||
sim_room_unload_mission_icons();
|
||||
@@ -1567,6 +1536,8 @@ int campaign_room_reset_campaign(int n)
|
||||
mission_campaign_load(filename);
|
||||
mission_campaign_next_mission();
|
||||
|
||||
vm_free(filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1599,9 +1570,6 @@ void campaign_room_commit()
|
||||
|
||||
mission_campaign_load(Campaign_file_names[Selected_campaign_index]);
|
||||
strcpy_s(Player->current_campaign, Campaign.filename); // track new campaign for player
|
||||
|
||||
// Goober5000 - reset player-persistent variables
|
||||
Player->num_variables = 0;
|
||||
}
|
||||
|
||||
if (mission_campaign_next_mission()) { // is campaign and next mission valid?
|
||||
@@ -1663,9 +1631,6 @@ int campaign_room_button_pressed(int n)
|
||||
// reset tech database to what's in the tables
|
||||
tech_reset_to_default();
|
||||
}
|
||||
|
||||
// Goober5000 - reset player-persistent variables
|
||||
Player->num_variables = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1721,9 +1686,6 @@ void campaign_room_init()
|
||||
Num_desc_lines = 0;
|
||||
Desc_scroll_offset = Scroll_offset = 0;
|
||||
|
||||
// Goober5000 - dumb hack, since main hall can be set in multiple places
|
||||
Old_main_hall = Player->main_hall;
|
||||
|
||||
// this stuff needs to happen before the mission_campaign_build_list() call
|
||||
load_failed = mission_load_up_campaign();
|
||||
if (!load_failed) {
|
||||
@@ -1731,6 +1693,8 @@ void campaign_room_init()
|
||||
} else {
|
||||
Campaign.filename[0] = 0;
|
||||
Campaign.num_missions = 0;
|
||||
|
||||
mission_campaign_load_failure_popup();
|
||||
}
|
||||
|
||||
// we need descriptions too, so "true" it
|
||||
@@ -1762,19 +1726,9 @@ void campaign_room_close()
|
||||
// unload the overlay bitmap
|
||||
help_overlay_unload(CAMPAIGN_ROOM_OVERLAY);
|
||||
|
||||
// be sure that we are going to use the correct mainhall
|
||||
if ( (Player != NULL) && (Campaign.current_mission >= 0) ) {
|
||||
Player->main_hall = Campaign.missions[Campaign.current_mission].main_hall;
|
||||
|
||||
// we might need to switch the music
|
||||
if (main_hall_get_music_index(Player->main_hall) != main_hall_get_music_index(Old_main_hall))
|
||||
main_hall_stop_music();
|
||||
}
|
||||
|
||||
Ui_window.destroy();
|
||||
common_free_interface_palette(); // restore game palette
|
||||
write_pilot_file();
|
||||
mission_campaign_savefile_save();
|
||||
Pilot.save_player();
|
||||
}
|
||||
|
||||
void campaign_room_do_frame(float frametime)
|
||||
|
||||
+232
-976
File diff suppressed because it is too large.
Load diff
@@ -24,7 +24,8 @@ struct sexp_variable;
|
||||
#define CAMPAIGN_ERROR_CORRUPT -1
|
||||
#define CAMPAIGN_ERROR_SEXP_EXHAUSTED -2
|
||||
#define CAMPAIGN_ERROR_MISSING -3
|
||||
#define CAMPAIGN_ERROR_IGNORED -4
|
||||
#define CAMPAIGN_ERROR_SAVEFILE -4
|
||||
#define CAMPAIGN_ERROR_IGNORED -5
|
||||
|
||||
// types of campaigns -- these defines match the string literals listed below which
|
||||
// are found in the campaign files. I don't think that we need campaigns for furball
|
||||
@@ -86,8 +87,8 @@ typedef struct cmission {
|
||||
mgoal *goals; // malloced array of mgoals (of num_goals size) which has the goal completion status
|
||||
int num_events; // number of events this mission had
|
||||
mevent *events; // malloced array of mevents (of num_events size) which has event completion status
|
||||
int num_saved_variables; // number of variables this mission had - Goober5000
|
||||
sexp_variable *saved_variables; // malloced array of sexp_variables (of num_variables size) containing campaign-persistent variables - Goober5000
|
||||
int num_variables; // number of variables this mission had - Goober5000
|
||||
sexp_variable *variables; // malloced array of sexp_variables (of num_variables size) containing mission-persistent variables - Goober5000
|
||||
int mission_loop_formula; // formula to determine whether to allow a side loop
|
||||
char *mission_branch_desc; // message in popup
|
||||
char *mission_branch_brief_anim;
|
||||
@@ -95,30 +96,32 @@ typedef struct cmission {
|
||||
int level; // what level of the tree it's on (Fred)
|
||||
int pos; // what x position on level it's on (Fred)
|
||||
int flags;
|
||||
ubyte main_hall; // which main hall the player is in - Goober5000
|
||||
SCP_string main_hall; // which main hall the player is in - converted to SCP_string by CommanderDJ
|
||||
ubyte debrief_persona_index; // which persona is used for ranks/badges - Goober5000
|
||||
scoring_struct stats;
|
||||
} cmission;
|
||||
|
||||
typedef struct campaign {
|
||||
char name[NAME_LENGTH]; // name of the campaign
|
||||
char filename[MAX_FILENAME_LEN]; // filename the campaign info is in
|
||||
char *desc; // description of campaign
|
||||
int type; // type of campaign
|
||||
int flags; // flags - Goober5000
|
||||
int num_missions; // number of missions in the campaign
|
||||
char name[NAME_LENGTH]; // name of the campaign
|
||||
char filename[MAX_FILENAME_LEN]; // filename the campaign info is in
|
||||
char *desc; // description of campaign
|
||||
int type; // type of campaign
|
||||
int flags; // flags - Goober5000
|
||||
int num_missions; // number of missions in the campaign
|
||||
int num_missions_completed; // number of missions in the campaign that have been flown
|
||||
int current_mission; // the current mission that the player is playing. Only valid during the mission
|
||||
int next_mission; // number of the next mission to fly when comtinuing the campaign. Always valid
|
||||
int prev_mission; // mission that we just came from. Always valid
|
||||
int loop_enabled; // whether mission loop is chosen - true during a loop, false otherwise
|
||||
int loop_mission; // mission number of misssion loop (if any)
|
||||
int loop_reentry; // mission number to return to after loop is finished
|
||||
int realign_required; // are any missions missing alignment info? (Fred)
|
||||
int num_players; // valid in multiplayer campaigns -- number of players campaign supports.
|
||||
ubyte ships_allowed[MAX_SHIP_CLASSES]; // which ships the player can use
|
||||
ubyte weapons_allowed[MAX_WEAPON_TYPES]; // which weapons the player can use
|
||||
cmission missions[MAX_CAMPAIGN_MISSIONS]; // decription of the missions
|
||||
int current_mission; // the current mission that the player is playing. Only valid during the mission
|
||||
int next_mission; // number of the next mission to fly when comtinuing the campaign. Always valid
|
||||
int prev_mission; // mission that we just came from. Always valid
|
||||
int loop_enabled; // whether mission loop is chosen - true during a loop, false otherwise
|
||||
int loop_mission; // mission number of misssion loop (if any)
|
||||
int loop_reentry; // mission number to return to after loop is finished
|
||||
int realign_required; // are any missions missing alignment info? (Fred)
|
||||
int num_players; // valid in multiplayer campaigns -- number of players campaign supports.
|
||||
ubyte ships_allowed[MAX_SHIP_CLASSES]; // which ships the player can use
|
||||
ubyte weapons_allowed[MAX_WEAPON_TYPES]; // which weapons the player can use
|
||||
cmission missions[MAX_CAMPAIGN_MISSIONS]; // decription of the missions
|
||||
int num_variables; // number of variables this campaign had - Goober5000
|
||||
sexp_variable *variables; // malloced array of sexp_variables (of num_variables size) containing campaign-persistent variables - Goober5000
|
||||
} campaign;
|
||||
|
||||
extern campaign Campaign;
|
||||
@@ -131,9 +134,9 @@ extern int Campaign_ending_via_supernova;
|
||||
// games
|
||||
typedef struct campaign_info
|
||||
{
|
||||
char filename[NAME_LENGTH];
|
||||
int num_missions_completed;
|
||||
ubyte missions_completed[MAX_CAMPAIGN_MISSIONS];
|
||||
char filename[NAME_LENGTH];
|
||||
ubyte missions_completed[MAX_CAMPAIGN_MISSIONS];
|
||||
} campaign_info;
|
||||
|
||||
// extern'ed so the mission loading can get a list of campains. Only use this
|
||||
@@ -166,9 +169,8 @@ int mission_campaign_load( char *filename, player *pl = NULL, int load_savefile
|
||||
extern int mission_campaign_save( void );
|
||||
|
||||
// declaration for local campaign save game load function
|
||||
extern int mission_campaign_savefile_load( char *cfilename, player *pl = NULL );
|
||||
extern void mission_campaign_savefile_delete( char *cfilename, int is_multi = -1 );
|
||||
extern void mission_campaign_delete_all_savefiles( char *pilot_name, int is_multi );
|
||||
extern void mission_campaign_savefile_delete( char *cfilename );
|
||||
extern void mission_campaign_delete_all_savefiles( char *pilot_name );
|
||||
|
||||
// if a given campaign is a multiplayer campaign, we can load and save the multiplayer info portion with these functions
|
||||
extern int mission_campaign_parse_is_multi(char *filename, char *name);
|
||||
@@ -180,7 +182,7 @@ extern int mission_campaign_next_mission( void );
|
||||
extern void mission_campaign_mission_over( bool do_next_mission = true );
|
||||
|
||||
// frees all memory at game close time
|
||||
extern void mission_campaign_close( void );
|
||||
extern void mission_campaign_clear( void );
|
||||
|
||||
// read in a campaign file. Used by Fred.
|
||||
int mission_campaign_load_fred(char *filename, char *name_verify = NULL);
|
||||
@@ -249,5 +251,7 @@ void mission_campaign_end_do();
|
||||
// Goober5000 - save persistent variables
|
||||
extern void mission_campaign_save_player_persistent_variables();
|
||||
|
||||
extern void mission_campaign_load_failure_popup();
|
||||
|
||||
// End CSFE stuff
|
||||
#endif
|
||||
@@ -113,8 +113,6 @@ int mission_load(char *filename_ext)
|
||||
Assert(!ret);
|
||||
}
|
||||
|
||||
ml_update_recent_missions(filename_ext); // update recently played missions list
|
||||
write_pilot_file();
|
||||
init_hud();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5304,7 +5304,7 @@ void parse_asteroid_fields(mission *pm)
|
||||
|
||||
void parse_variables()
|
||||
{
|
||||
int i, j, k, num_variables;
|
||||
int i, j, num_variables = 0;
|
||||
|
||||
if (! optional_string("#Sexp_variables") ) {
|
||||
return;
|
||||
@@ -5314,45 +5314,45 @@ void parse_variables()
|
||||
|
||||
// yeesh - none of this should be done in FRED :)
|
||||
// It shouldn't be done for missions in the tecroom either. They should default to whatever FRED set them to
|
||||
if (!Fred_running && (Game_mode & GM_CAMPAIGN_MODE))
|
||||
{
|
||||
// Goober5000 - now set the default value, if it's a campaign-persistent variable
|
||||
// look through all previous missions (by doing it this way, we will continually
|
||||
// overwrite the variable with the most recent information)
|
||||
for (i=0; i<Campaign.num_missions; i++)
|
||||
{
|
||||
if (Campaign.missions[i].completed != 1)
|
||||
continue;
|
||||
if ( Fred_running || !(Game_mode & GM_CAMPAIGN_MODE) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// loop through this particular previous mission's variables
|
||||
for (j=0; j<Campaign.missions[i].num_saved_variables; j++)
|
||||
{
|
||||
// loop through the current mission's variables
|
||||
for (k=0; k<num_variables; k++)
|
||||
{
|
||||
// if the active mission has a variable with the same name as a campaign
|
||||
// variable AND it is not a block variable, override its initial value
|
||||
// with the previous mission's value
|
||||
if (!(stricmp(Sexp_variables[k].variable_name, Campaign.missions[i].saved_variables[j].variable_name)) ) {
|
||||
Sexp_variables[k].type = Campaign.missions[i].saved_variables[j].type;
|
||||
strcpy_s(Sexp_variables[k].text, Campaign.missions[i].saved_variables[j].text);
|
||||
}
|
||||
// Goober5000 - now set the default value, if it's a campaign-persistent variable
|
||||
// loop through the current mission's variables
|
||||
for (j = 0; j < num_variables; j++) {
|
||||
// check against existing variables
|
||||
for (i = 0; i < Campaign.num_variables; i++) {
|
||||
// if the active mission has a variable with the same name as a campaign
|
||||
// variable AND it is not a block variable, override its initial value
|
||||
// with the previous mission's value
|
||||
if ( !stricmp(Sexp_variables[j].variable_name, Campaign.variables[i].variable_name) ) {
|
||||
if (Sexp_variables[j].type & SEXP_VARIABLE_CAMPAIGN_PERSISTENT) {
|
||||
Sexp_variables[j].type = Campaign.variables[i].type;
|
||||
strcpy_s(Sexp_variables[j].text, Campaign.variables[i].text);
|
||||
break;
|
||||
} else {
|
||||
WarningEx(LOCATION, "Variable %s has the same name as a campaign persistent variable. One of these should be renamed to avoid confusion", Sexp_variables[j].text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Goober5000 - next, see if any player-persistent variables are set
|
||||
for (i=0; i<Player->num_variables; i++)
|
||||
{
|
||||
// loop through the current mission's variables
|
||||
for (j=0; j<num_variables; j++)
|
||||
{
|
||||
// if the active mission has a variable with the same name as a player
|
||||
// variable AND it is not a block variable, override its initial value
|
||||
// with the previous mission's value
|
||||
if (!(stricmp(Sexp_variables[j].variable_name, Player->player_variables[i].variable_name)) ) {
|
||||
Sexp_variables[j].type = Player->player_variables[i].type;
|
||||
strcpy_s(Sexp_variables[j].text, Player->player_variables[i].text);
|
||||
// Goober5000 - next, see if any player-persistent variables are set
|
||||
// loop through the current mission's variables
|
||||
for (j = 0; j < num_variables; j++) {
|
||||
// check against existing variables
|
||||
for (i = 0; i < (int)Player->variables.size(); i++) {
|
||||
// if the active mission has a variable with the same name as a player
|
||||
// variable AND it is not a block variable, override its initial value
|
||||
// with the previous mission's value
|
||||
if ( !stricmp(Sexp_variables[j].variable_name, Player->variables[i].variable_name) ) {
|
||||
if (Sexp_variables[j].type & SEXP_VARIABLE_PLAYER_PERSISTENT) {
|
||||
Sexp_variables[j].type = Player->variables[i].type;
|
||||
strcpy_s(Sexp_variables[j].text, Player->variables[i].text);
|
||||
break;
|
||||
} else {
|
||||
WarningEx(LOCATION, "Variable %s has the same name as a player persistent variable. One of these should be renamed to avoid confusion", Sexp_variables[j].text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+114
-300
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define REDALERT_INTERNAL
|
||||
#include "missionui/redalert.h"
|
||||
#include "model/model.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
@@ -33,34 +33,23 @@
|
||||
#include "io/mouse.h"
|
||||
#include "ai/aigoals.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Red Alert Mission-Level
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int Red_alert_new_mission_timestamp; // timestamp used to give user a little warning for red alerts
|
||||
static int Red_alert_num_slots_used = 0;
|
||||
//static int Red_alert_num_slots_used = 0;
|
||||
static int Red_alert_voice_started;
|
||||
|
||||
#define RED_ALERT_WARN_TIME 4000 // time to warn user that new orders are coming
|
||||
|
||||
#define MAX_RED_ALERT_SLOTS 32
|
||||
#define MAX_RED_ALERT_SUBSYSTEMS 64
|
||||
#define RED_ALERT_EXITED_SHIP_CLASS -1
|
||||
|
||||
typedef struct red_alert_ship_status
|
||||
{
|
||||
char name[NAME_LENGTH];
|
||||
float hull;
|
||||
int ship_class;
|
||||
float subsys_current_hits[MAX_RED_ALERT_SUBSYSTEMS];
|
||||
float subsys_aggregate_current_hits[SUBSYSTEM_MAX];
|
||||
int wep[MAX_SHIP_WEAPONS];
|
||||
int wep_count[MAX_SHIP_WEAPONS];
|
||||
} red_alert_ship_status;
|
||||
|
||||
static red_alert_ship_status Red_alert_wingman_status[MAX_RED_ALERT_SLOTS];
|
||||
static char Red_alert_precursor_mission[MAX_FILENAME_LEN];
|
||||
SCP_vector<red_alert_ship_status> Red_alert_wingman_status;
|
||||
SCP_string Red_alert_precursor_mission;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Red Alert Interface
|
||||
@@ -462,122 +451,118 @@ void red_alert_invalidate_timestamp()
|
||||
// Store a ships weapons into a wingman status structure
|
||||
void red_alert_store_weapons(red_alert_ship_status *ras, ship_weapon *swp)
|
||||
{
|
||||
int i, sidx;
|
||||
int i;
|
||||
weapon_info *wip;
|
||||
wep_t weapons;
|
||||
|
||||
// Make sure there isn't any data from the previous ship.
|
||||
ras->primary_weapons.clear();
|
||||
ras->secondary_weapons.clear();
|
||||
|
||||
if (swp == NULL) {
|
||||
// just set defaults
|
||||
for (i = 0; i < MAX_SHIP_WEAPONS; i++) {
|
||||
ras->wep[i] = -1;
|
||||
ras->wep_count[i] = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// edited to accommodate ballistics - Goober5000
|
||||
for (i = 0; i < MAX_SHIP_PRIMARY_BANKS; i++) {
|
||||
wip = &Weapon_info[swp->primary_bank_weapons[i]];
|
||||
ras->wep[i] = swp->primary_bank_weapons[i];
|
||||
weapons.index = swp->primary_bank_weapons[i];
|
||||
|
||||
if (ras->wep[i] >= 0) {
|
||||
if (wip->wi_flags2 & WIF2_BALLISTIC) {
|
||||
// to avoid triggering the below condition: this way, minimum ammo will be 2...
|
||||
// since the red-alert representation of a conventional primary is 0 -> not used,
|
||||
// 1 -> used, I added the representation 2 and above -> ballistic primary
|
||||
ras->wep_count[i] = swp->primary_bank_ammo[i] + 2;
|
||||
} else {
|
||||
ras->wep_count[i] = 1;
|
||||
}
|
||||
} else {
|
||||
ras->wep_count[i] = -1;
|
||||
if (weapons.index < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
wip = &Weapon_info[weapons.index];
|
||||
|
||||
if (wip->wi_flags2 & WIF2_BALLISTIC) {
|
||||
// to avoid triggering the below condition: this way, minimum ammo will be 2...
|
||||
// since the red-alert representation of a conventional primary is 0 -> not used,
|
||||
// 1 -> used, I added the representation 2 and above -> ballistic primary
|
||||
weapons.count = swp->primary_bank_ammo[i] + 2;
|
||||
} else {
|
||||
weapons.count = 1;
|
||||
}
|
||||
|
||||
ras->primary_weapons.push_back( weapons );
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_SHIP_SECONDARY_BANKS; i++) {
|
||||
sidx = i+MAX_SHIP_PRIMARY_BANKS;
|
||||
ras->wep[sidx] = swp->secondary_bank_weapons[i];
|
||||
weapons.index = swp->secondary_bank_weapons[i];
|
||||
|
||||
if (ras->wep[sidx] >= 0)
|
||||
ras->wep_count[sidx] = swp->secondary_bank_ammo[i];
|
||||
else
|
||||
ras->wep_count[sidx] = -1;
|
||||
if (weapons.index < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
weapons.count = swp->secondary_bank_ammo[i];
|
||||
|
||||
ras->secondary_weapons.push_back( weapons );
|
||||
}
|
||||
}
|
||||
|
||||
// Take the weapons stored in a wingman_status struct, and bash them into the ship weapons struct
|
||||
void red_alert_bash_weapons(red_alert_ship_status *ras, ship_weapon *swp)
|
||||
{
|
||||
int i, j, sidx;
|
||||
int i, list_size = 0;
|
||||
|
||||
// restore from ship_exited
|
||||
if (ras->ship_class == RED_ALERT_EXITED_SHIP_CLASS)
|
||||
if (ras->ship_class == RED_ALERT_EXITED_SHIP_CLASS) {
|
||||
return;
|
||||
}
|
||||
|
||||
// modified to accommodate ballistics - Goober5000
|
||||
j = 0;
|
||||
for (i = 0; i < MAX_SHIP_PRIMARY_BANKS; i++) {
|
||||
if ( (ras->wep_count[i] > 0) && (ras->wep[i] >= 0) ) {
|
||||
swp->primary_bank_weapons[j] = ras->wep[i];
|
||||
|
||||
if (ras->wep_count[i] > 1) // this is a ballistic primary (!!!)
|
||||
swp->primary_bank_ammo[j] = ras->wep_count[i] - 2; // to compensate for storage
|
||||
else
|
||||
swp->primary_bank_ammo[i] = 0;
|
||||
list_size = (int)ras->primary_weapons.size();
|
||||
CLAMP(list_size, 0, MAX_SHIP_PRIMARY_BANKS);
|
||||
for (i = 0; i < list_size; i++) {
|
||||
Assert( ras->primary_weapons[i].index >= 0 );
|
||||
|
||||
j++;
|
||||
}
|
||||
swp->primary_bank_weapons[i] = ras->primary_weapons[i].index;
|
||||
swp->primary_bank_ammo[i] = ras->primary_weapons[i].count;
|
||||
}
|
||||
swp->num_primary_banks = j;
|
||||
swp->num_primary_banks = list_size;
|
||||
|
||||
|
||||
j = 0;
|
||||
for (i = 0; i < MAX_SHIP_SECONDARY_BANKS; i++) {
|
||||
sidx = i+MAX_SHIP_PRIMARY_BANKS;
|
||||
list_size = (int)ras->secondary_weapons.size();
|
||||
CLAMP(list_size, 0, MAX_SHIP_SECONDARY_BANKS);
|
||||
for (i = 0; i < list_size; i++) {
|
||||
Assert( ras->secondary_weapons[i].index >= 0 );
|
||||
|
||||
if (ras->wep[sidx] >= 0) {
|
||||
swp->secondary_bank_weapons[j] = ras->wep[sidx];
|
||||
swp->secondary_bank_ammo[j] = ras->wep_count[sidx];
|
||||
j++;
|
||||
}
|
||||
swp->secondary_bank_weapons[i] = ras->secondary_weapons[i].index;
|
||||
swp->secondary_bank_ammo[i] = ras->secondary_weapons[i].count;
|
||||
}
|
||||
swp->num_secondary_banks = j;
|
||||
swp->num_secondary_banks = list_size;
|
||||
}
|
||||
|
||||
void red_alert_bash_subsys_status(red_alert_ship_status *ras, ship *shipp)
|
||||
{
|
||||
ship_subsys *ss;
|
||||
int i, count = 0;
|
||||
int list_size;
|
||||
|
||||
// restore from ship_exited
|
||||
if (ras->ship_class == RED_ALERT_EXITED_SHIP_CLASS)
|
||||
if (ras->ship_class == RED_ALERT_EXITED_SHIP_CLASS) {
|
||||
return;
|
||||
}
|
||||
|
||||
ss = GET_FIRST(&shipp->subsys_list);
|
||||
while ( ss != END_OF_LIST( &shipp->subsys_list ) ) {
|
||||
|
||||
if ( count >= MAX_RED_ALERT_SUBSYSTEMS ) {
|
||||
Int3(); // ran out of subsystems
|
||||
// using at() here for the bounds check, although out-of-bounds should
|
||||
// probably never happen here
|
||||
try {
|
||||
ss->current_hits = ras->subsys_current_hits.at(count);
|
||||
} catch (std::out_of_range range) {
|
||||
break;
|
||||
}
|
||||
|
||||
// NOTE: we cast to int here in order to get rid of float precision issues with the comparison
|
||||
if ((int)ras->subsys_current_hits[count] != -1) {
|
||||
ss->current_hits = ras->subsys_current_hits[count];
|
||||
|
||||
if (ss->current_hits <= 0)
|
||||
ss->submodel_info_1.blown_off = 1;
|
||||
if (ss->current_hits <= 0) {
|
||||
ss->submodel_info_1.blown_off = 1;
|
||||
}
|
||||
|
||||
ss = GET_NEXT( ss );
|
||||
count++;
|
||||
}
|
||||
|
||||
for (i = 0; i < SUBSYSTEM_MAX; i++) {
|
||||
// NOTE: we cast to int here in order to get rid of float precision issues with the comparison
|
||||
if ((int)ras->subsys_aggregate_current_hits[i] == -1)
|
||||
continue;
|
||||
|
||||
list_size = (int)ras->subsys_aggregate_current_hits.size();
|
||||
CLAMP(list_size, 0, SUBSYSTEM_MAX);
|
||||
for (i = 0; i < list_size; i++) {
|
||||
shipp->subsys_info[i].aggregate_current_hits = ras->subsys_aggregate_current_hits[i];
|
||||
}
|
||||
}
|
||||
@@ -586,36 +571,26 @@ void red_alert_bash_subsys_status(red_alert_ship_status *ras, ship *shipp)
|
||||
void red_alert_store_subsys_status(red_alert_ship_status *ras, ship *shipp)
|
||||
{
|
||||
ship_subsys *ss;
|
||||
int i, count = 0;
|
||||
|
||||
int i;
|
||||
|
||||
// Make sure there isn't any data from the previous ship.
|
||||
ras->subsys_current_hits.clear();
|
||||
ras->subsys_aggregate_current_hits.clear();
|
||||
|
||||
if (shipp == NULL) {
|
||||
// just set defaults and bail
|
||||
// this assumes that current hits will never equal -1.0f (which it shouldn't)
|
||||
for (i = 0; i < MAX_RED_ALERT_SUBSYSTEMS; i++)
|
||||
ras->subsys_current_hits[i] = -1.0f;
|
||||
|
||||
for (i = 0; i < SUBSYSTEM_MAX; i++)
|
||||
ras->subsys_aggregate_current_hits[i] = -1.0f;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ss = GET_FIRST(&shipp->subsys_list);
|
||||
while ( ss != END_OF_LIST( &shipp->subsys_list ) ) {
|
||||
|
||||
Assertion((count < MAX_RED_ALERT_SUBSYSTEMS), "Too many subsystems in ship %s with red-alert-carry status. Tried to store %d, maximum is %d\n", shipp->ship_name, count, MAX_RED_ALERT_SUBSYSTEMS);
|
||||
|
||||
if ( count >= MAX_RED_ALERT_SUBSYSTEMS )
|
||||
break; //Ran out of systems, better bail
|
||||
|
||||
ras->subsys_current_hits[count] = ss->current_hits;
|
||||
ras->subsys_current_hits.push_back( ss->current_hits );
|
||||
|
||||
ss = GET_NEXT( ss );
|
||||
count++;
|
||||
}
|
||||
|
||||
for (i = 0; i < SUBSYSTEM_MAX; i++)
|
||||
ras->subsys_aggregate_current_hits[i] = shipp->subsys_info[i].aggregate_current_hits;
|
||||
// Pyro3d - Fixes AP8 Based RA crashes
|
||||
ras->subsys_aggregate_current_hits.push_back(shipp->subsys_info[i].aggregate_current_hits);
|
||||
}
|
||||
|
||||
|
||||
@@ -623,14 +598,16 @@ void red_alert_store_subsys_status(red_alert_ship_status *ras, ship *shipp)
|
||||
void red_alert_store_wingman_status()
|
||||
{
|
||||
ship *shipp;
|
||||
red_alert_ship_status *ras;
|
||||
red_alert_ship_status ras;
|
||||
ship_obj *so;
|
||||
object *ship_objp;
|
||||
|
||||
Red_alert_num_slots_used = 0;
|
||||
|
||||
// store the mission filename for the red alert precursor mission
|
||||
strcpy_s(Red_alert_precursor_mission, Game_current_mission_filename);
|
||||
Red_alert_precursor_mission = Game_current_mission_filename;
|
||||
|
||||
// Pyro3d - Clear list of stored red alert ships
|
||||
// Probably not the best solution, but it prevents an assertion in change_ship_type()
|
||||
Red_alert_wingman_status.clear();
|
||||
|
||||
// store status for all existing ships
|
||||
for ( so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so) ) {
|
||||
@@ -642,56 +619,47 @@ void red_alert_store_wingman_status()
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( Red_alert_num_slots_used >= MAX_RED_ALERT_SLOTS ) {
|
||||
Int3(); // ran out of red alert slots
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !(shipp->flags & SF_FROM_PLAYER_WING) && !(shipp->flags & SF_RED_ALERT_STORE_STATUS) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ras = &Red_alert_wingman_status[Red_alert_num_slots_used];
|
||||
Red_alert_num_slots_used++;
|
||||
ras.name = shipp->ship_name;
|
||||
ras.hull = Objects[shipp->objnum].hull_strength;
|
||||
ras.ship_class = shipp->ship_info_index;
|
||||
red_alert_store_weapons(&ras, &shipp->weapons);
|
||||
red_alert_store_subsys_status(&ras, shipp);
|
||||
|
||||
strcpy_s(ras->name, shipp->ship_name);
|
||||
ras->hull = Objects[shipp->objnum].hull_strength;
|
||||
ras->ship_class = shipp->ship_info_index;
|
||||
red_alert_store_weapons(ras, &shipp->weapons);
|
||||
red_alert_store_subsys_status(ras, shipp);
|
||||
Red_alert_wingman_status.push_back( ras );
|
||||
// niffiwan: trying to track down red alert bug creating HUGE pilot files
|
||||
Assert( (Red_alert_wingman_status.size() <= MAX_SHIPS) );
|
||||
}
|
||||
|
||||
// store exited ships that did not die
|
||||
for (int idx=0; idx<(int)Ships_exited.size(); idx++) {
|
||||
|
||||
if ( Red_alert_num_slots_used >= MAX_RED_ALERT_SLOTS ) {
|
||||
Int3(); // ran out of red alert slots
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Ships_exited[idx].flags & SEF_RED_ALERT_CARRY) {
|
||||
ras = &Red_alert_wingman_status[Red_alert_num_slots_used];
|
||||
Red_alert_num_slots_used++;
|
||||
|
||||
strcpy_s(ras->name, Ships_exited[idx].ship_name);
|
||||
ras->hull = float(Ships_exited[idx].hull_strength);
|
||||
ras.name = Ships_exited[idx].ship_name;
|
||||
ras.hull = float(Ships_exited[idx].hull_strength);
|
||||
|
||||
// if a ship has been destroyed or removed manually by the player, then mark it as such ...
|
||||
if ( (Ships_exited[idx].flags & SEF_DESTROYED) || (Ships_exited[idx].flags & SEF_PLAYER_DELETED) ) {
|
||||
ras->ship_class = RED_ALERT_EXITED_SHIP_CLASS;
|
||||
ras.ship_class = RED_ALERT_EXITED_SHIP_CLASS;
|
||||
}
|
||||
// ... otherwise we want to make sure and carry over the ship class
|
||||
else {
|
||||
Assert( Ships_exited[idx].ship_class >= 0 );
|
||||
ras->ship_class = Ships_exited[idx].ship_class;
|
||||
ras.ship_class = Ships_exited[idx].ship_class;
|
||||
}
|
||||
|
||||
red_alert_store_weapons(ras, NULL);
|
||||
red_alert_store_subsys_status(ras, NULL);
|
||||
red_alert_store_weapons(&ras, NULL);
|
||||
red_alert_store_subsys_status(&ras, NULL);
|
||||
|
||||
Red_alert_wingman_status.push_back( ras );
|
||||
// niffiwan: trying to track down red alert bug creating HUGE pilot files
|
||||
Assert( (Red_alert_wingman_status.size() <= MAX_SHIPS) );
|
||||
}
|
||||
}
|
||||
|
||||
Assert(Red_alert_num_slots_used > 0);
|
||||
Assert( !Red_alert_wingman_status.empty() );
|
||||
}
|
||||
|
||||
// Delete a ship in a red alert mission (since it must have died/departed in the previous mission)
|
||||
@@ -721,13 +689,13 @@ void red_alert_bash_wingman_status()
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Red_alert_num_slots_used <= 0 ) {
|
||||
if ( Red_alert_wingman_status.empty() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// go through all ships in the game, and see if there is red alert status data for any
|
||||
|
||||
int remove_list[MAX_RED_ALERT_SLOTS];
|
||||
int remove_list[MAX_SHIPS];
|
||||
int remove_count = 0;
|
||||
|
||||
for ( so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so) ) {
|
||||
@@ -741,19 +709,27 @@ void red_alert_bash_wingman_status()
|
||||
|
||||
int found_match = 0;
|
||||
|
||||
for ( i = 0; i < Red_alert_num_slots_used; i++ ) {
|
||||
for ( i = 0; i < (int)Red_alert_wingman_status.size(); i++ ) {
|
||||
ras = &Red_alert_wingman_status[i];
|
||||
|
||||
// we only want to restore ships which haven't been destroyed (which the RED_ALERT_EXITED_SHIP_CLASS identifies)
|
||||
if ( !stricmp(ras->name, shipp->ship_name) && (ras->ship_class != RED_ALERT_EXITED_SHIP_CLASS) ) {
|
||||
if ( !stricmp(ras->name.c_str(), shipp->ship_name) && (ras->ship_class != RED_ALERT_EXITED_SHIP_CLASS) ) {
|
||||
found_match = 1;
|
||||
|
||||
// if necessary, restore correct ship class
|
||||
if ( ras->ship_class != shipp->ship_info_index ) {
|
||||
change_ship_type(SHIP_INDEX(shipp), ras->ship_class);
|
||||
if (ras->ship_class < MAX_SHIP_CLASSES && ras->ship_class > -1) {
|
||||
change_ship_type(SHIP_INDEX(shipp), ras->ship_class);
|
||||
} else {
|
||||
mprintf(("Invalid ship class specified in red alert data for ship %s. Using mission defaults.\n", shipp->ship_name));
|
||||
}
|
||||
}
|
||||
// restore hull and weapons
|
||||
ship_objp->hull_strength = ras->hull;
|
||||
if (ras->hull >= 0.0f && ras->hull <= ship_objp->hull_strength) {
|
||||
ship_objp->hull_strength = ras->hull;
|
||||
} else {
|
||||
mprintf(("Invalid health in red alert data for ship %s. Using mission defaults.\n", shipp->ship_name));
|
||||
}
|
||||
red_alert_bash_weapons(ras, &shipp->weapons);
|
||||
red_alert_bash_subsys_status(ras, shipp);
|
||||
}
|
||||
@@ -771,168 +747,6 @@ void red_alert_bash_wingman_status()
|
||||
}
|
||||
}
|
||||
|
||||
// write wingman status out to the specified file
|
||||
void red_alert_write_wingman_status(CFILE *fp)
|
||||
{
|
||||
int i, j;
|
||||
red_alert_ship_status *ras;
|
||||
|
||||
cfwrite_int(Red_alert_num_slots_used, fp);
|
||||
|
||||
if ( Red_alert_num_slots_used <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Assert(strlen(Red_alert_precursor_mission) > 0 ); //-V805
|
||||
cfwrite_string(Red_alert_precursor_mission, fp);
|
||||
|
||||
for ( i = 0; i < Red_alert_num_slots_used; i++ ) {
|
||||
ras = &Red_alert_wingman_status[i];
|
||||
cfwrite_string(ras->name, fp);
|
||||
cfwrite_float(ras->hull, fp);
|
||||
cfwrite_string_len(Ship_info[ras->ship_class].name, fp);
|
||||
|
||||
for ( j = 0; j < MAX_RED_ALERT_SUBSYSTEMS; j++ ) {
|
||||
cfwrite_float(ras->subsys_current_hits[j], fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < SUBSYSTEM_MAX; j++ ) {
|
||||
cfwrite_float(ras->subsys_aggregate_current_hits[j], fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < MAX_SHIP_WEAPONS; j++ ) {
|
||||
cfwrite_string_len( Weapon_info[ras->wep[j]].name, fp);
|
||||
cfwrite_int( ras->wep_count[j], fp );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// same basic thing as the above but for writing in the campaign file - taylor
|
||||
void red_alert_write_wingman_status_campaign(CFILE *fp)
|
||||
{
|
||||
int i, j;
|
||||
red_alert_ship_status *ras;
|
||||
|
||||
cfwrite_int(Red_alert_num_slots_used, fp);
|
||||
|
||||
if ( Red_alert_num_slots_used <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Assert(strlen(Red_alert_precursor_mission) > 0 ); //-V805
|
||||
cfwrite_string(Red_alert_precursor_mission, fp);
|
||||
|
||||
for ( i = 0; i < Red_alert_num_slots_used; i++ ) {
|
||||
ras = &Red_alert_wingman_status[i];
|
||||
cfwrite_string(ras->name, fp);
|
||||
cfwrite_float(ras->hull, fp);
|
||||
cfwrite_int(ras->ship_class, fp);
|
||||
|
||||
for ( j = 0; j < MAX_RED_ALERT_SUBSYSTEMS; j++ ) {
|
||||
cfwrite_float(ras->subsys_current_hits[j], fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < SUBSYSTEM_MAX; j++ ) {
|
||||
cfwrite_float(ras->subsys_aggregate_current_hits[j], fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < MAX_SHIP_WEAPONS; j++ ) {
|
||||
cfwrite_int( ras->wep[j], fp ) ;
|
||||
cfwrite_int( ras->wep_count[j], fp );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// red wingman status out of the specified file
|
||||
void red_alert_read_wingman_status(CFILE *fp, int version)
|
||||
{
|
||||
int i, j;
|
||||
red_alert_ship_status *ras;
|
||||
char tname[NAME_LENGTH];
|
||||
|
||||
Red_alert_num_slots_used = cfread_int(fp);
|
||||
|
||||
if ( Red_alert_num_slots_used <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
cfread_string(Red_alert_precursor_mission, MAX_FILENAME_LEN, fp);
|
||||
|
||||
for ( i = 0; i < Red_alert_num_slots_used; i++ ) {
|
||||
ras = &Red_alert_wingman_status[i];
|
||||
cfread_string(ras->name, NAME_LENGTH, fp);
|
||||
ras->hull = cfread_float(fp);
|
||||
if (version >= 142) {
|
||||
cfread_string_len( tname, NAME_LENGTH, fp );
|
||||
ras->ship_class = ship_info_lookup(tname);
|
||||
} else {
|
||||
ras->ship_class = cfread_int(fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < MAX_RED_ALERT_SUBSYSTEMS; j++ ) {
|
||||
ras->subsys_current_hits[j] = cfread_float(fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < SUBSYSTEM_MAX; j++ ) {
|
||||
ras->subsys_aggregate_current_hits[j] = cfread_float(fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < MAX_SHIP_WEAPONS; j++ ) {
|
||||
if (version >= 142) {
|
||||
cfread_string_len( tname, NAME_LENGTH, fp );
|
||||
ras->wep[j] = weapon_info_lookup(tname);
|
||||
} else {
|
||||
ras->wep[j] = cfread_int(fp) ;
|
||||
}
|
||||
ras->wep_count[j] = cfread_int(fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// same basic thing as the above but for read from the campaign file - taylor
|
||||
void red_alert_read_wingman_status_campaign(CFILE *fp, char ships[][NAME_LENGTH], char weapons[][NAME_LENGTH])
|
||||
{
|
||||
int i, j;
|
||||
red_alert_ship_status *ras;
|
||||
int ras_tmp = -1;
|
||||
|
||||
Red_alert_num_slots_used = cfread_int(fp);
|
||||
|
||||
if ( Red_alert_num_slots_used <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Assert( (ships != NULL) && (weapons != NULL) );
|
||||
|
||||
if ( (ships == NULL) || (weapons == NULL) )
|
||||
return;
|
||||
|
||||
cfread_string(Red_alert_precursor_mission, MAX_FILENAME_LEN, fp);
|
||||
|
||||
for ( i = 0; i < Red_alert_num_slots_used; i++ ) {
|
||||
ras = &Red_alert_wingman_status[i];
|
||||
cfread_string(ras->name, NAME_LENGTH, fp);
|
||||
ras->hull = cfread_float(fp);
|
||||
|
||||
ras_tmp = cfread_int(fp);
|
||||
ras->ship_class = ship_info_lookup( ships[ras_tmp] );
|
||||
|
||||
for ( j = 0; j < MAX_RED_ALERT_SUBSYSTEMS; j++ ) {
|
||||
ras->subsys_current_hits[j] = cfread_float(fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < SUBSYSTEM_MAX; j++ ) {
|
||||
ras->subsys_aggregate_current_hits[j] = cfread_float(fp);
|
||||
}
|
||||
|
||||
for ( j = 0; j < MAX_SHIP_WEAPONS; j++ ) {
|
||||
ras_tmp = cfread_int(fp) ;
|
||||
ras->wep[j] = weapon_info_lookup( weapons[ras_tmp] );
|
||||
ras->wep_count[j] = cfread_int(fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return !0 if this is a red alert mission, otherwise return 0
|
||||
int red_alert_mission()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef __REDALERT_H__
|
||||
#define __REDALERT_H__
|
||||
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct CFILE;
|
||||
|
||||
@@ -28,14 +28,24 @@ void red_alert_maybe_move_to_next_mission();
|
||||
|
||||
void red_alert_store_wingman_status();
|
||||
void red_alert_bash_wingman_status();
|
||||
void red_alert_write_wingman_status(CFILE *fp);
|
||||
void red_alert_read_wingman_status(CFILE *fp, int version);
|
||||
|
||||
// campaign savefile versions
|
||||
void red_alert_write_wingman_status_campaign(CFILE *fp);
|
||||
void red_alert_read_wingman_status_campaign(CFILE *fp, char ships[][NAME_LENGTH], char weapons[][NAME_LENGTH]);
|
||||
|
||||
void red_alert_voice_pause();
|
||||
void red_alert_voice_unpause();
|
||||
|
||||
// should only ever be defined in redalert.cpp and the pilot file code!!
|
||||
#ifdef REDALERT_INTERNAL
|
||||
typedef struct red_alert_ship_status {
|
||||
SCP_string name;
|
||||
float hull;
|
||||
int ship_class;
|
||||
SCP_vector<float> subsys_current_hits;
|
||||
SCP_vector<float> subsys_aggregate_current_hits;
|
||||
SCP_vector<wep_t> primary_weapons;
|
||||
SCP_vector<wep_t> secondary_weapons;
|
||||
} red_alert_ship_status;
|
||||
|
||||
extern SCP_vector<red_alert_ship_status> Red_alert_wingman_status;
|
||||
extern SCP_string Red_alert_precursor_mission;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+8
-2
@@ -31,8 +31,9 @@ extern int model_render_flags_size;
|
||||
#define MOVEMENT_TYPE_NONE -1
|
||||
#define MOVEMENT_TYPE_POS 0
|
||||
#define MOVEMENT_TYPE_ROT 1
|
||||
#define MOVEMENT_TYPE_ROT_SPECIAL 2 // for turrets only
|
||||
#define MOVEMENT_TYPE_ROT_SPECIAL 2 // for turrets only
|
||||
#define MOVEMENT_TYPE_TRIGGERED 3 //triggered rotation
|
||||
#define MOVEMENT_TYPE_LOOK_AT 4 // the subobject is always looking at a 'look at' subobject, as best it can - Bobboau
|
||||
|
||||
|
||||
// DA 11/13/98 Reordered to account for difference between max and game
|
||||
@@ -366,7 +367,10 @@ typedef struct bsp_info {
|
||||
bool force_turret_normal; //Wanderer: Sets the turret uvec to override any input of for turret normal.
|
||||
char lod_name[MAX_NAME_LEN]; //FUBAR: Name to be used for LOD naming comparison to preserve compatibility with older tables. Only used on LOD0
|
||||
bool attach_thrusters; //zookeeper: If set and this submodel or any of its parents rotates, also rotates associated thrusters.
|
||||
float dumb_turn_rate;
|
||||
float dumb_turn_rate; //Bobboau
|
||||
//int look_at; //Bobboau
|
||||
int look_at_num; //VA - number of the submodel to be looked at by this submodel (-1 if none)
|
||||
char look_at[MAX_NAME_LEN]; //VA - name of submodel to be looked at by this submodel
|
||||
|
||||
/* If you've got a better way to do this, please implement it! */
|
||||
void Reset( )
|
||||
@@ -1283,5 +1287,7 @@ void model_set_replacement_textures(int *replacement_textures);
|
||||
void model_setup_cloak(vec3d *shift, int full_cloak, int alpha);
|
||||
void model_finish_cloak(int full_cloak);
|
||||
|
||||
void model_do_look_at(int model_num); //Bobboau
|
||||
|
||||
void model_do_dumb_rotation(int modelnum); //Bobboau
|
||||
#endif // _MODEL_H
|
||||
+189
-10
@@ -1268,17 +1268,26 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
|
||||
}
|
||||
|
||||
// Sets can_move on submodels which are of a rotating type or which have such a parent somewhere down the hierarchy
|
||||
if ((pm->submodel[n].movement_type != MOVEMENT_TYPE_NONE)
|
||||
|| strstr(props, "$triggered:") || strstr(props, "$rotate") || strstr(props, "$dumb_rotate:") || strstr(props, "$gun_rotation:") || strstr(props, "$gun_rotation")) {
|
||||
if ( (pm->submodel[n].movement_type != MOVEMENT_TYPE_NONE)
|
||||
|| strstr(props, "$triggered:") || strstr(props, "$rotate") || strstr(props, "$dumb_rotate:") || strstr(props, "$gun_rotation:") || strstr(props, "$gun_rotation") ) {
|
||||
pm->submodel[n].can_move = true;
|
||||
} else if (pm->submodel[n].parent > -1 && pm->submodel[pm->submodel[n].parent].can_move) {
|
||||
pm->submodel[n].can_move = true;
|
||||
}
|
||||
|
||||
if(( p = strstr(props, "$dumb_rotate:"))!= NULL ){
|
||||
if ( ( p = strstr(props, "$look_at:")) != NULL ) {
|
||||
pm->submodel[n].movement_type = MOVEMENT_TYPE_LOOK_AT;
|
||||
get_user_prop_value(p+9, pm->submodel[n].look_at);
|
||||
pm->submodel[n].look_at_num = -2; // Set this to -2 to mark it as something we need to work out the correct subobject number for later, after all subobjects have been processed
|
||||
|
||||
} else {
|
||||
pm->submodel[n].look_at_num = -1; // No look_at
|
||||
}
|
||||
|
||||
if ( ( p = strstr(props, "$dumb_rotate:") ) != NULL ) {
|
||||
pm->submodel[n].movement_type = MSS_FLAG_DUM_ROTATES;
|
||||
pm->submodel[n].dumb_turn_rate = (float)atof(p+13);
|
||||
}else{
|
||||
} else {
|
||||
pm->submodel[n].dumb_turn_rate = 0.0f;
|
||||
}
|
||||
|
||||
@@ -3450,6 +3459,115 @@ void submodel_stepped_rotate(model_subsystem *psub, submodel_instance_info *sii)
|
||||
}
|
||||
}
|
||||
|
||||
void world_find_real_model_point(vec3d *out, vec3d *world_pt, polymodel *pm, int submodel_num, matrix *orient, vec3d *pos);
|
||||
|
||||
void submodel_look_at(polymodel *pm, int mn)
|
||||
{
|
||||
bsp_info * sm;
|
||||
|
||||
if ( mn < 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
sm = &pm->submodel[mn];
|
||||
angles *angs = &pm->submodel[mn].angs;
|
||||
|
||||
if ( sm->movement_type != MOVEMENT_TYPE_LOOK_AT ) {
|
||||
return;
|
||||
}
|
||||
|
||||
vec3d other, mp;
|
||||
|
||||
int pmn = pm->id;
|
||||
|
||||
// VA - Run this bit only once for each look_at enabled submodel, to correctly associate the name given in the $look_at: property with the number of that named subobject
|
||||
if (sm->look_at_num == -2) {
|
||||
// Search through submodels for the look_at target name
|
||||
for (int i = 0; i < pm->n_models; i++) {
|
||||
if (!strcmp(sm->look_at, pm->submodel[i].name)) {
|
||||
sm->look_at_num = i; // Found it
|
||||
nprintf(("Model", "NOTE: Matched $look_at: target <%s> with subobject id %d\n", sm->look_at, i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sm->look_at_num == -2) {
|
||||
Warning( LOCATION, "Invalid submodel name given in $look_at: property in model file <%s>. (%s looking for %s)\n", pm->filename, pm->submodel->name, sm->look_at );
|
||||
sm->look_at_num = -1; // Set to -1 to not break stuff
|
||||
}
|
||||
}
|
||||
|
||||
model_find_world_point(&mp, &vmd_zero_vector, pmn, sm->look_at_num, &vmd_identity_matrix, &vmd_zero_vector);
|
||||
world_find_real_model_point(&other, &mp, pm, mn, &vmd_identity_matrix, &vmd_zero_vector);
|
||||
|
||||
if (!IS_MAT_NULL(&pm->submodel[mn].orientation)) {
|
||||
vm_vec_rotate(&mp, &other, &pm->submodel[mn].orientation);
|
||||
} else {
|
||||
mp = other;
|
||||
}
|
||||
|
||||
vec3d d, l;
|
||||
model_find_submodel_offset(&d, pmn, mn);
|
||||
model_find_submodel_offset(&l, pmn, sm->look_at_num);
|
||||
vm_vec_sub(&other, &l, &d);
|
||||
|
||||
if (!IS_MAT_NULL(&pm->submodel[mn].orientation)) {
|
||||
vm_vec_rotate(&l, &other, &pm->submodel[mn].orientation);
|
||||
} else {
|
||||
l = other;
|
||||
}
|
||||
|
||||
float *a;
|
||||
int axis;
|
||||
|
||||
switch( sm->movement_axis ) {
|
||||
default:
|
||||
case MOVEMENT_AXIS_X:
|
||||
l.xyz.x = 0;
|
||||
mp.xyz.x = 0;
|
||||
a = &angs->p;
|
||||
axis = 0;
|
||||
break;
|
||||
|
||||
case MOVEMENT_AXIS_Y:
|
||||
l.xyz.y = 0;
|
||||
mp.xyz.y = 0;
|
||||
a = &angs->h;
|
||||
axis = 1;
|
||||
break;
|
||||
|
||||
case MOVEMENT_AXIS_Z:
|
||||
l.xyz.z = 0;
|
||||
mp.xyz.z = 0;
|
||||
a = &angs->b;
|
||||
axis = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
vm_vec_normalize(&mp);
|
||||
vm_vec_normalize(&l);
|
||||
|
||||
vec3d c;
|
||||
vm_vec_crossprod(&c, &l, &mp);
|
||||
float dot=vm_vec_dotprod(&l,&mp);
|
||||
if (dot>=0.0f) {
|
||||
*a = asin(c.a1d[axis]);
|
||||
} else {
|
||||
*a = PI-asin(c.a1d[axis]);
|
||||
}
|
||||
|
||||
if (*a > PI2 ) {
|
||||
*a -= PI2;
|
||||
} else { if (*a < 0.0f )
|
||||
*a += PI2;
|
||||
}
|
||||
|
||||
for (int k=0; k<sm->num_details; k++ ) {
|
||||
pm->submodel[sm->details[k]].angs = *angs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Rotates the angle of a submodel. Use this so the right unlocked axis
|
||||
// gets stuffed.
|
||||
void submodel_rotate(model_subsystem *psub, submodel_instance_info *sii)
|
||||
@@ -3823,6 +3941,45 @@ void model_find_submodel_offset(vec3d *outpnt, int model_num, int sub_model_num)
|
||||
}
|
||||
}
|
||||
|
||||
void make_submodel_world_matrix(polymodel *pm, int sn, vec3d*v){
|
||||
if (pm->submodel[sn].parent != -1) {
|
||||
make_submodel_world_matrix(pm,pm->submodel[sn].parent,v);
|
||||
}
|
||||
|
||||
vm_vec_sub2(v, &pm->submodel[sn].offset);
|
||||
vec3d t = *v;
|
||||
|
||||
matrix a;
|
||||
vm_angles_2_matrix(&a, &pm->submodel[sn].angs);
|
||||
if (!IS_MAT_NULL(&pm->submodel[sn].orientation)) {
|
||||
matrix inv, f;
|
||||
vm_copy_transpose_matrix(&inv, &pm->submodel[sn].orientation);
|
||||
vm_matrix_x_matrix(&f, &a, &inv);
|
||||
vm_matrix_x_matrix(&a, &pm->submodel[sn].orientation, &f);
|
||||
}
|
||||
vm_vec_rotate(v, &t, &a);
|
||||
}
|
||||
|
||||
// just like below, exept it actualy does what it says it does
|
||||
void world_find_real_model_point(vec3d *out, vec3d *world_pt, polymodel *pm, int submodel_num, matrix *orient, vec3d *pos)
|
||||
{
|
||||
vec3d tempv1, tempv2;
|
||||
|
||||
// get into ship RF
|
||||
vm_vec_sub(&tempv1, world_pt, pos);
|
||||
vm_vec_rotate(&tempv2, &tempv1, orient);
|
||||
|
||||
if (pm->submodel[submodel_num].parent == -1) {
|
||||
*out = tempv2;
|
||||
return;
|
||||
}
|
||||
|
||||
//vec3d os = ZERO_VECTOR;
|
||||
// put into submodel RF
|
||||
make_submodel_world_matrix(pm,submodel_num, &tempv2);
|
||||
*out = tempv2;
|
||||
}
|
||||
|
||||
// Given a point (pnt) that is in sub_model_num's frame of
|
||||
// reference, and given the object's orient and position,
|
||||
// return the point in 3-space in outpnt.
|
||||
@@ -4505,15 +4662,16 @@ void model_instance_dumb_rotation(int model_instance_num)
|
||||
model_instance_dumb_rotation_sub(pmi, pm, mn);
|
||||
}
|
||||
|
||||
void model_do_childeren_dumb_rotation(polymodel * pm, int mn){
|
||||
while ( mn >= 0 ) {
|
||||
void model_do_children_dumb_rotation(polymodel * pm, int mn)
|
||||
{
|
||||
while ( mn >= 0 ) {
|
||||
|
||||
bsp_info * sm = &pm->submodel[mn];
|
||||
|
||||
if ( sm->movement_type == MSS_FLAG_DUM_ROTATES ){
|
||||
if ( sm->movement_type == MSS_FLAG_DUM_ROTATES ) {
|
||||
float *ang;
|
||||
int axis = sm->movement_axis;
|
||||
switch(axis){
|
||||
switch(axis) {
|
||||
case MOVEMENT_AXIS_X:
|
||||
ang = &sm->angs.p;
|
||||
break;
|
||||
@@ -4525,12 +4683,15 @@ void model_do_childeren_dumb_rotation(polymodel * pm, int mn){
|
||||
ang = &sm->angs.h;
|
||||
break;
|
||||
}
|
||||
|
||||
*ang = sm->dumb_turn_rate * float(timestamp())/1000.0f;
|
||||
*ang = ((*ang/(PI*2.0f))-float(int(*ang/(PI*2.0f))))*(PI*2.0f);
|
||||
//this keeps ang from getting bigger than 2PI
|
||||
}
|
||||
|
||||
if(pm->submodel[mn].first_child >-1)model_do_childeren_dumb_rotation(pm, pm->submodel[mn].first_child);
|
||||
if (pm->submodel[mn].first_child >-1) {
|
||||
model_do_children_dumb_rotation(pm, pm->submodel[mn].first_child);
|
||||
}
|
||||
|
||||
mn = pm->submodel[mn].next_sibling;
|
||||
}
|
||||
@@ -4541,9 +4702,27 @@ void model_do_dumb_rotation(int pn){
|
||||
pm = model_get(pn);
|
||||
int mn = pm->detail[0];
|
||||
|
||||
model_do_childeren_dumb_rotation(pm,mn);
|
||||
model_do_children_dumb_rotation(pm,mn);
|
||||
}
|
||||
|
||||
void model_do_children_look_at(polymodel * pm, int mn)
|
||||
{
|
||||
while ( mn >= 0 ) {
|
||||
submodel_look_at(pm, mn);
|
||||
if (pm->submodel[mn].first_child >-1) {
|
||||
model_do_children_look_at(pm, pm->submodel[mn].first_child);
|
||||
}
|
||||
mn = pm->submodel[mn].next_sibling;
|
||||
}
|
||||
}
|
||||
|
||||
void model_do_look_at(int pn)
|
||||
{
|
||||
polymodel * pm;
|
||||
pm = model_get(pn);
|
||||
int mn = pm->detail[0];
|
||||
model_do_children_look_at(pm,mn);
|
||||
}
|
||||
|
||||
// Finds a point on the rotation axis of a submodel, used in collision, generally find rotational velocity
|
||||
void model_init_submodel_axis_pt(submodel_instance_info *sii, int model_num, int submodel_num)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "fs2netd/fs2netd_client.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
|
||||
|
||||
|
||||
@@ -255,7 +256,7 @@ void multi_level_init()
|
||||
ml_string(NOX("multi_level_init()"));
|
||||
|
||||
// initialize the Net_players array
|
||||
for(idx=0;idx<MAX_PLAYERS;idx++) {
|
||||
for ( idx = 0; idx < MAX_PLAYERS; idx++) {
|
||||
// close all sockets down just for good measure
|
||||
psnet_rel_close_socket(&Net_players[idx].reliable_socket);
|
||||
|
||||
@@ -267,11 +268,11 @@ void multi_level_init()
|
||||
}
|
||||
|
||||
// initialize the Players array
|
||||
for(idx=0;idx<MAX_PLAYERS;idx++){
|
||||
if(Player == &Players[idx]){
|
||||
for (idx=0;idx<MAX_PLAYERS;idx++) {
|
||||
if (Player == &Players[idx]) {
|
||||
continue;
|
||||
}
|
||||
memset(&Players[idx],0,sizeof(player));
|
||||
Players[idx].reset();
|
||||
}
|
||||
|
||||
multi_vars_init();
|
||||
@@ -306,7 +307,7 @@ void multi_level_init()
|
||||
multi_respawn_init();
|
||||
|
||||
// initialize all netgame timestamps
|
||||
multi_reset_timestamps();
|
||||
multi_reset_timestamps();
|
||||
|
||||
// flush psnet sockets
|
||||
psnet_flush();
|
||||
@@ -1490,8 +1491,7 @@ void standalone_main_init()
|
||||
timestamp_reset();
|
||||
|
||||
// setup a blank pilot (this is a standalone usage only!)
|
||||
extern int read_pilot_file(char* callsign, int single = 1, player *p = NULL);
|
||||
read_pilot_file(NULL);
|
||||
Pilot.load_player(NULL);
|
||||
|
||||
// setup the netplayer for the standalone
|
||||
Net_player = &Net_players[0];
|
||||
|
||||
@@ -711,7 +711,7 @@ void multi_campaign_process_ingame_start( ubyte *data, header *hinfo )
|
||||
case MC_JIP_INITIAL_PACKET:
|
||||
|
||||
// clear out the names of the missions
|
||||
mission_campaign_close(); // should free all data structures which need to be freed
|
||||
mission_campaign_clear(); // should free all data structures which need to be freed
|
||||
|
||||
// get the number of campaigns and their names.
|
||||
GET_INT(Campaign.num_missions);
|
||||
|
||||
@@ -44,11 +44,13 @@ int multi_obs_create_player(int player_num,char *name,net_addr *addr,player *pl)
|
||||
Net_players[player_num].flags = (NETINFO_FLAG_DO_NETWORKING | NETINFO_FLAG_OBSERVER);
|
||||
// memcpy(&Net_players[player_num].p_info.addr, addr, sizeof(net_addr));
|
||||
Net_players[player_num].m_player = pl;
|
||||
|
||||
|
||||
// 6/3/98 -- don't set observer to update high...let it be whatever player set it at.
|
||||
//Net_players[player_num].p_info.options.obj_update_level = OBJ_UPDATE_HIGH;
|
||||
|
||||
// set up the net_player structure
|
||||
memset(pl, 0, sizeof(player));
|
||||
pl->reset();
|
||||
|
||||
stuff_netplayer_info( &Net_players[player_num], addr, 0, pl );
|
||||
Net_players[player_num].last_heard_time = timer_get_fixed_seconds();
|
||||
Net_players[player_num].reliable_socket = INVALID_SOCKET;
|
||||
@@ -60,7 +62,7 @@ int multi_obs_create_player(int player_num,char *name,net_addr *addr,player *pl)
|
||||
|
||||
// reset the ping for this player
|
||||
multi_ping_reset(&Net_players[player_num].s_info.ping);
|
||||
|
||||
|
||||
// timestamp his last_full_update_time
|
||||
Net_players[player_num].s_info.last_full_update_time = timestamp(0);
|
||||
Net_players[player_num].m_player->objnum = -1;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "network/multi_voice.h"
|
||||
#include "network/multi_endgame.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "stats/stats.h"
|
||||
#include "network/multi_pmsg.h"
|
||||
#include "network/multi_obj.h"
|
||||
@@ -6242,7 +6243,7 @@ void multi_ho_accept_hit()
|
||||
// store these values locally
|
||||
memcpy(&Player->m_local_options,&Net_player->p_info.options,sizeof(multi_local_options));
|
||||
memcpy(&Player->m_server_options,&Netgame.options,sizeof(multi_server_options));
|
||||
write_pilot_file(Player);
|
||||
Pilot.save_player(Player);
|
||||
|
||||
// apply any changes in settings (notify everyone of voice qos changes, etc)
|
||||
multi_ho_apply_options();
|
||||
|
||||
@@ -783,11 +783,11 @@ int multi_create_player( int net_player_num, player *pl, char* name, net_addr* a
|
||||
}
|
||||
|
||||
// blast the old player data
|
||||
memset(pl,0,sizeof(player));
|
||||
pl->reset();
|
||||
|
||||
// set up the net_player structure
|
||||
stuff_netplayer_info( &Net_players[net_player_num], addr, player_ship_class, pl );
|
||||
Net_players[net_player_num].s_info.num_last_buttons = 0;
|
||||
stuff_netplayer_info( &Net_players[net_player_num], addr, player_ship_class, pl ); Net_players[net_player_num].s_info.num_last_buttons = 0;
|
||||
|
||||
// Net_players[net_player_num].respawn_count = 0;
|
||||
Net_players[net_player_num].last_heard_time = timer_get_fixed_seconds();
|
||||
Net_players[net_player_num].reliable_socket = INVALID_SOCKET;
|
||||
|
||||
+19
-8
@@ -9677,18 +9677,29 @@ ADE_FUNC(getImageFilename, l_Player, NULL, "Gets current player image filename",
|
||||
return ade_set_args(L, "s", Players[idx].image_filename);
|
||||
}
|
||||
|
||||
|
||||
ADE_FUNC(getMainHall, l_Player, NULL, "Gets player's main hall number", "number", "Main hall index, or 1 if handle is invalid")
|
||||
ADE_FUNC(getMainHallName, l_Player, NULL, "Gets player's current main hall name", "string", "Main hall name, or name of first mainhall in campaign if something goes wrong")
|
||||
{
|
||||
int idx;
|
||||
if(!ade_get_args(L, "o", l_Player.Get(&idx)))
|
||||
return ade_set_error(L, "i", 1);
|
||||
SCP_string hallname;
|
||||
// FS2-->Lua
|
||||
if (Campaign.next_mission == -1) {
|
||||
hallname = Campaign.missions[0].main_hall;
|
||||
} else {
|
||||
hallname = Campaign.missions[Campaign.next_mission].main_hall;
|
||||
}
|
||||
|
||||
if(idx < 0 || idx >= Player_num)
|
||||
return ade_set_error(L, "i", 1);
|
||||
return ade_set_args(L, "i", hallname.c_str());
|
||||
}
|
||||
|
||||
// use getMainHallName if at all possible.
|
||||
ADE_FUNC(getMainHallIndex, l_Player, NULL, "Gets player's current main hall number", "number", "Main hall index, or index of first mainhall in campaign if something goes wrong")
|
||||
{
|
||||
int hallnum = 0;
|
||||
//FS2-->Lua
|
||||
int hallnum = (int)Players[idx].main_hall + 1;
|
||||
if (Campaign.next_mission == -1) {
|
||||
hallnum = main_hall_get_index(Campaign.missions[0].main_hall);
|
||||
} else {
|
||||
hallnum = main_hall_get_index(Campaign.missions[Campaign.next_mission].main_hall);
|
||||
}
|
||||
|
||||
return ade_set_args(L, "i", hallnum);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ extern "C" {
|
||||
|
||||
#include "object/object.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
|
||||
//*************************Lua funcs*************************
|
||||
//Used to parse arguments on the stack to C values
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,178 @@
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "ship/ship.h"
|
||||
#include "stats/medals.h"
|
||||
|
||||
|
||||
pilotfile Pilot;
|
||||
|
||||
|
||||
pilotfile::pilotfile()
|
||||
{
|
||||
m_have_flags = false;
|
||||
m_have_info = false;
|
||||
|
||||
m_data_invalid = false;
|
||||
|
||||
m_size_offset = 0;
|
||||
|
||||
cfp = NULL;
|
||||
p = NULL;
|
||||
}
|
||||
|
||||
pilotfile::~pilotfile()
|
||||
{
|
||||
if (cfp) {
|
||||
cfclose(cfp);
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile::startSection(Section::id section_id)
|
||||
{
|
||||
Assert( cfp );
|
||||
|
||||
const int zero = 0;
|
||||
|
||||
cfwrite_ushort( (ushort)section_id, cfp );
|
||||
|
||||
// to be updated when endSection() is called
|
||||
cfwrite_int(zero, cfp);
|
||||
|
||||
// starting offset, for size of section
|
||||
m_size_offset = cftell(cfp);
|
||||
}
|
||||
|
||||
void pilotfile::endSection()
|
||||
{
|
||||
Assert( cfp );
|
||||
Assert( m_size_offset > 0 );
|
||||
|
||||
size_t cur = cftell(cfp);
|
||||
|
||||
Assert( cur >= m_size_offset );
|
||||
|
||||
size_t section_size = cur - m_size_offset;
|
||||
|
||||
if (section_size) {
|
||||
// go back to section size in file and write proper value
|
||||
cfseek(cfp, cur - section_size - sizeof(int), CF_SEEK_SET);
|
||||
cfwrite_int((int)section_size, cfp);
|
||||
|
||||
// go back to previous location for next section
|
||||
cfseek(cfp, cur, CF_SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile::update_stats(scoring_struct *stats, bool training)
|
||||
{
|
||||
int idx, i, j, list_size;
|
||||
index_list_t ilist;
|
||||
scoring_special_t *p_stats = NULL;
|
||||
|
||||
if (Game_mode & GM_MULTIPLAYER) {
|
||||
p_stats = &multi_stats;
|
||||
} else {
|
||||
p_stats = &all_time_stats;
|
||||
}
|
||||
|
||||
// medals
|
||||
if (stats->m_medal_earned >= 0) {
|
||||
list_size = (int)p_stats->medals_earned.size();
|
||||
|
||||
j = -1;
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
if ( p_stats->medals_earned[idx].name.compare(Medals[stats->m_medal_earned].name) ) {
|
||||
j = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j >= 0) {
|
||||
p_stats->medals_earned[j].val++;
|
||||
} else {
|
||||
ilist.name = Medals[stats->m_medal_earned].name;
|
||||
ilist.val = 1;
|
||||
|
||||
p_stats->medals_earned.push_back(ilist);
|
||||
}
|
||||
}
|
||||
|
||||
// early out if these stats are from a training mission
|
||||
if (training) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stats->m_promotion_earned >= 0) {
|
||||
p_stats->rank = stats->m_promotion_earned;
|
||||
}
|
||||
|
||||
p_stats->score += stats->m_score;
|
||||
|
||||
p_stats->assists += stats->m_assists;
|
||||
p_stats->kill_count += stats->m_kill_count;
|
||||
p_stats->kill_count_ok += stats->m_kill_count_ok;
|
||||
p_stats->bonehead_kills += stats->m_bonehead_kills;
|
||||
|
||||
p_stats->p_shots_fired += stats->mp_shots_fired;
|
||||
p_stats->p_shots_hit += stats->mp_shots_hit;
|
||||
p_stats->p_bonehead_hits += stats->mp_bonehead_hits;
|
||||
|
||||
p_stats->s_shots_fired += stats->ms_shots_fired;
|
||||
p_stats->s_shots_hit += stats->ms_shots_hit;
|
||||
p_stats->s_bonehead_hits += stats->ms_bonehead_hits;
|
||||
|
||||
p_stats->flight_time += (unsigned int)f2i(Missiontime);
|
||||
p_stats->last_backup = p_stats->last_flown;
|
||||
p_stats->last_flown = stats->last_flown;
|
||||
p_stats->missions_flown++;
|
||||
|
||||
// badges
|
||||
if (stats->m_badge_earned >= 0) {
|
||||
list_size = (int)p_stats->medals_earned.size();
|
||||
|
||||
j = -1;
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
if ( p_stats->medals_earned[idx].name.compare(Medals[stats->m_badge_earned].name) ) {
|
||||
j = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j >= 0) {
|
||||
p_stats->medals_earned[j].val = 1;
|
||||
} else {
|
||||
ilist.name = Medals[stats->m_badge_earned].name;
|
||||
ilist.val = 1;
|
||||
|
||||
p_stats->medals_earned.push_back(ilist);
|
||||
}
|
||||
}
|
||||
|
||||
// ship kills
|
||||
for (idx = 0; idx < Num_ship_classes; idx++) {
|
||||
if (stats->m_okKills[idx] > 0) {
|
||||
list_size = (int)p_stats->ship_kills.size();
|
||||
|
||||
j = -1;
|
||||
|
||||
for (i = 0; i < list_size; i++) {
|
||||
if ( p_stats->ship_kills[i].name.compare(Ship_info[idx].name) ) {
|
||||
j = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j >= 0) {
|
||||
p_stats->ship_kills[j].val += stats->m_okKills[idx];
|
||||
} else {
|
||||
ilist.name = Ship_info[idx].name;
|
||||
ilist.val = stats->m_okKills[idx];
|
||||
|
||||
p_stats->ship_kills.push_back(ilist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
|
||||
#ifndef _PILOTFILE_H
|
||||
#define _PILOTFILE_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "stats/scoring.h"
|
||||
|
||||
|
||||
struct player;
|
||||
|
||||
|
||||
class pilotfile {
|
||||
public:
|
||||
pilotfile();
|
||||
~pilotfile();
|
||||
|
||||
bool load_player(const char *callsign, player *_p = NULL);
|
||||
bool load_savefile(const char *campaign);
|
||||
|
||||
bool save_player(player *_p = NULL);
|
||||
bool save_savefile();
|
||||
|
||||
// updating stats, multi and/or all-time
|
||||
void update_stats(scoring_struct *stats, bool training = false);
|
||||
|
||||
// for checking to see if a PLR file is basically valid
|
||||
bool verify(const char *fname, int *rank = NULL);
|
||||
|
||||
// whether current campaign savefile has valid data to work with
|
||||
bool is_invalid()
|
||||
{
|
||||
return m_data_invalid;
|
||||
}
|
||||
|
||||
private:
|
||||
// --------------------------------------------------------------------
|
||||
// info shared between PLR and CSG ...
|
||||
// --------------------------------------------------------------------
|
||||
CFILE *cfp;
|
||||
SCP_string filename;
|
||||
player *p;
|
||||
|
||||
// some sections are required before others...
|
||||
bool m_have_flags;
|
||||
bool m_have_info;
|
||||
|
||||
// set in case data appears wrong, so we can avoid loading/saving campaign savefile
|
||||
bool m_data_invalid;
|
||||
|
||||
typedef struct index_list_t {
|
||||
SCP_string name;
|
||||
int index;
|
||||
int val;
|
||||
|
||||
index_list_t() :
|
||||
index(-1), val(0)
|
||||
{
|
||||
}
|
||||
} index_list_t;
|
||||
|
||||
// overall content list, can include reference to more than current
|
||||
// mod/campaign provides
|
||||
// NOTE: order of each list **must be preserved**
|
||||
SCP_vector<index_list_t> ship_list;
|
||||
SCP_vector<index_list_t> weapon_list;
|
||||
SCP_vector<index_list_t> intel_list;
|
||||
SCP_vector<index_list_t> medals_list;
|
||||
|
||||
// special stats struct, since our use here is not content specific
|
||||
typedef struct scoring_special_t {
|
||||
int score;
|
||||
int rank;
|
||||
int assists;
|
||||
int kill_count;
|
||||
int kill_count_ok;
|
||||
int bonehead_kills;
|
||||
|
||||
unsigned int p_shots_fired;
|
||||
unsigned int p_shots_hit;
|
||||
unsigned int p_bonehead_hits;
|
||||
|
||||
unsigned int s_shots_fired;
|
||||
unsigned int s_shots_hit;
|
||||
unsigned int s_bonehead_hits;
|
||||
|
||||
unsigned int missions_flown;
|
||||
unsigned int flight_time;
|
||||
_fs_time_t last_flown;
|
||||
_fs_time_t last_backup;
|
||||
|
||||
SCP_vector<index_list_t> ship_kills;
|
||||
SCP_vector<index_list_t> medals_earned;
|
||||
|
||||
scoring_special_t() :
|
||||
score(0), rank(RANK_ENSIGN), assists(0), kill_count(0), kill_count_ok(0),
|
||||
bonehead_kills(0), p_shots_fired(0), p_shots_hit(0), p_bonehead_hits(0),
|
||||
s_shots_fired(0), s_shots_hit(0), s_bonehead_hits(0), missions_flown(0),
|
||||
flight_time(0), last_flown(0), last_backup(0)
|
||||
{
|
||||
}
|
||||
} scoring_special_t;
|
||||
|
||||
scoring_special_t all_time_stats;
|
||||
scoring_special_t multi_stats;
|
||||
|
||||
// sections of a pilot file. includes both plr and csg sections
|
||||
struct Section {
|
||||
enum id {
|
||||
Flags = 0x0001,
|
||||
Info = 0x0002,
|
||||
Loadout = 0x0003,
|
||||
Controls = 0x0004,
|
||||
Multiplayer = 0x0005,
|
||||
Scoring = 0x0006,
|
||||
ScoringMulti = 0x0007,
|
||||
Techroom = 0x0008,
|
||||
HUD = 0x0009,
|
||||
Settings = 0x0010,
|
||||
RedAlert = 0x0011,
|
||||
Variables = 0x0012,
|
||||
Missions = 0x0013,
|
||||
Cutscenes = 0x0014
|
||||
};
|
||||
};
|
||||
|
||||
// for writing files, sets/updates section info
|
||||
void startSection(Section::id section_id);
|
||||
void endSection();
|
||||
// file offset of the size value for the current section (set with startSection())
|
||||
size_t m_size_offset;
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// PLR specific
|
||||
// --------------------------------------------------------------------
|
||||
void plr_reset_data();
|
||||
void plr_close();
|
||||
|
||||
void plr_read_flags();
|
||||
void plr_read_info();
|
||||
void plr_read_settings();
|
||||
void plr_read_stats();
|
||||
void plr_read_stats_multi();
|
||||
void plr_read_multiplayer();
|
||||
void plr_read_variables();
|
||||
void plr_read_hud();
|
||||
void plr_read_controls();
|
||||
|
||||
void plr_write_flags();
|
||||
void plr_write_info();
|
||||
void plr_write_settings();
|
||||
void plr_write_stats();
|
||||
void plr_write_stats_multi();
|
||||
void plr_write_multiplayer();
|
||||
void plr_write_variables();
|
||||
void plr_write_hud();
|
||||
void plr_write_controls();
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CSG specific
|
||||
// --------------------------------------------------------------------
|
||||
void csg_reset_data();
|
||||
void csg_close();
|
||||
|
||||
void csg_read_flags();
|
||||
void csg_read_info();
|
||||
void csg_read_missions();
|
||||
void csg_read_techroom();
|
||||
void csg_read_loadout();
|
||||
void csg_read_stats();
|
||||
void csg_read_redalert();
|
||||
void csg_read_hud();
|
||||
void csg_read_variables();
|
||||
void csg_read_settings();
|
||||
void csg_read_controls();
|
||||
void csg_read_cutscenes();
|
||||
|
||||
void csg_write_flags();
|
||||
void csg_write_info();
|
||||
void csg_write_missions();
|
||||
void csg_write_techroom();
|
||||
void csg_write_loadout();
|
||||
void csg_write_stats();
|
||||
void csg_write_redalert();
|
||||
void csg_write_hud();
|
||||
void csg_write_variables();
|
||||
void csg_write_settings();
|
||||
void csg_write_controls();
|
||||
void csg_write_cutscenes();
|
||||
};
|
||||
|
||||
extern pilotfile Pilot;
|
||||
|
||||
extern void convert_pilot_files();
|
||||
|
||||
#endif // _PILOTFILE_H
|
||||
@@ -0,0 +1,145 @@
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "pilotfile/pilotfile_convert.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
|
||||
pilotfile_convert::pilotfile_convert()
|
||||
{
|
||||
fver = 0;
|
||||
|
||||
m_size_offset = 0;
|
||||
|
||||
cfp = NULL;
|
||||
plr = NULL;
|
||||
csg = NULL;
|
||||
}
|
||||
|
||||
pilotfile_convert::~pilotfile_convert()
|
||||
{
|
||||
if (cfp) {
|
||||
cfclose(cfp);
|
||||
}
|
||||
|
||||
if (plr) {
|
||||
delete plr;
|
||||
}
|
||||
|
||||
if (csg) {
|
||||
delete csg;
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::startSection(Section::id section_id)
|
||||
{
|
||||
Assert( cfp );
|
||||
|
||||
const int zero = 0;
|
||||
|
||||
cfwrite_ushort( (ushort)section_id, cfp );
|
||||
|
||||
// to be updated when endSection() is called
|
||||
cfwrite_int(zero, cfp);
|
||||
|
||||
// starting offset, for size of section
|
||||
m_size_offset = cftell(cfp);
|
||||
}
|
||||
|
||||
void pilotfile_convert::endSection()
|
||||
{
|
||||
Assert( cfp );
|
||||
Assert( m_size_offset > 0 );
|
||||
|
||||
size_t cur = cftell(cfp);
|
||||
|
||||
Assert( cur >= m_size_offset );
|
||||
|
||||
size_t section_size = cur - m_size_offset;
|
||||
|
||||
if (section_size) {
|
||||
// go back to section size in file and write proper value
|
||||
cfseek(cfp, cur - section_size - sizeof(int), CF_SEEK_SET);
|
||||
cfwrite_int((int)section_size, cfp);
|
||||
|
||||
// go back to previous location for next section
|
||||
cfseek(cfp, cur, CF_SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void convert_pilot_files()
|
||||
{
|
||||
size_t idx, j, i;
|
||||
size_t count, inf_count;
|
||||
SCP_vector<SCP_string> existing;
|
||||
SCP_vector<SCP_string> old_files;
|
||||
|
||||
// get list of pilots which already exist (new or converted already)
|
||||
cf_get_file_list(existing, CF_TYPE_PLAYERS, "*.plr");
|
||||
|
||||
// get list of old pilots which may need converting, starting with inferno pilots
|
||||
Get_file_list_child = "inferno";
|
||||
cf_get_file_list(old_files, CF_TYPE_SINGLE_PLAYERS, "*.pl2");
|
||||
inf_count = old_files.size();
|
||||
cf_get_file_list(old_files, CF_TYPE_SINGLE_PLAYERS, "*.pl2");
|
||||
|
||||
if ( old_files.empty() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// rip out all files which already exist
|
||||
i = 0;
|
||||
count = old_files.size();
|
||||
for (idx = 0; idx < existing.size(); idx++) {
|
||||
const char *fname = existing[idx].c_str();
|
||||
|
||||
for (j = 0; j < count; j++) {
|
||||
if ( !stricmp(fname, old_files[j].c_str()) ) {
|
||||
// NOTE: we just clear the name here to avoid the fragmentation
|
||||
// from resizing the vector
|
||||
old_files[j] = "";
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if everything is already converted then bail
|
||||
if (i == count) {
|
||||
return;
|
||||
}
|
||||
|
||||
mprintf(("PILOT: Beginning pilot file conversion...\n"));
|
||||
|
||||
// now proceed to convert all of the old files
|
||||
count = old_files.size();
|
||||
for (idx = 0; idx < count; idx++) {
|
||||
if ( old_files[idx].empty() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
pilotfile_convert *pcon = new pilotfile_convert;
|
||||
|
||||
bool inferno = (idx < inf_count);
|
||||
|
||||
if ( pcon->plr_convert(old_files[idx].c_str(), inferno) ) {
|
||||
SCP_vector<SCP_string> savefiles;
|
||||
|
||||
SCP_string wildcard(old_files[idx]);
|
||||
wildcard.append("*.cs2");
|
||||
|
||||
if (inferno) {
|
||||
Get_file_list_child = "inferno";
|
||||
}
|
||||
|
||||
cf_get_file_list(savefiles, CF_TYPE_SINGLE_PLAYERS, const_cast<char*>(wildcard.c_str()));
|
||||
|
||||
for (j = 0; j < savefiles.size(); j++) {
|
||||
pcon->csg_convert(savefiles[j].c_str(), inferno);
|
||||
}
|
||||
}
|
||||
|
||||
delete pcon;
|
||||
}
|
||||
|
||||
mprintf(("PILOT: Pilot file conversion complete!\n"));
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
|
||||
/* WARNING:
|
||||
* The conversion code is for converting pl2/plr versions 242 & 142 and cs2
|
||||
* version 15 ONLY!!!
|
||||
*
|
||||
* Those versions are the only ones that allow for the conversion process to
|
||||
* run without being directly tied to the active game data. Attempting
|
||||
* conversion on older versions will almost certainly result in data
|
||||
* corruption in the converted file!
|
||||
*/
|
||||
|
||||
/* NOTE:
|
||||
* Lots of duplicate info here for the old pilot file format. This is done
|
||||
* so that any future engine changes won't break the conversion process
|
||||
* or worrying about whether said changes would break anything. It also
|
||||
* allows for better conversion sanity checks, and allows for the conversion
|
||||
* process to run totally independently of current game data.
|
||||
*/
|
||||
|
||||
#define REDALERT_INTERNAL
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "stats/scoring.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "mission/missioncampaign.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "missionui/redalert.h"
|
||||
|
||||
|
||||
|
||||
typedef struct index_list_t {
|
||||
SCP_string name;
|
||||
int index;
|
||||
int val;
|
||||
|
||||
index_list_t() :
|
||||
index(-1), val(0)
|
||||
{
|
||||
}
|
||||
} index_list_t;
|
||||
|
||||
// special stats struct, since our use here is not content specific
|
||||
typedef struct scoring_special_t {
|
||||
int score;
|
||||
int rank;
|
||||
int assists;
|
||||
int kill_count;
|
||||
int kill_count_ok;
|
||||
int bonehead_kills;
|
||||
|
||||
unsigned int p_shots_fired;
|
||||
unsigned int p_shots_hit;
|
||||
unsigned int p_bonehead_hits;
|
||||
|
||||
unsigned int s_shots_fired;
|
||||
unsigned int s_shots_hit;
|
||||
unsigned int s_bonehead_hits;
|
||||
|
||||
unsigned int missions_flown;
|
||||
unsigned int flight_time;
|
||||
_fs_time_t last_flown;
|
||||
_fs_time_t last_backup;
|
||||
|
||||
SCP_vector<index_list_t> ship_kills;
|
||||
SCP_vector<index_list_t> medals_earned;
|
||||
|
||||
scoring_special_t() :
|
||||
score(0), rank(RANK_ENSIGN), assists(0), kill_count(0), kill_count_ok(0),
|
||||
bonehead_kills(0), p_shots_fired(0), p_shots_hit(0), p_bonehead_hits(0),
|
||||
s_shots_fired(0), s_shots_hit(0), s_bonehead_hits(0), missions_flown(0),
|
||||
flight_time(0), last_flown(0), last_backup(0)
|
||||
{
|
||||
}
|
||||
} scoring_special_t;
|
||||
|
||||
typedef struct cmission_conv_t {
|
||||
int index; // index into Campaign.missions[]
|
||||
int flags;
|
||||
|
||||
SCP_vector<mgoal> goals;
|
||||
SCP_vector<mevent> events;
|
||||
SCP_vector<sexp_variable> variables;
|
||||
|
||||
scoring_special_t stats;
|
||||
} cmission_conv_t;
|
||||
|
||||
typedef struct wss_unit_conv_t {
|
||||
int ship_index;
|
||||
int wep[12];
|
||||
int wep_count[12];
|
||||
|
||||
wss_unit_conv_t() :
|
||||
ship_index(-1)
|
||||
{
|
||||
}
|
||||
} wss_unit_conv_t;
|
||||
|
||||
typedef struct loadout_conv_t {
|
||||
SCP_string filename;
|
||||
SCP_string last_modified;
|
||||
|
||||
wss_unit_conv_t slot[12];
|
||||
|
||||
SCP_vector<int> weapon_pool;
|
||||
SCP_vector<int> ship_pool;
|
||||
} loadout_conv_t;
|
||||
|
||||
|
||||
struct plr_data {
|
||||
plr_data();
|
||||
~plr_data();
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// NOTE: we *do not* carry over the following items because they are either
|
||||
// obsolete, removed functionality, or just not needed. But we still
|
||||
// do have to take them into account during read ...
|
||||
//
|
||||
// - stats (ver 142 only)
|
||||
// - loadout (ver 142 only)
|
||||
// - techroom (ver 142 only)
|
||||
// - recent missions (ver 142 & 242)
|
||||
// - red alert (ver 142 only)
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// not carried over, just for reference during conversion process
|
||||
int version;
|
||||
int is_multi;
|
||||
|
||||
|
||||
// basic flags and settings
|
||||
int tips;
|
||||
int rank;
|
||||
int skill_level;
|
||||
int save_flags;
|
||||
int readyroom_listing_mode;
|
||||
int voice_enabled;
|
||||
int auto_advance;
|
||||
int Use_mouse_to_fly;
|
||||
int Mouse_sensitivity;
|
||||
int Joy_sensitivity;
|
||||
int Dead_zone_size;
|
||||
|
||||
// multiplayer settings/options
|
||||
int net_protocol;
|
||||
|
||||
unsigned char multi_squad_set;
|
||||
unsigned char multi_endgame_set;
|
||||
int multi_flags;
|
||||
unsigned int multi_respawn;
|
||||
unsigned char multi_max_observers;
|
||||
unsigned char multi_skill_level;
|
||||
unsigned char multi_voice_qos;
|
||||
int multi_voice_token_wait;
|
||||
int multi_voice_record_time;
|
||||
int multi_time_limit;
|
||||
int multi_kill_limit;
|
||||
|
||||
int multi_local_flags;
|
||||
int multi_local_update_level;
|
||||
|
||||
// pilot info stuff
|
||||
char image_filename[35];
|
||||
char squad_name[35];
|
||||
char squad_filename[35];
|
||||
char current_campaign[35];
|
||||
char last_ship_flown[35];
|
||||
|
||||
// HUD config
|
||||
int hud_show_flags;
|
||||
int hud_show_flags2;
|
||||
int hud_popup_flags;
|
||||
int hud_popup_flags2;
|
||||
unsigned char hud_num_lines;
|
||||
int hud_rp_flags;
|
||||
int hud_rp_dist;
|
||||
unsigned char hud_colors[39][4];
|
||||
|
||||
// control setup
|
||||
SCP_vector<config_item> controls;
|
||||
|
||||
int joy_axis_map_to[5];
|
||||
int joy_invert_axis[5];
|
||||
|
||||
// audio
|
||||
float sound_volume;
|
||||
float music_volume;
|
||||
float voice_volume;
|
||||
|
||||
// detail settings
|
||||
int detail_setting;
|
||||
int detail_nebula;
|
||||
int detail_distance;
|
||||
int detail_hardware_textures;
|
||||
int detail_num_debris;
|
||||
int detail_num_particles;
|
||||
int detail_num_stars;
|
||||
int detail_shield_effects;
|
||||
int detail_lighting;
|
||||
int detail_targetview_model;
|
||||
int detail_planets_suns;
|
||||
int detail_weapon_extras;
|
||||
|
||||
// variables
|
||||
SCP_vector<sexp_variable> variables;
|
||||
};
|
||||
|
||||
struct csg_data {
|
||||
csg_data();
|
||||
~csg_data();
|
||||
|
||||
int sig;
|
||||
int cutscenes;
|
||||
|
||||
SCP_string main_hall;
|
||||
int prev_mission;
|
||||
int next_mission;
|
||||
int loop_reentry;
|
||||
int loop_enabled;
|
||||
int num_completed;
|
||||
|
||||
int last_ship_flown_index;
|
||||
|
||||
SCP_vector<bool> ships_allowed;
|
||||
SCP_vector<bool> weapons_allowed;
|
||||
|
||||
SCP_vector<bool> ships_techroom;
|
||||
SCP_vector<bool> weapons_techroom;
|
||||
SCP_vector<bool> intel_techroom;
|
||||
|
||||
SCP_vector<index_list_t> ship_list;
|
||||
SCP_vector<index_list_t> weapon_list;
|
||||
SCP_vector<index_list_t> intel_list;
|
||||
SCP_vector<index_list_t> medals_list;
|
||||
|
||||
SCP_vector<cmission_conv_t> missions;
|
||||
|
||||
SCP_vector<sexp_variable> variables;
|
||||
|
||||
loadout_conv_t loadout;
|
||||
|
||||
scoring_special_t stats;
|
||||
|
||||
SCP_vector<red_alert_ship_status> wingman_status;
|
||||
SCP_string precursor_mission;
|
||||
};
|
||||
|
||||
class pilotfile_convert {
|
||||
public:
|
||||
pilotfile_convert();
|
||||
~pilotfile_convert();
|
||||
|
||||
bool load();
|
||||
void save();
|
||||
|
||||
bool plr_convert(const char *fname, bool inferno);
|
||||
bool csg_convert(const char *fname, bool inferno);
|
||||
|
||||
private:
|
||||
CFILE *cfp;
|
||||
unsigned int fver;
|
||||
|
||||
scoring_special_t all_time_stats;
|
||||
scoring_special_t multi_stats;
|
||||
|
||||
// sections of a pilot file. includes both plr and csg sections
|
||||
struct Section {
|
||||
enum id {
|
||||
Flags = 0x0001,
|
||||
Info = 0x0002,
|
||||
Loadout = 0x0003,
|
||||
Controls = 0x0004,
|
||||
Multiplayer = 0x0005,
|
||||
Scoring = 0x0006,
|
||||
ScoringMulti = 0x0007,
|
||||
Techroom = 0x0008,
|
||||
HUD = 0x0009,
|
||||
Settings = 0x0010,
|
||||
RedAlert = 0x0011,
|
||||
Variables = 0x0012,
|
||||
Missions = 0x0013
|
||||
};
|
||||
};
|
||||
|
||||
// for writing files, sets/updates section info
|
||||
void startSection(Section::id section_id);
|
||||
void endSection();
|
||||
// file offset of the size value for the current section (set with startSection())
|
||||
size_t m_size_offset;
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// PLR specific
|
||||
// --------------------------------------------------------------------
|
||||
plr_data *plr;
|
||||
|
||||
void plr_import();
|
||||
void plr_import_controls();
|
||||
void plr_import_hud();
|
||||
void plr_import_detail();
|
||||
void plr_import_stats();
|
||||
void plr_import_loadout();
|
||||
void plr_import_multiplayer();
|
||||
void plr_import_red_alert();
|
||||
void plr_import_variables();
|
||||
|
||||
void plr_export();
|
||||
void plr_export_flags();
|
||||
void plr_export_info();
|
||||
void plr_export_stats();
|
||||
void plr_export_stats_multi();
|
||||
void plr_export_hud();
|
||||
void plr_export_variables();
|
||||
void plr_export_multiplayer();
|
||||
void plr_export_controls();
|
||||
void plr_export_settings();
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CSG specific
|
||||
// --------------------------------------------------------------------
|
||||
csg_data *csg;
|
||||
|
||||
void csg_import(bool inferno);
|
||||
void csg_import_loadout();
|
||||
void csg_import_stats();
|
||||
void csg_import_techroom();
|
||||
void csg_import_red_alert();
|
||||
void csg_import_missions(bool inferno);
|
||||
void csg_import_ships_weapons();
|
||||
|
||||
void csg_export();
|
||||
void csg_export_flags();
|
||||
void csg_export_info();
|
||||
void csg_export_missions();
|
||||
void csg_export_techroom();
|
||||
void csg_export_loadout();
|
||||
void csg_export_stats();
|
||||
void csg_export_redalert();
|
||||
void csg_export_hud();
|
||||
void csg_export_variables();
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,915 @@
|
||||
|
||||
/* WARNING:
|
||||
* This is magic-number central, but these numbers are set specifically
|
||||
* to the acceptable defaults or range values that were used when the
|
||||
* pl2/plr files were created. Standard game defines should not be used in
|
||||
* place of these major numbers for /any/ reason, *ever*!
|
||||
*/
|
||||
|
||||
#include "pilotfile/pilotfile_convert.h"
|
||||
#include "network/psnet2.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "mission/missionbriefcommon.h"
|
||||
|
||||
|
||||
// this struct isn't well packed, and is written whole to the pilot file, so
|
||||
// we can't easily just get the RGBA that we need and instead must retain this
|
||||
typedef struct conv_color { //-V802
|
||||
uint screen_sig;
|
||||
ubyte red;
|
||||
ubyte green;
|
||||
ubyte blue;
|
||||
ubyte alpha;
|
||||
ubyte ac_type;
|
||||
int is_alphacolor;
|
||||
ubyte raw8;
|
||||
int alphacolor;
|
||||
int magic;
|
||||
} conv_color;
|
||||
|
||||
|
||||
plr_data::plr_data()
|
||||
{
|
||||
// not carried over, just for reference during conversion process
|
||||
version = 0;
|
||||
is_multi = 0;
|
||||
|
||||
|
||||
// basic flags and settings
|
||||
tips = 0;
|
||||
rank = 0;
|
||||
skill_level = 1;
|
||||
save_flags = 0;
|
||||
readyroom_listing_mode = 0;
|
||||
voice_enabled = 1;
|
||||
auto_advance = 1;
|
||||
Use_mouse_to_fly = 0;
|
||||
Mouse_sensitivity = 4;
|
||||
Joy_sensitivity = 9;
|
||||
Dead_zone_size = 10;
|
||||
|
||||
// multiplayer settings/options
|
||||
net_protocol = 1;
|
||||
|
||||
multi_squad_set = 2;
|
||||
multi_endgame_set = 3;
|
||||
multi_flags = 3;
|
||||
multi_respawn = 2;
|
||||
multi_max_observers = 2;
|
||||
multi_skill_level = 2;
|
||||
multi_voice_qos = 10;
|
||||
multi_voice_token_wait = 2000;
|
||||
multi_voice_record_time = 5000;
|
||||
multi_time_limit = -65536;
|
||||
multi_kill_limit = 9999;
|
||||
|
||||
multi_local_flags = 5;
|
||||
multi_local_update_level = 0;
|
||||
|
||||
// pilot info stuff
|
||||
memset(image_filename, 0, sizeof(image_filename));
|
||||
memset(squad_name, 0, sizeof(squad_name));
|
||||
memset(squad_filename, 0, sizeof(squad_filename));
|
||||
memset(current_campaign, 0, sizeof(current_campaign));
|
||||
memset(last_ship_flown, 0, sizeof(last_ship_flown));
|
||||
|
||||
// HUD config
|
||||
hud_show_flags = -1;
|
||||
hud_show_flags2 = 31;
|
||||
hud_popup_flags = 0;
|
||||
hud_popup_flags2 = 0;
|
||||
hud_num_lines = 4;
|
||||
hud_rp_flags = 7;
|
||||
hud_rp_dist = 2;
|
||||
|
||||
for (int idx = 0; idx < 39; idx++) {
|
||||
hud_colors[idx][0] = 0;
|
||||
hud_colors[idx][1] = 255;
|
||||
hud_colors[idx][2] = 0;
|
||||
hud_colors[idx][3] = 144;
|
||||
}
|
||||
|
||||
// control setup
|
||||
joy_axis_map_to[0] = 0;
|
||||
joy_axis_map_to[1] = 1;
|
||||
joy_axis_map_to[2] = 3;
|
||||
joy_invert_axis[3] = -1;
|
||||
joy_invert_axis[4] = -1;
|
||||
|
||||
memset(joy_invert_axis, 0, sizeof(joy_invert_axis));
|
||||
|
||||
// audio
|
||||
sound_volume = 1.0f;
|
||||
music_volume = 0.5f;
|
||||
voice_volume = 0.7f;
|
||||
|
||||
// detail settings
|
||||
detail_setting = 3;
|
||||
detail_nebula = 3;
|
||||
detail_distance = 3;
|
||||
detail_hardware_textures = 4;
|
||||
detail_num_debris = 4;
|
||||
detail_num_particles = 3;
|
||||
detail_num_stars = 4;
|
||||
detail_shield_effects = 4;
|
||||
detail_lighting = 4;
|
||||
detail_targetview_model = 1;
|
||||
detail_planets_suns = 1;
|
||||
detail_weapon_extras = 1;
|
||||
}
|
||||
|
||||
plr_data::~plr_data()
|
||||
{
|
||||
controls.clear();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_controls()
|
||||
{
|
||||
int idx;
|
||||
config_item con;
|
||||
|
||||
unsigned char num_controls = cfread_ubyte(cfp);
|
||||
|
||||
if ( !num_controls ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// it may be less than 118, but it shouldn't be more than 118
|
||||
if (num_controls > 118) {
|
||||
throw "Data check failure in controls!";
|
||||
}
|
||||
|
||||
plr->controls.reserve(num_controls);
|
||||
|
||||
for (idx = 0; idx < num_controls; idx++) {
|
||||
con.key_id = cfread_short(cfp);
|
||||
|
||||
if (con.key_id == 255) {
|
||||
con.key_id = -1;
|
||||
}
|
||||
|
||||
con.joy_id = cfread_short(cfp);
|
||||
|
||||
if (con.joy_id == 255) {
|
||||
con.joy_id = -1;
|
||||
}
|
||||
|
||||
plr->controls.push_back( con );
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_hud()
|
||||
{
|
||||
int idx;
|
||||
conv_color c;
|
||||
|
||||
plr->hud_show_flags = cfread_int(cfp);
|
||||
plr->hud_show_flags2 = cfread_int(cfp);
|
||||
|
||||
plr->hud_popup_flags = cfread_int(cfp);
|
||||
plr->hud_popup_flags2 = cfread_int(cfp);
|
||||
|
||||
plr->hud_num_lines = cfread_ubyte(cfp);
|
||||
plr->hud_rp_flags = cfread_int(cfp);
|
||||
plr->hud_rp_dist = cfread_int(cfp);
|
||||
|
||||
for (idx = 0; idx < 39; idx++) {
|
||||
cfread(&c, sizeof(conv_color), 1, cfp);
|
||||
|
||||
if ( (c.alphacolor != -1) || (c.is_alphacolor != 1) ) {
|
||||
throw "Data check failure in hud!";
|
||||
}
|
||||
|
||||
plr->hud_colors[idx][0] = c.red;
|
||||
plr->hud_colors[idx][1] = c.green;
|
||||
plr->hud_colors[idx][2] = c.blue;
|
||||
plr->hud_colors[idx][3] = c.alpha;
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_detail()
|
||||
{
|
||||
bool data_failure = false;
|
||||
|
||||
plr->detail_setting = cfread_int(cfp);
|
||||
plr->detail_nebula = cfread_int(cfp);
|
||||
plr->detail_distance = cfread_int(cfp);
|
||||
plr->detail_hardware_textures = cfread_int(cfp);
|
||||
plr->detail_num_debris = cfread_int(cfp);
|
||||
plr->detail_num_particles = cfread_int(cfp);
|
||||
plr->detail_num_stars = cfread_int(cfp);
|
||||
plr->detail_shield_effects = cfread_int(cfp);
|
||||
plr->detail_lighting = cfread_int(cfp);
|
||||
plr->detail_targetview_model = cfread_int(cfp);
|
||||
plr->detail_planets_suns = cfread_int(cfp);
|
||||
plr->detail_weapon_extras = cfread_int(cfp);
|
||||
|
||||
if ( (plr->detail_setting < -1) || (plr->detail_setting > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_nebula < 0) || (plr->detail_nebula > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_distance < 0) || (plr->detail_distance > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_hardware_textures < 0) || (plr->detail_hardware_textures > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_num_debris < 0) || (plr->detail_num_debris > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_num_particles < 0) || (plr->detail_num_particles > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_num_stars < 0) || (plr->detail_num_stars > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_shield_effects < 0) || (plr->detail_shield_effects > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_lighting < 0) || (plr->detail_lighting > 4) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_targetview_model < 0) || (plr->detail_targetview_model > 1) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_planets_suns < 0) || (plr->detail_planets_suns > 1) ) {
|
||||
data_failure = true;
|
||||
} else if ( (plr->detail_weapon_extras < 0) || (plr->detail_weapon_extras > 1) ) {
|
||||
data_failure = true;
|
||||
}
|
||||
|
||||
if (data_failure) {
|
||||
throw "Data check failure in details!";
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_stats()
|
||||
{
|
||||
int idx;
|
||||
char name[35];
|
||||
|
||||
if (fver >= 242) {
|
||||
return;
|
||||
}
|
||||
|
||||
// read everything, but we don't need any of it ...
|
||||
|
||||
cfread_int(cfp); // score
|
||||
cfread_int(cfp); // rank
|
||||
cfread_int(cfp); // assists
|
||||
|
||||
// medals
|
||||
for (idx = 0; idx < 18; idx++) {
|
||||
cfread_int(cfp);
|
||||
}
|
||||
|
||||
// kills per ship
|
||||
int count = cfread_int(cfp);
|
||||
|
||||
for (idx = 0; idx < count; idx++) {
|
||||
cfread_ushort(cfp);
|
||||
cfread_string_len(name, sizeof(name), cfp);
|
||||
}
|
||||
|
||||
cfread_int(cfp); // kill_count
|
||||
cfread_int(cfp); // kill_count_ok
|
||||
|
||||
cfread_uint(cfp); // p_shots_fired
|
||||
cfread_uint(cfp); // s_shots_fired
|
||||
cfread_uint(cfp); // p_shots_hit
|
||||
cfread_uint(cfp); // s_shots_hit
|
||||
|
||||
cfread_uint(cfp); // p_bonehead_hits
|
||||
cfread_uint(cfp); // s_bonehead_hits
|
||||
cfread_uint(cfp); // bonehead_kills
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_loadout()
|
||||
{
|
||||
int idx, j;
|
||||
int s_count, w_count;
|
||||
char name[52];
|
||||
|
||||
if (fver >= 242) {
|
||||
return;
|
||||
}
|
||||
|
||||
// have to read it, but don't need any of it ...
|
||||
|
||||
cfread_string_len(name, sizeof(name), cfp); // filename
|
||||
cfread_string_len(name, sizeof(name), cfp); // last_modified
|
||||
|
||||
s_count = cfread_int(cfp); // num ships
|
||||
w_count = cfread_int(cfp); // num weapons
|
||||
|
||||
// ships
|
||||
for (idx = 0; idx < s_count; idx++) {
|
||||
cfread_int(cfp); // count
|
||||
cfread_string_len(name, sizeof(name), cfp); // name
|
||||
}
|
||||
|
||||
// weapons
|
||||
for (idx = 0; idx < w_count; idx++) {
|
||||
cfread_int(cfp); // count
|
||||
cfread_string_len(name, sizeof(name), cfp); // name
|
||||
}
|
||||
|
||||
// loadout info
|
||||
for (idx = 0; idx < 12; idx++) {
|
||||
cfread_int(cfp); // ship class
|
||||
cfread_string_len(name, sizeof(name), cfp); // ship name
|
||||
|
||||
for (j = 0; j < 12; j++) {
|
||||
cfread_int(cfp); // weapon type
|
||||
cfread_int(cfp); // weapon count
|
||||
cfread_string_len(name, sizeof(name), cfp); // weapon name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_multiplayer()
|
||||
{
|
||||
plr->multi_squad_set = cfread_ubyte(cfp);
|
||||
plr->multi_endgame_set = cfread_ubyte(cfp);
|
||||
plr->multi_flags = cfread_int(cfp);
|
||||
plr->multi_respawn = cfread_uint(cfp);
|
||||
plr->multi_max_observers = cfread_ubyte(cfp);
|
||||
plr->multi_skill_level = cfread_ubyte(cfp);
|
||||
plr->multi_voice_qos = cfread_ubyte(cfp);
|
||||
plr->multi_voice_token_wait = cfread_int(cfp);
|
||||
plr->multi_voice_record_time = cfread_int(cfp);
|
||||
plr->multi_time_limit = cfread_int(cfp);
|
||||
plr->multi_kill_limit = cfread_int(cfp);
|
||||
|
||||
plr->multi_local_flags = cfread_int(cfp);
|
||||
plr->multi_local_update_level = cfread_int(cfp);
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_red_alert()
|
||||
{
|
||||
int idx, j;
|
||||
char name[35];
|
||||
|
||||
if (fver >= 242) {
|
||||
return;
|
||||
}
|
||||
|
||||
// have to read it, but don't need any of it ...
|
||||
|
||||
int num_slots = cfread_int(cfp);
|
||||
|
||||
if ( (num_slots < 0) || (num_slots >= 32) ) {
|
||||
throw "Data check failure in red-alert!";
|
||||
}
|
||||
|
||||
if ( !num_slots ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (idx = 0; idx < num_slots; idx++) {
|
||||
cfread_string(name, sizeof(name) - 1, cfp);
|
||||
cfread_float(cfp);
|
||||
|
||||
cfread_string_len(name, sizeof(name), cfp);
|
||||
|
||||
// subsystem hits
|
||||
for (j = 0; j < 64; j++) {
|
||||
cfread_float(cfp);
|
||||
}
|
||||
|
||||
// aggregate hits
|
||||
for (j = 0; j < 12; j++) {
|
||||
cfread_float(cfp);
|
||||
}
|
||||
|
||||
// weapons
|
||||
for (j = 0; j < 12; j++) {
|
||||
cfread_string_len(name, sizeof(name), cfp);
|
||||
cfread_int(cfp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import_variables()
|
||||
{
|
||||
int idx;
|
||||
sexp_variable nvar;
|
||||
|
||||
int num_variables = cfread_int(cfp);
|
||||
|
||||
if ( (num_variables < 0) || (num_variables >= 100) ) {
|
||||
throw "Data check failure in variables!";
|
||||
}
|
||||
|
||||
plr->variables.reserve(num_variables);
|
||||
|
||||
for (idx = 0; idx < num_variables; idx++) {
|
||||
nvar.type = cfread_int(cfp);
|
||||
cfread_string_len(nvar.text, sizeof(nvar.text), cfp);
|
||||
cfread_string_len(nvar.variable_name, sizeof(nvar.variable_name), cfp);
|
||||
|
||||
plr->variables.push_back( nvar );
|
||||
}
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_import()
|
||||
{
|
||||
char name[35];
|
||||
int idx;
|
||||
|
||||
unsigned int plr_id = cfread_uint(cfp);
|
||||
|
||||
if (plr_id != 0x46505346) {
|
||||
throw "Invalid file signature!";
|
||||
}
|
||||
|
||||
fver = cfread_uint(cfp);
|
||||
|
||||
if ( (fver != 142) && (fver != 242) ) {
|
||||
throw "Unsupported file version!";
|
||||
}
|
||||
|
||||
// multi flag, don't need it
|
||||
cfread_ubyte(cfp);
|
||||
|
||||
// rank
|
||||
plr->rank = cfread_int(cfp);
|
||||
|
||||
// mainhall, don't need it
|
||||
if (fver < 242) {
|
||||
cfread_ubyte(cfp);
|
||||
}
|
||||
|
||||
plr->tips = cfread_int(cfp);
|
||||
|
||||
if ( (plr->tips < 0) || (plr->tips > 1) ) {
|
||||
throw "Data check failure!";
|
||||
}
|
||||
|
||||
cfread_string_len(plr->image_filename, sizeof(plr->image_filename), cfp);
|
||||
cfread_string_len(plr->squad_name, sizeof(plr->squad_name), cfp);
|
||||
cfread_string_len(plr->squad_filename, sizeof(plr->squad_filename), cfp);
|
||||
cfread_string_len(plr->current_campaign, sizeof(plr->current_campaign), cfp);
|
||||
cfread_string_len(plr->last_ship_flown, sizeof(plr->last_ship_flown), cfp);
|
||||
|
||||
// controls
|
||||
plr_import_controls();
|
||||
|
||||
// hud config
|
||||
plr_import_hud();
|
||||
|
||||
// cutscenes, don't need it
|
||||
if (fver < 242) {
|
||||
cfread_int(cfp);
|
||||
}
|
||||
|
||||
// volume stuff
|
||||
plr->sound_volume = cfread_float(cfp);
|
||||
plr->music_volume = cfread_float(cfp);
|
||||
plr->voice_volume = cfread_float(cfp);
|
||||
|
||||
// detail settings
|
||||
plr_import_detail();
|
||||
|
||||
// recent missions, don't need it
|
||||
int num_missions = cfread_int(cfp);
|
||||
|
||||
for (idx = 0; idx < num_missions; idx++) {
|
||||
cfread_string_len(name, sizeof(name), cfp);
|
||||
}
|
||||
|
||||
// stats, will skip if fver < 242
|
||||
plr_import_stats();
|
||||
|
||||
plr->skill_level = cfread_int(cfp);
|
||||
|
||||
if ( (plr->skill_level < 0) || (plr->skill_level > 4) ) {
|
||||
throw "Data check failure!";
|
||||
}
|
||||
|
||||
// extra joystick stuff
|
||||
for (idx = 0; idx < 5; idx++) {
|
||||
plr->joy_axis_map_to[idx] = cfread_int(cfp);
|
||||
plr->joy_invert_axis[idx] = cfread_int(cfp);
|
||||
}
|
||||
|
||||
// flags
|
||||
plr->save_flags = cfread_int(cfp);
|
||||
|
||||
// loadout, will skip if fver < 242
|
||||
plr_import_loadout();
|
||||
|
||||
// multiplayer
|
||||
plr_import_multiplayer();
|
||||
|
||||
// two briefing related values
|
||||
plr->readyroom_listing_mode = cfread_int(cfp);
|
||||
Briefing_voice_enabled = cfread_int(cfp);
|
||||
|
||||
plr->net_protocol = cfread_int(cfp);
|
||||
|
||||
// protocol must be set to something
|
||||
if (plr->net_protocol == NET_NONE) {
|
||||
plr->net_protocol = NET_TCP;
|
||||
} else if ( (plr->net_protocol < 0) || (plr->net_protocol > NET_VMT) ) {
|
||||
throw "Data check failure!";
|
||||
}
|
||||
|
||||
// red alert status, will skip if fver < 242 (and should be empty if multi)
|
||||
plr_import_red_alert();
|
||||
|
||||
// briefing auto-advance
|
||||
plr->auto_advance = cfread_int(cfp);
|
||||
|
||||
if ( (plr->auto_advance < 0) || (plr->auto_advance > 1) ) {
|
||||
throw "Data check failure!";
|
||||
}
|
||||
|
||||
// some input options
|
||||
plr->Use_mouse_to_fly = cfread_int(cfp);
|
||||
plr->Mouse_sensitivity = cfread_int(cfp);
|
||||
plr->Joy_sensitivity = cfread_int(cfp);
|
||||
plr->Dead_zone_size = cfread_int(cfp);
|
||||
|
||||
// variables
|
||||
plr_import_variables();
|
||||
|
||||
|
||||
// and... we're done! :)
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_flags()
|
||||
{
|
||||
startSection(Section::Flags);
|
||||
|
||||
// tips
|
||||
cfwrite_ubyte((unsigned char)plr->tips, cfp);
|
||||
|
||||
// saved flags
|
||||
cfwrite_int(plr->save_flags, cfp);
|
||||
|
||||
// listing mode (single or campaign missions)
|
||||
cfwrite_int(plr->readyroom_listing_mode, cfp);
|
||||
|
||||
// briefing auto-play
|
||||
cfwrite_int(plr->auto_advance, cfp);
|
||||
|
||||
// special rank setting (to avoid having to read all stats on verify)
|
||||
cfwrite_int(plr->rank, cfp);
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_info()
|
||||
{
|
||||
startSection(Section::Info);
|
||||
|
||||
// pilot image
|
||||
cfwrite_string_len(plr->image_filename, cfp);
|
||||
|
||||
// squad name
|
||||
cfwrite_string_len(plr->squad_name, cfp);
|
||||
|
||||
// squad image
|
||||
cfwrite_string_len(plr->squad_filename, cfp);
|
||||
|
||||
// active campaign
|
||||
cfwrite_string_len(plr->current_campaign, cfp);
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_stats()
|
||||
{
|
||||
int idx, list_size = 0;
|
||||
|
||||
startSection(Section::Scoring);
|
||||
|
||||
// global, all-time stats
|
||||
cfwrite_int(all_time_stats.score, cfp);
|
||||
cfwrite_int(all_time_stats.rank, cfp);
|
||||
cfwrite_int(all_time_stats.assists, cfp);
|
||||
cfwrite_int(all_time_stats.kill_count, cfp);
|
||||
cfwrite_int(all_time_stats.kill_count_ok, cfp);
|
||||
cfwrite_int(all_time_stats.bonehead_kills, cfp);
|
||||
|
||||
cfwrite_uint(all_time_stats.p_shots_fired, cfp);
|
||||
cfwrite_uint(all_time_stats.p_shots_hit, cfp);
|
||||
cfwrite_uint(all_time_stats.p_bonehead_hits, cfp);
|
||||
|
||||
cfwrite_uint(all_time_stats.s_shots_fired, cfp);
|
||||
cfwrite_uint(all_time_stats.s_shots_hit, cfp);
|
||||
cfwrite_uint(all_time_stats.s_bonehead_hits, cfp);
|
||||
|
||||
cfwrite_uint(all_time_stats.flight_time, cfp);
|
||||
cfwrite_uint(all_time_stats.missions_flown, cfp);
|
||||
cfwrite_int((int)all_time_stats.last_flown, cfp);
|
||||
cfwrite_int((int)all_time_stats.last_backup, cfp);
|
||||
|
||||
// ship kills (contains ships across all mods, not just current)
|
||||
list_size = (int)all_time_stats.ship_kills.size();
|
||||
cfwrite_int(list_size, cfp);
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
cfwrite_string_len(all_time_stats.ship_kills[idx].name.c_str(), cfp);
|
||||
cfwrite_int(all_time_stats.ship_kills[idx].val, cfp);
|
||||
}
|
||||
|
||||
// medals earned (contains medals across all mods, not just current)
|
||||
list_size = (int)all_time_stats.medals_earned.size();
|
||||
cfwrite_int(list_size, cfp);
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
cfwrite_string_len(all_time_stats.medals_earned[idx].name.c_str(), cfp);
|
||||
cfwrite_int(all_time_stats.medals_earned[idx].val, cfp);
|
||||
}
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_stats_multi()
|
||||
{
|
||||
int idx, list_size = 0;
|
||||
|
||||
startSection(Section::ScoringMulti);
|
||||
|
||||
// global, all-time stats
|
||||
cfwrite_int(multi_stats.score, cfp);
|
||||
cfwrite_int(multi_stats.rank, cfp);
|
||||
cfwrite_int(multi_stats.assists, cfp);
|
||||
cfwrite_int(multi_stats.kill_count, cfp);
|
||||
cfwrite_int(multi_stats.kill_count_ok, cfp);
|
||||
cfwrite_int(multi_stats.bonehead_kills, cfp);
|
||||
|
||||
cfwrite_uint(multi_stats.p_shots_fired, cfp);
|
||||
cfwrite_uint(multi_stats.p_shots_hit, cfp);
|
||||
cfwrite_uint(multi_stats.p_bonehead_hits, cfp);
|
||||
|
||||
cfwrite_uint(multi_stats.s_shots_fired, cfp);
|
||||
cfwrite_uint(multi_stats.s_shots_hit, cfp);
|
||||
cfwrite_uint(multi_stats.s_bonehead_hits, cfp);
|
||||
|
||||
cfwrite_uint(multi_stats.flight_time, cfp);
|
||||
cfwrite_uint(multi_stats.missions_flown, cfp);
|
||||
cfwrite_int((int)multi_stats.last_flown, cfp);
|
||||
cfwrite_int((int)multi_stats.last_backup, cfp);
|
||||
|
||||
// ship kills (contains medals across all mods, not just current)
|
||||
list_size = (int)multi_stats.ship_kills.size();
|
||||
cfwrite_int(list_size, cfp);
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
cfwrite_string_len(multi_stats.ship_kills[idx].name.c_str(), cfp);
|
||||
cfwrite_int(multi_stats.ship_kills[idx].val, cfp);
|
||||
}
|
||||
|
||||
// medals earned (contains medals across all mods, not just current)
|
||||
list_size = (int)multi_stats.medals_earned.size();
|
||||
cfwrite_int(list_size, cfp);
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
cfwrite_string_len(multi_stats.medals_earned[idx].name.c_str(), cfp);
|
||||
cfwrite_int(multi_stats.medals_earned[idx].val, cfp);
|
||||
}
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_hud()
|
||||
{
|
||||
int idx;
|
||||
|
||||
startSection(Section::HUD);
|
||||
|
||||
// flags
|
||||
cfwrite_int(plr->hud_show_flags, cfp);
|
||||
cfwrite_int(plr->hud_show_flags2, cfp);
|
||||
|
||||
cfwrite_int(plr->hud_popup_flags, cfp);
|
||||
cfwrite_int(plr->hud_popup_flags2, cfp);
|
||||
|
||||
// settings
|
||||
cfwrite_ubyte(plr->hud_num_lines, cfp);
|
||||
|
||||
cfwrite_int(plr->hud_rp_flags, cfp);
|
||||
cfwrite_int(plr->hud_rp_dist, cfp);
|
||||
|
||||
// basic colors
|
||||
cfwrite_int(0, cfp); // color
|
||||
cfwrite_int(8, cfp); // alpha
|
||||
|
||||
// gauge-specific colors
|
||||
cfwrite_int(39, cfp);
|
||||
|
||||
for (idx = 0; idx < 39; idx++) {
|
||||
cfwrite_ubyte(plr->hud_colors[idx][0], cfp);
|
||||
cfwrite_ubyte(plr->hud_colors[idx][1], cfp);
|
||||
cfwrite_ubyte(plr->hud_colors[idx][2], cfp);
|
||||
cfwrite_ubyte(plr->hud_colors[idx][3], cfp);
|
||||
}
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_variables()
|
||||
{
|
||||
int list_size = 0;
|
||||
int idx;
|
||||
|
||||
startSection(Section::Variables);
|
||||
|
||||
list_size = (int)plr->variables.size();
|
||||
|
||||
cfwrite_int(list_size, cfp);
|
||||
|
||||
for (idx = 0; idx < list_size; idx++) {
|
||||
cfwrite_int(plr->variables[idx].type, cfp);
|
||||
cfwrite_string_len(plr->variables[idx].text, cfp);
|
||||
cfwrite_string_len(plr->variables[idx].variable_name, cfp);
|
||||
}
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_multiplayer()
|
||||
{
|
||||
startSection(Section::Multiplayer);
|
||||
|
||||
// netgame options
|
||||
cfwrite_ubyte(plr->multi_squad_set, cfp);
|
||||
cfwrite_ubyte(plr->multi_endgame_set, cfp);
|
||||
cfwrite_int(plr->multi_flags, cfp);
|
||||
cfwrite_uint(plr->multi_respawn, cfp);
|
||||
cfwrite_ubyte(plr->multi_max_observers, cfp);
|
||||
cfwrite_ubyte(plr->multi_skill_level, cfp);
|
||||
cfwrite_ubyte(plr->multi_voice_qos, cfp);
|
||||
cfwrite_int(plr->multi_voice_token_wait, cfp);
|
||||
cfwrite_int(plr->multi_voice_record_time, cfp);
|
||||
cfwrite_int(plr->multi_time_limit, cfp);
|
||||
cfwrite_int(plr->multi_kill_limit, cfp);
|
||||
|
||||
// local options
|
||||
cfwrite_int(plr->multi_local_flags, cfp);
|
||||
cfwrite_int(plr->multi_local_update_level, cfp);
|
||||
|
||||
// netgame protocol
|
||||
cfwrite_int(plr->net_protocol, cfp);
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_controls()
|
||||
{
|
||||
unsigned int idx;
|
||||
|
||||
startSection(Section::Controls);
|
||||
|
||||
cfwrite_ushort((unsigned short)plr->controls.size(), cfp);
|
||||
|
||||
for (idx = 0; idx < plr->controls.size(); idx++) {
|
||||
cfwrite_short(plr->controls[idx].key_id, cfp);
|
||||
cfwrite_short(plr->controls[idx].joy_id, cfp);
|
||||
// placeholder? for future mouse_id?
|
||||
cfwrite_short(-1, cfp);
|
||||
}
|
||||
|
||||
// extra joystick stuff
|
||||
for (idx = 0; idx < 5; idx++) {
|
||||
cfwrite_int(plr->joy_axis_map_to[idx], cfp);
|
||||
cfwrite_int(plr->joy_invert_axis[idx], cfp);
|
||||
}
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export_settings()
|
||||
{
|
||||
startSection(Section::Settings);
|
||||
|
||||
// sound/voice/music
|
||||
cfwrite_float(plr->sound_volume, cfp);
|
||||
cfwrite_float(plr->music_volume, cfp);
|
||||
cfwrite_float(plr->voice_volume, cfp);
|
||||
|
||||
cfwrite_int(plr->voice_enabled, cfp);
|
||||
|
||||
// skill level
|
||||
cfwrite_int(plr->skill_level, cfp);
|
||||
|
||||
// input options
|
||||
cfwrite_int(plr->Use_mouse_to_fly, cfp);
|
||||
cfwrite_int(plr->Mouse_sensitivity, cfp);
|
||||
cfwrite_int(plr->Joy_sensitivity, cfp);
|
||||
cfwrite_int(plr->Dead_zone_size, cfp);
|
||||
|
||||
// detail
|
||||
cfwrite_int(plr->detail_setting, cfp);
|
||||
cfwrite_int(plr->detail_nebula, cfp);
|
||||
cfwrite_int(plr->detail_distance, cfp);
|
||||
cfwrite_int(plr->detail_hardware_textures, cfp);
|
||||
cfwrite_int(plr->detail_num_debris, cfp);
|
||||
cfwrite_int(plr->detail_num_particles, cfp);
|
||||
cfwrite_int(plr->detail_num_stars, cfp);
|
||||
cfwrite_int(plr->detail_shield_effects, cfp);
|
||||
cfwrite_int(plr->detail_lighting, cfp);
|
||||
cfwrite_int(plr->detail_targetview_model, cfp);
|
||||
cfwrite_int(plr->detail_planets_suns, cfp);
|
||||
cfwrite_int(plr->detail_weapon_extras, cfp);
|
||||
|
||||
endSection();
|
||||
}
|
||||
|
||||
void pilotfile_convert::plr_export()
|
||||
{
|
||||
Assert( cfp != NULL );
|
||||
|
||||
// header and version
|
||||
cfwrite_int(0x5f524c50, cfp);
|
||||
cfwrite_ubyte(0, cfp);
|
||||
|
||||
// flags and info sections go first
|
||||
plr_export_flags();
|
||||
plr_export_info();
|
||||
|
||||
// everything else is next, not order specific
|
||||
plr_export_stats();
|
||||
plr_export_stats_multi();
|
||||
plr_export_hud();
|
||||
plr_export_variables();
|
||||
plr_export_multiplayer();
|
||||
plr_export_controls();
|
||||
plr_export_settings();
|
||||
|
||||
|
||||
// and... we're done! :)
|
||||
}
|
||||
|
||||
bool pilotfile_convert::plr_convert(const char *fname, bool inferno)
|
||||
{
|
||||
Assert( fname != NULL );
|
||||
|
||||
SCP_string filename;
|
||||
bool rval = true;
|
||||
|
||||
|
||||
if (plr == NULL) {
|
||||
plr = new(std::nothrow) plr_data;
|
||||
}
|
||||
|
||||
if (plr == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
filename.reserve(200);
|
||||
|
||||
cf_create_default_path_string(filename, CF_TYPE_SINGLE_PLAYERS, (inferno) ? const_cast<char*>("inferno") : NULL);
|
||||
|
||||
if (inferno) {
|
||||
filename.append(DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
filename.append(fname);
|
||||
filename.append(".pl2");
|
||||
|
||||
mprintf((" PL2 => Converting '%s'...\n", filename.c_str()));
|
||||
|
||||
cfp = cfopen(const_cast<char*>(filename.c_str()), "rb", CFILE_NORMAL);
|
||||
|
||||
if ( !cfp ) {
|
||||
mprintf((" PL2 => Unable to open for import!\n", fname));
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
plr_import();
|
||||
} catch (const char *err) {
|
||||
mprintf(( " PL2 => Import ERROR: %s\n", err));
|
||||
rval = false;
|
||||
}
|
||||
|
||||
cfclose(cfp);
|
||||
cfp = NULL;
|
||||
|
||||
if ( !rval ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
filename.assign(fname);
|
||||
filename.append(".plr");
|
||||
|
||||
cfp = cfopen(const_cast<char*>(filename.c_str()), "wb", CFILE_NORMAL, CF_TYPE_PLAYERS);
|
||||
|
||||
if ( !cfp ) {
|
||||
mprintf((" PLR => Unable to open for export!\n", fname));
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
plr_export();
|
||||
} catch (const char *err) {
|
||||
mprintf((" PLR => Export ERROR: %s\n", err));
|
||||
rval = false;
|
||||
}
|
||||
|
||||
cfclose(cfp);
|
||||
cfp = NULL;
|
||||
|
||||
if (rval) {
|
||||
mprintf((" PLR => Conversion complete!\n"));
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
+222
-1276
File diff suppressed because it is too large.
Load diff
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct CFILE;
|
||||
struct player;
|
||||
|
||||
#define VALID_PILOT_CHARS " _-"
|
||||
@@ -29,30 +28,6 @@ extern char Pilot_squad_images_arr[MAX_PILOT_IMAGES][MAX_FILENAME_LEN];
|
||||
extern char *Pilot_squad_image_names[MAX_PILOT_IMAGES];
|
||||
extern int Num_pilot_squad_images;
|
||||
|
||||
// low-level read/writes to files
|
||||
int read_int(CFILE *file);
|
||||
short read_short(CFILE *file);
|
||||
ubyte read_byte(CFILE *file);
|
||||
void write_int(int i, CFILE *file);
|
||||
void write_short(short s, CFILE *file);
|
||||
void write_byte(ubyte i, CFILE *file);
|
||||
|
||||
void read_string(char *s, CFILE *f);
|
||||
void write_string(char *s, CFILE *f);
|
||||
|
||||
// two ways of determining if a given pilot is multiplayer
|
||||
// note, that the first version of this function can possibly return -1 if the file is invalid, etc.
|
||||
int is_pilot_multi(CFILE *fp); // pass a newly opened (at the beginning) file pointer to the pilot file itself
|
||||
int is_pilot_multi(player *p); // pass a pointer to a player struct
|
||||
|
||||
int verify_pilot_file(char *filename, int single = 1, int *rank = NULL);
|
||||
int pilot_file_upgrade_check(char *callsign, int single = 1);
|
||||
int read_pilot_file(char* callsign, int single = 1, player *p = NULL);
|
||||
int write_pilot_file(player *p = NULL);
|
||||
|
||||
// function to get default pilot callsign for game
|
||||
void choose_pilot();
|
||||
|
||||
void init_new_pilot(player *p, int reset = 1);
|
||||
|
||||
// load up the list of pilot image filenames (do this at game startup as well as barracks startup)
|
||||
@@ -77,6 +52,4 @@ void pilot_format_callsign_personal(char *in_callsign,char *out_callsign);
|
||||
// 1 == ok to overwrite, 0 == not ok
|
||||
int pilot_verify_overwrite();
|
||||
|
||||
// functions that update player information that is stored in PLR file
|
||||
void update_missions_played(int mission_number);
|
||||
void clear_missions_played();
|
||||
void pilot_set_start_campaign(player* p);
|
||||
+2
-133
@@ -82,6 +82,7 @@ typedef struct campaign_stats {
|
||||
} campaign_stats;
|
||||
|
||||
typedef struct player {
|
||||
void reset();
|
||||
|
||||
char callsign[CALLSIGN_LEN + 1];
|
||||
char short_callsign[CALLSIGN_LEN + 1]; // callsign truncated to SHORT_CALLSIGN_PIXEL_W pixels
|
||||
@@ -89,12 +90,9 @@ typedef struct player {
|
||||
char image_filename[MAX_FILENAME_LEN]; // filename of the image for this pilot
|
||||
char squad_filename[MAX_FILENAME_LEN]; // filename of the squad image for this pilot
|
||||
char squad_name[NAME_LENGTH + 1]; // pilot's squadron name
|
||||
int num_campaigns; // tells how many array entries in the campaigns field
|
||||
char current_campaign[MAX_FILENAME_LEN]; // Name of the currently active campaign, or zero-length string if none
|
||||
campaign_info *campaigns; // holds information regarding all active campaigns the player is playing
|
||||
int readyroom_listing_mode;
|
||||
|
||||
ubyte main_hall; // Goober5000 - now allows 256 halls; I didn't make this int because it would mess up the file compatibility
|
||||
int flags;
|
||||
int save_flags;
|
||||
|
||||
@@ -198,142 +196,13 @@ typedef struct player {
|
||||
ubyte show_skip_popup; // false if dude clicked "don't show this again" -- persists for current mission only
|
||||
|
||||
// player-persistent variables - Goober5000
|
||||
int num_variables;
|
||||
sexp_variable player_variables[MAX_SEXP_VARIABLES];
|
||||
SCP_vector<sexp_variable> variables;
|
||||
|
||||
SCP_string death_message; // Goober5000
|
||||
|
||||
control_info lua_ci; // copy of control info for scripting purposes (not to disturb real controls).
|
||||
button_info lua_bi; // copy of button info for scripting purposes (not to disturb real controls).
|
||||
button_info lua_bi_full; // gets all the button controls, not just the ones usually allowed
|
||||
|
||||
//CommanderDJ - constructor to initialise everything to safe defaults.
|
||||
//mostly copied from player::reset() in Antipodes 8
|
||||
player()
|
||||
{
|
||||
memset(callsign, 0, sizeof(callsign));
|
||||
memset(short_callsign, 0, sizeof(short_callsign));
|
||||
|
||||
short_callsign_width = 0;
|
||||
memset(image_filename, 0, sizeof(image_filename));
|
||||
memset(squad_filename, 0, sizeof(squad_filename));
|
||||
memset(squad_name, 0, sizeof(squad_name));
|
||||
|
||||
memset(current_campaign, 0, sizeof(current_campaign));
|
||||
|
||||
main_hall = 0;
|
||||
|
||||
readyroom_listing_mode = 0;
|
||||
flags = 0;
|
||||
save_flags = 0;
|
||||
|
||||
memset(keyed_targets, 0, sizeof(keyed_targets));
|
||||
current_hotkey_set = -1;
|
||||
|
||||
lead_target_pos = vmd_zero_vector;
|
||||
lead_target_cheat = 0;
|
||||
lead_indicator_active = 0;
|
||||
|
||||
lock_indicator_x = 0;
|
||||
lock_indicator_y = 0;
|
||||
lock_indicator_start_x = 0;
|
||||
lock_indicator_start_y = 0;
|
||||
lock_indicator_visible = 0;
|
||||
lock_time_to_target = 0.0f;
|
||||
lock_dist_to_target = 0.0f;
|
||||
|
||||
last_ship_flown_si_index = -1;
|
||||
|
||||
objnum = -1;
|
||||
|
||||
memset(&bi, 0, sizeof(button_info));
|
||||
memset(&ci, 0, sizeof(control_info));
|
||||
|
||||
init_scoring_element(&stats);
|
||||
|
||||
friendly_hits = 0;
|
||||
friendly_damage = 0.0f;
|
||||
friendly_last_hit_time = 0;
|
||||
last_warning_message_time = 0;
|
||||
|
||||
control_mode = 0;
|
||||
saved_viewer_mode = 0;
|
||||
|
||||
check_warn_timestamp = -1;
|
||||
|
||||
distance_warning_count = 0;
|
||||
distance_warning_time = -1;
|
||||
|
||||
allow_warn_timestamp = -1;
|
||||
warn_count = 0;
|
||||
|
||||
damage_this_burst = 0.0f;
|
||||
|
||||
repair_sound_loop = -1;
|
||||
cargo_scan_loop = -1;
|
||||
|
||||
praise_count = 0;
|
||||
allow_praise_timestamp = -1;
|
||||
praise_delay_timestamp = -1;
|
||||
|
||||
ask_help_count = 0;
|
||||
allow_ask_help_timestamp = -1;
|
||||
|
||||
scream_count = 0;
|
||||
allow_scream_timestamp = -1;
|
||||
|
||||
low_ammo_complaint_count = 0;
|
||||
allow_ammo_timestamp = -1;
|
||||
|
||||
praise_self_count = 0;
|
||||
praise_self_timestamp = -1;
|
||||
|
||||
subsys_in_view = -1;
|
||||
request_repair_timestamp = -1;
|
||||
|
||||
cargo_inspect_time = -1;
|
||||
target_is_dying = -1;
|
||||
current_target_sx = 0;
|
||||
current_target_sy = 0;
|
||||
target_in_lock_cone = 0;
|
||||
locking_subsys = NULL;
|
||||
locking_subsys_parent = -1;
|
||||
locking_on_center = 0;
|
||||
|
||||
killer_objtype = -1;
|
||||
killer_species = 0;
|
||||
killer_weapon_index = -1;
|
||||
memset(killer_parent_name, 0, sizeof(killer_parent_name));
|
||||
|
||||
check_for_all_alone_msg = -1;
|
||||
|
||||
update_dumbfire_time = -1;
|
||||
update_lock_time = -1;
|
||||
threat_flags = 0;
|
||||
auto_advance = 1;
|
||||
|
||||
multi_options_set_local_defaults(&m_local_options);
|
||||
multi_options_set_netgame_defaults(&m_server_options);
|
||||
|
||||
insignia_texture = -1;
|
||||
|
||||
tips = 1;
|
||||
|
||||
shield_penalty_stamp = 0;
|
||||
|
||||
failures_this_session = 0;
|
||||
show_skip_popup = 0;
|
||||
|
||||
num_variables = 0;
|
||||
memset(player_variables, 0, sizeof(player_variables));
|
||||
|
||||
death_message = "";
|
||||
|
||||
memset(&lua_ci, 0, sizeof(control_info));
|
||||
memset(&lua_bi, 0, sizeof(button_info));
|
||||
memset(&lua_bi_full, 0, sizeof(button_info));
|
||||
}
|
||||
|
||||
} player;
|
||||
|
||||
extern player Players[MAX_PLAYERS];
|
||||
|
||||
@@ -1277,7 +1277,6 @@ void player_init()
|
||||
{
|
||||
Player_num = 0;
|
||||
Player = &Players[Player_num];
|
||||
Player->num_campaigns = 0;
|
||||
Player->flags |= PLAYER_FLAGS_STRUCTURE_IN_USE;
|
||||
Player->failures_this_session = 0;
|
||||
Player->show_skip_popup = (ubyte) 1;
|
||||
|
||||
+17
-3
@@ -300,6 +300,7 @@ flag_def_list Ship_flags[] = {
|
||||
{ "gun convergence", SIF2_GUN_CONVERGENCE, 1 },
|
||||
{ "no thruster geometry noise", SIF2_NO_THRUSTER_GEO_NOISE, 1 },
|
||||
{ "intrinsic no shields", SIF2_INTRINSIC_NO_SHIELDS, 1 },
|
||||
{ "dynamic primary linking", SIF2_DYN_PRIMARY_LINKING, 1 },
|
||||
{ "no primary linking", SIF2_NO_PRIMARY_LINKING, 1 },
|
||||
{ "no pain flash", SIF2_NO_PAIN_FLASH, 1 },
|
||||
{ "no ets", SIF2_NO_ETS, 1 },
|
||||
@@ -8368,6 +8369,7 @@ void ship_set_default_weapons(ship *shipp, ship_info *sip)
|
||||
// Later, this will happen in the weapon loadout screen.
|
||||
for (i=0; i < MAX_SHIP_PRIMARY_BANKS; i++){
|
||||
swp->primary_bank_weapons[i] = sip->primary_bank_weapons[i];
|
||||
swp->primary_bank_slot_count[i] = 1; // RSAXVC DYN LINK CODE
|
||||
}
|
||||
|
||||
for (i=0; i < MAX_SHIP_SECONDARY_BANKS; i++){
|
||||
@@ -9942,7 +9944,11 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
|
||||
swp->last_primary_fire_stamp[bank_to_fire] = timestamp();
|
||||
}
|
||||
|
||||
if (winfo_p->wi_flags2 & WIF2_CYCLE){
|
||||
if (sip->flags2 & SIF2_DYN_PRIMARY_LINKING ) {
|
||||
Assert(pm->gun_banks[bank_to_fire].num_slots != 0);
|
||||
swp->next_primary_fire_stamp[bank_to_fire] = timestamp((int)(next_fire_delay * ( swp->primary_bank_slot_count[ bank_to_fire ] ) / pm->gun_banks[bank_to_fire].num_slots ) );
|
||||
swp->last_primary_fire_stamp[bank_to_fire] = timestamp();
|
||||
} else if (winfo_p->wi_flags2 & WIF2_CYCLE) {
|
||||
Assert(pm->gun_banks[bank_to_fire].num_slots != 0);
|
||||
swp->next_primary_fire_stamp[bank_to_fire] = timestamp((int)(next_fire_delay / pm->gun_banks[bank_to_fire].num_slots));
|
||||
swp->last_primary_fire_stamp[bank_to_fire] = timestamp();
|
||||
@@ -10095,7 +10101,10 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
|
||||
|
||||
// ok if this is a cycling weapon use shots as the number of points to fire from at a time
|
||||
// otherwise shots is the number of times all points will be fired (used mostly for the 'shotgun' effect)
|
||||
if (winfo_p->wi_flags2 & WIF2_CYCLE) {
|
||||
if ( sip->flags2 & SIF2_DYN_PRIMARY_LINKING ) {
|
||||
numtimes = 1;
|
||||
points = MIN( num_slots, swp->primary_bank_slot_count[ bank_to_fire ] );
|
||||
} else if ( winfo_p->wi_flags2 & WIF2_CYCLE ) {
|
||||
numtimes = 1;
|
||||
points = MIN(num_slots, winfo_p->shots);
|
||||
} else {
|
||||
@@ -10201,7 +10210,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
|
||||
|
||||
for ( j = 0; j < points; j++ ) {
|
||||
int pt; //point
|
||||
if (winfo_p->wi_flags2 & WIF2_CYCLE){
|
||||
if ( (winfo_p->wi_flags2 & WIF2_CYCLE) || (sip->flags2 & SIF2_DYN_PRIMARY_LINKING) ){
|
||||
pt = (shipp->last_fired_point[bank_to_fire]+1)%num_slots;
|
||||
}else{
|
||||
pt = j;
|
||||
@@ -11265,6 +11274,11 @@ int ship_select_next_primary(object *objp, int direction)
|
||||
Assert((swp->current_primary_bank >= 0) && (swp->current_primary_bank < swp->num_primary_banks));
|
||||
|
||||
// first check if linked
|
||||
if ( shipp->flags2 & SF2_SHIP_SELECTIVE_LINKING )
|
||||
{
|
||||
printf("npb:%i\n", swp->num_primary_banks );
|
||||
}
|
||||
|
||||
if ( shipp->flags & SF_PRIMARY_LINKED )
|
||||
{
|
||||
shipp->flags &= ~SF_PRIMARY_LINKED;
|
||||
|
||||
+7
-1
@@ -127,6 +127,10 @@ typedef struct ship_weapon {
|
||||
|
||||
float primary_bank_fof_cooldown[MAX_SHIP_PRIMARY_BANKS]; // SUSHI: Current FOF cooldown level for the primary weapon
|
||||
|
||||
// dynamic weapon linking - by RSAXVC
|
||||
int primary_bank_slot_count[MAX_SHIP_PRIMARY_BANKS]; // Fire this many slots at a time
|
||||
// end dynamic weapon linking
|
||||
|
||||
int secondary_bank_ammo[MAX_SHIP_SECONDARY_BANKS]; // Number of missiles left in secondary bank
|
||||
int secondary_bank_start_ammo[MAX_SHIP_SECONDARY_BANKS]; // Number of missiles starting in secondary bank
|
||||
int secondary_bank_capacity[MAX_SHIP_SECONDARY_BANKS]; // Max number of missiles in bank
|
||||
@@ -491,6 +495,7 @@ extern ship_flag_name Ship_flag_names[];
|
||||
#define SF2_NO_THRUSTERS (1<<23) // The E - Thrusters on this ship are not rendered.
|
||||
#define SF2_SHIP_LOCKED (1<<24) // Karajorma - Prevents the player from changing the ship class on loadout screen
|
||||
#define SF2_WEAPONS_LOCKED (1<<25) // Karajorma - Prevents the player from changing the weapons on the ship on the loadout screen
|
||||
#define SF2_SHIP_SELECTIVE_LINKING (1<<26) // RSAXVC - Allow pilot to pick firing configuration
|
||||
|
||||
// If any of these bits in the ship->flags are set, ignore this ship when targeting
|
||||
extern int TARGET_SHIP_IGNORE_FLAGS;
|
||||
@@ -912,8 +917,9 @@ extern int ship_find_exited_ship_by_signature( int signature);
|
||||
#define SIF2_ALLOW_LANDINGS (1 << 12) // SUSHI: Automatically set if any subsystems allow landings (as a shortcut)
|
||||
#define SIF2_NO_ETS (1 << 13) // The E - No ETS on this ship class
|
||||
#define SIF2_NO_LIGHTING (1 << 14) // Valathil - No lighting for this ship
|
||||
#define SIF2_DYN_PRIMARY_LINKING (1 << 15) // RSAXVC - Dynamically generate weapon linking options
|
||||
// !!! IF YOU ADD A FLAG HERE BUMP MAX_SHIP_FLAGS !!!
|
||||
#define MAX_SHIP_FLAGS 15 // Number of distinct flags for flags field in ship_info struct
|
||||
#define MAX_SHIP_FLAGS 16 // Number of distinct flags for flags field in ship_info struct
|
||||
#define SIF_DEFAULT_VALUE 0
|
||||
#define SIF2_DEFAULT_VALUE 0
|
||||
|
||||
|
||||
@@ -695,3 +695,18 @@ void blit_medals()
|
||||
gr_set_bitmap(Rank_bm);
|
||||
gr_bitmap(Medal_coords[gr_screen.res][RANK_MEDAL_REGION][0], Medal_coords[gr_screen.res][RANK_MEDAL_REGION][1]);
|
||||
}
|
||||
|
||||
int medals_info_lookup(const char *name)
|
||||
{
|
||||
if ( !name ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Num_medals; i++) {
|
||||
if ( !stricmp(name, Medals[i].name) ) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -85,4 +85,6 @@ void blit_callsign();
|
||||
// individual medals
|
||||
void medals_translate_name(char *name, int max_len);
|
||||
|
||||
int medals_info_lookup(const char *name);
|
||||
|
||||
#endif
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "network/multi_dogfight.h"
|
||||
#include "network/multi_pmsg.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
|
||||
/*
|
||||
// uncomment to get extra debug messages when a player scores
|
||||
@@ -375,6 +376,7 @@ void scoring_level_close(int accepted)
|
||||
// this will grant any potential medals and then early bail, and
|
||||
// then we will early bail
|
||||
scoring_do_accept(&Player->stats);
|
||||
Pilot.update_stats(&Player->stats, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -390,6 +392,10 @@ void scoring_level_close(int accepted)
|
||||
// get the scoring struct
|
||||
sc = &Net_players[idx].m_player->stats;
|
||||
scoring_do_accept( sc );
|
||||
|
||||
if (Net_player == &Net_players[idx]) {
|
||||
Pilot.update_stats(sc);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -413,6 +419,9 @@ void scoring_level_close(int accepted)
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(Game_mode & GM_MULTIPLAYER) ) {
|
||||
Pilot.update_stats(&Player->stats);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -346,6 +346,11 @@
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/playerman</name>
|
||||
<type>2</type>
|
||||
@@ -2986,6 +2991,46 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/physics/physics.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/csg.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/csg.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/csg_convert.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/csg_convert.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/pilotfile.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/pilotfile.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/pilotfile.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/pilotfile.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/pilotfile_convert.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/pilotfile_convert.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/pilotfile_convert.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/pilotfile_convert.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/plr.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/plr.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/pilotfile/plr_convert.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/code/pilotfile/plr_convert.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>code/playerman/managepilot.cpp</name>
|
||||
<type>1</type>
|
||||
|
||||
@@ -2113,6 +2113,42 @@
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="PilotFile"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\csg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\csg_convert.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile_convert.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile_convert.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\plr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\plr_convert.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Playerman"
|
||||
>
|
||||
<File
|
||||
|
||||
@@ -2007,6 +2007,42 @@
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="PilotFile"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\csg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\csg_convert.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile_convert.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\pilotfile_convert.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\plr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\code\pilotfile\plr_convert.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Playerman"
|
||||
>
|
||||
<File
|
||||
|
||||
@@ -537,6 +537,12 @@
|
||||
<ClCompile Include="..\..\code\Particle\particle.cpp" />
|
||||
<ClCompile Include="..\..\code\PcxUtils\pcxutils.cpp" />
|
||||
<ClCompile Include="..\..\code\Physics\physics.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\csg.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\csg_convert.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile_convert.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\plr.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\plr_convert.cpp" />
|
||||
<ClCompile Include="..\..\code\playerman\managepilot.cpp" />
|
||||
<ClCompile Include="..\..\code\playerman\playercontrol.cpp" />
|
||||
<ClCompile Include="..\..\code\popup\popup.cpp" />
|
||||
@@ -815,6 +821,8 @@
|
||||
<ClInclude Include="..\..\code\Particle\particle.h" />
|
||||
<ClInclude Include="..\..\code\PcxUtils\pcxutils.h" />
|
||||
<ClInclude Include="..\..\code\Physics\physics.h" />
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile.h" />
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile_convert.h" />
|
||||
<ClInclude Include="..\..\code\playerman\managepilot.h" />
|
||||
<ClInclude Include="..\..\code\playerman\player.h" />
|
||||
<ClInclude Include="..\..\code\popup\popup.h" />
|
||||
|
||||
@@ -121,6 +121,9 @@
|
||||
<Filter Include="Physics">
|
||||
<UniqueIdentifier>{73764146-6133-4a00-9463-532184af6694}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="PilotFile">
|
||||
<UniqueIdentifier>{73764146-6640-4a00-9463-532184af6694}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Playerman">
|
||||
<UniqueIdentifier>{9db79e68-6640-4232-9f4c-7811fcd113f4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -693,6 +696,24 @@
|
||||
<ClCompile Include="..\..\code\Physics\physics.cpp">
|
||||
<Filter>Physics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\csg.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\csg_convert.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile_convert.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\plr.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\plr_convert.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\playerman\managepilot.cpp">
|
||||
<Filter>Playerman</Filter>
|
||||
</ClCompile>
|
||||
@@ -1826,6 +1847,12 @@
|
||||
<ClInclude Include="..\..\code\radar\radardradis.h">
|
||||
<Filter>Radar</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile_convert.h">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile.h">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\code\mod_table\mod_table.h">
|
||||
<Filter>mod_table</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -544,6 +544,12 @@
|
||||
<ClCompile Include="..\..\code\Particle\particle.cpp" />
|
||||
<ClCompile Include="..\..\code\PcxUtils\pcxutils.cpp" />
|
||||
<ClCompile Include="..\..\code\Physics\physics.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\csg.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\csg_convert.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile_convert.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\plr.cpp" />
|
||||
<ClCompile Include="..\..\code\PilotFile\plr_convert.cpp" />
|
||||
<ClCompile Include="..\..\code\playerman\managepilot.cpp" />
|
||||
<ClCompile Include="..\..\code\playerman\playercontrol.cpp" />
|
||||
<ClCompile Include="..\..\code\popup\popup.cpp" />
|
||||
@@ -822,6 +828,8 @@
|
||||
<ClInclude Include="..\..\code\Particle\particle.h" />
|
||||
<ClInclude Include="..\..\code\PcxUtils\pcxutils.h" />
|
||||
<ClInclude Include="..\..\code\Physics\physics.h" />
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile.h" />
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile_convert.h" />
|
||||
<ClInclude Include="..\..\code\playerman\managepilot.h" />
|
||||
<ClInclude Include="..\..\code\playerman\player.h" />
|
||||
<ClInclude Include="..\..\code\popup\popup.h" />
|
||||
|
||||
@@ -121,6 +121,9 @@
|
||||
<Filter Include="Physics">
|
||||
<UniqueIdentifier>{73764146-6133-4a00-9463-532184af6694}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="PilotFile">
|
||||
<UniqueIdentifier>{73764146-6640-4a00-9463-532184af6694}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Playerman">
|
||||
<UniqueIdentifier>{9db79e68-6640-4232-9f4c-7811fcd113f4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -693,6 +696,24 @@
|
||||
<ClCompile Include="..\..\code\Physics\physics.cpp">
|
||||
<Filter>Physics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\csg.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\csg_convert.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\pilotfile_convert.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\plr.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\PilotFile\plr_convert.cpp">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\code\playerman\managepilot.cpp">
|
||||
<Filter>Playerman</Filter>
|
||||
</ClCompile>
|
||||
@@ -1832,6 +1853,12 @@
|
||||
<ClInclude Include="..\..\code\parse\generic_log.h">
|
||||
<Filter>Parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile_convert.h">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\code\PilotFile\pilotfile.h">
|
||||
<Filter>PilotFile</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Library Include="..\..\code\directx\dxguid.lib">
|
||||
|
||||
@@ -2028,6 +2028,42 @@ SOURCE=..\..\code\Physics\Physics.cpp
|
||||
SOURCE=..\..\code\Physics\Physics.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "PilotFile"
|
||||
|
||||
# PROP Default Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\csg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\csg_convert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\pilotfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\pilotfile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\pilotfile_convert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\pilotfile_convert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\plr.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\code\pilotfile\plr_convert.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Playerman"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
|
||||
@@ -578,6 +578,14 @@
|
||||
6066A02413AFEA6700A817AA /* pnglibconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 6066A01F13AFEA6700A817AA /* pnglibconf.h */; };
|
||||
6066A02513AFEA6700A817AA /* pngpriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 6066A02013AFEA6700A817AA /* pngpriv.h */; };
|
||||
606CBAE2126A1BFF007BE418 /* fsmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 606CBAE1126A1BFF007BE418 /* fsmemory.cpp */; };
|
||||
60B18453127F544400CD9F1E /* csg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844B127F544400CD9F1E /* csg.cpp */; };
|
||||
60B18454127F544400CD9F1E /* csg_convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844C127F544400CD9F1E /* csg_convert.cpp */; };
|
||||
60B18455127F544400CD9F1E /* pilotfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844D127F544400CD9F1E /* pilotfile.cpp */; };
|
||||
60B18456127F544400CD9F1E /* pilotfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 60B1844E127F544400CD9F1E /* pilotfile.h */; };
|
||||
60B18457127F544400CD9F1E /* pilotfile_convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844F127F544400CD9F1E /* pilotfile_convert.cpp */; };
|
||||
60B18458127F544400CD9F1E /* pilotfile_convert.h in Headers */ = {isa = PBXBuildFile; fileRef = 60B18450127F544400CD9F1E /* pilotfile_convert.h */; };
|
||||
60B18459127F544400CD9F1E /* plr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B18451127F544400CD9F1E /* plr.cpp */; };
|
||||
60B1845A127F544400CD9F1E /* plr_convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B18452127F544400CD9F1E /* plr_convert.cpp */; };
|
||||
60B56A33124BBFD5005AF5A9 /* fsmemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 60B56A32124BBFD5005AF5A9 /* fsmemory.h */; };
|
||||
60FAF4E2113431A100CE910F /* acm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60FAF4DF113431A100CE910F /* acm.cpp */; };
|
||||
60FAF4E3113431A100CE910F /* openal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60FAF4E0113431A100CE910F /* openal.cpp */; };
|
||||
@@ -1493,6 +1501,14 @@
|
||||
6066A01F13AFEA6700A817AA /* pnglibconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pnglibconf.h; sourceTree = "<group>"; };
|
||||
6066A02013AFEA6700A817AA /* pngpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pngpriv.h; sourceTree = "<group>"; };
|
||||
606CBAE1126A1BFF007BE418 /* fsmemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fsmemory.cpp; sourceTree = "<group>"; };
|
||||
60B1844B127F544400CD9F1E /* csg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = csg.cpp; sourceTree = "<group>"; };
|
||||
60B1844C127F544400CD9F1E /* csg_convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = csg_convert.cpp; sourceTree = "<group>"; };
|
||||
60B1844D127F544400CD9F1E /* pilotfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pilotfile.cpp; sourceTree = "<group>"; };
|
||||
60B1844E127F544400CD9F1E /* pilotfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pilotfile.h; sourceTree = "<group>"; };
|
||||
60B1844F127F544400CD9F1E /* pilotfile_convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pilotfile_convert.cpp; sourceTree = "<group>"; };
|
||||
60B18450127F544400CD9F1E /* pilotfile_convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pilotfile_convert.h; sourceTree = "<group>"; };
|
||||
60B18451127F544400CD9F1E /* plr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plr.cpp; sourceTree = "<group>"; };
|
||||
60B18452127F544400CD9F1E /* plr_convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plr_convert.cpp; sourceTree = "<group>"; };
|
||||
60B56A32124BBFD5005AF5A9 /* fsmemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fsmemory.h; sourceTree = "<group>"; };
|
||||
60C1FEFE126E63B5005D5132 /* radardradis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = radardradis.cpp; sourceTree = "<group>"; };
|
||||
60C1FEFF126E63B5005D5132 /* radardradis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = radardradis.h; sourceTree = "<group>"; };
|
||||
@@ -1897,6 +1913,7 @@
|
||||
345954B808C3D6A0003B1351 /* particle */,
|
||||
345954BB08C3D6A0003B1351 /* pcxutils */,
|
||||
345954BE08C3D6A0003B1351 /* physics */,
|
||||
60B1844A127F544400CD9F1E /* pilotfile */,
|
||||
345954C108C3D6A0003B1351 /* playerman */,
|
||||
F0B73A8F10FA065F005E1A69 /* pngutils */,
|
||||
345954C608C3D6A0003B1351 /* popup */,
|
||||
@@ -3042,6 +3059,21 @@
|
||||
path = cfileextractor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
60B1844A127F544400CD9F1E /* pilotfile */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
60B1844B127F544400CD9F1E /* csg.cpp */,
|
||||
60B1844C127F544400CD9F1E /* csg_convert.cpp */,
|
||||
60B1844D127F544400CD9F1E /* pilotfile.cpp */,
|
||||
60B1844E127F544400CD9F1E /* pilotfile.h */,
|
||||
60B1844F127F544400CD9F1E /* pilotfile_convert.cpp */,
|
||||
60B18450127F544400CD9F1E /* pilotfile_convert.h */,
|
||||
60B18451127F544400CD9F1E /* plr.cpp */,
|
||||
60B18452127F544400CD9F1E /* plr_convert.cpp */,
|
||||
);
|
||||
path = pilotfile;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
60E7978910F59BF700904FA6 /* external_dll */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -3168,6 +3200,8 @@
|
||||
3459585208C3D8CB003B1351 /* SDLMain.h in Headers */,
|
||||
60B56A33124BBFD5005AF5A9 /* fsmemory.h in Headers */,
|
||||
91D778A114FE96BE00E0090A /* mod_table.h in Headers */,
|
||||
60B18456127F544400CD9F1E /* pilotfile.h in Headers */,
|
||||
60B18458127F544400CD9F1E /* pilotfile_convert.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -3716,6 +3750,12 @@
|
||||
3459594C08C3D8CB003B1351 /* SDLMain.m in Sources */,
|
||||
606CBAE2126A1BFF007BE418 /* fsmemory.cpp in Sources */,
|
||||
91D778A014FE96BE00E0090A /* mod_table.cpp in Sources */,
|
||||
60B18453127F544400CD9F1E /* csg.cpp in Sources */,
|
||||
60B18454127F544400CD9F1E /* csg_convert.cpp in Sources */,
|
||||
60B18455127F544400CD9F1E /* pilotfile.cpp in Sources */,
|
||||
60B18457127F544400CD9F1E /* pilotfile_convert.cpp in Sources */,
|
||||
60B18459127F544400CD9F1E /* plr.cpp in Sources */,
|
||||
60B1845A127F544400CD9F1E /* plr_convert.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -579,6 +579,14 @@
|
||||
6066A02413AFEA6700A817AA /* pnglibconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 6066A01F13AFEA6700A817AA /* pnglibconf.h */; };
|
||||
6066A02513AFEA6700A817AA /* pngpriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 6066A02013AFEA6700A817AA /* pngpriv.h */; };
|
||||
606CBAE2126A1BFF007BE418 /* fsmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 606CBAE1126A1BFF007BE418 /* fsmemory.cpp */; };
|
||||
60B18453127F544400CD9F1E /* csg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844B127F544400CD9F1E /* csg.cpp */; };
|
||||
60B18454127F544400CD9F1E /* csg_convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844C127F544400CD9F1E /* csg_convert.cpp */; };
|
||||
60B18455127F544400CD9F1E /* pilotfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844D127F544400CD9F1E /* pilotfile.cpp */; };
|
||||
60B18456127F544400CD9F1E /* pilotfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 60B1844E127F544400CD9F1E /* pilotfile.h */; };
|
||||
60B18457127F544400CD9F1E /* pilotfile_convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B1844F127F544400CD9F1E /* pilotfile_convert.cpp */; };
|
||||
60B18458127F544400CD9F1E /* pilotfile_convert.h in Headers */ = {isa = PBXBuildFile; fileRef = 60B18450127F544400CD9F1E /* pilotfile_convert.h */; };
|
||||
60B18459127F544400CD9F1E /* plr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B18451127F544400CD9F1E /* plr.cpp */; };
|
||||
60B1845A127F544400CD9F1E /* plr_convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60B18452127F544400CD9F1E /* plr_convert.cpp */; };
|
||||
60B56A33124BBFD5005AF5A9 /* fsmemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 60B56A32124BBFD5005AF5A9 /* fsmemory.h */; };
|
||||
60FAF4E2113431A100CE910F /* acm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60FAF4DF113431A100CE910F /* acm.cpp */; };
|
||||
60FAF4E3113431A100CE910F /* openal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60FAF4E0113431A100CE910F /* openal.cpp */; };
|
||||
@@ -1494,6 +1502,14 @@
|
||||
6066A01F13AFEA6700A817AA /* pnglibconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pnglibconf.h; sourceTree = "<group>"; };
|
||||
6066A02013AFEA6700A817AA /* pngpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pngpriv.h; sourceTree = "<group>"; };
|
||||
606CBAE1126A1BFF007BE418 /* fsmemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fsmemory.cpp; sourceTree = "<group>"; };
|
||||
60B1844B127F544400CD9F1E /* csg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = csg.cpp; sourceTree = "<group>"; };
|
||||
60B1844C127F544400CD9F1E /* csg_convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = csg_convert.cpp; sourceTree = "<group>"; };
|
||||
60B1844D127F544400CD9F1E /* pilotfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pilotfile.cpp; sourceTree = "<group>"; };
|
||||
60B1844E127F544400CD9F1E /* pilotfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pilotfile.h; sourceTree = "<group>"; };
|
||||
60B1844F127F544400CD9F1E /* pilotfile_convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pilotfile_convert.cpp; sourceTree = "<group>"; };
|
||||
60B18450127F544400CD9F1E /* pilotfile_convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pilotfile_convert.h; sourceTree = "<group>"; };
|
||||
60B18451127F544400CD9F1E /* plr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plr.cpp; sourceTree = "<group>"; };
|
||||
60B18452127F544400CD9F1E /* plr_convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plr_convert.cpp; sourceTree = "<group>"; };
|
||||
60B56A32124BBFD5005AF5A9 /* fsmemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fsmemory.h; sourceTree = "<group>"; };
|
||||
60C1FEFE126E63B5005D5132 /* radardradis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = radardradis.cpp; sourceTree = "<group>"; };
|
||||
60C1FEFF126E63B5005D5132 /* radardradis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = radardradis.h; sourceTree = "<group>"; };
|
||||
@@ -1897,6 +1913,7 @@
|
||||
345954B808C3D6A0003B1351 /* particle */,
|
||||
345954BB08C3D6A0003B1351 /* pcxutils */,
|
||||
345954BE08C3D6A0003B1351 /* physics */,
|
||||
60B1844A127F544400CD9F1E /* pilotfile */,
|
||||
345954C108C3D6A0003B1351 /* playerman */,
|
||||
F0B73A8F10FA065F005E1A69 /* pngutils */,
|
||||
345954C608C3D6A0003B1351 /* popup */,
|
||||
@@ -2672,6 +2689,21 @@
|
||||
path = physics;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
60B1844A127F544400CD9F1E /* pilotfile */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
60B1844B127F544400CD9F1E /* csg.cpp */,
|
||||
60B1844C127F544400CD9F1E /* csg_convert.cpp */,
|
||||
60B1844D127F544400CD9F1E /* pilotfile.cpp */,
|
||||
60B1844E127F544400CD9F1E /* pilotfile.h */,
|
||||
60B1844F127F544400CD9F1E /* pilotfile_convert.cpp */,
|
||||
60B18450127F544400CD9F1E /* pilotfile_convert.h */,
|
||||
60B18451127F544400CD9F1E /* plr.cpp */,
|
||||
60B18452127F544400CD9F1E /* plr_convert.cpp */,
|
||||
);
|
||||
path = pilotfile;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
345954C108C3D6A0003B1351 /* playerman */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -3166,6 +3198,8 @@
|
||||
files = (
|
||||
3459585208C3D8CB003B1351 /* SDLMain.h in Headers */,
|
||||
60B56A33124BBFD5005AF5A9 /* fsmemory.h in Headers */,
|
||||
60B18456127F544400CD9F1E /* pilotfile.h in Headers */,
|
||||
60B18458127F544400CD9F1E /* pilotfile_convert.h in Headers */,
|
||||
5C06872F14BCDEDA0043BFB9 /* pngconf.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -3717,6 +3751,12 @@
|
||||
files = (
|
||||
3459594C08C3D8CB003B1351 /* SDLMain.m in Sources */,
|
||||
606CBAE2126A1BFF007BE418 /* fsmemory.cpp in Sources */,
|
||||
60B18453127F544400CD9F1E /* csg.cpp in Sources */,
|
||||
60B18454127F544400CD9F1E /* csg_convert.cpp in Sources */,
|
||||
60B18455127F544400CD9F1E /* pilotfile.cpp in Sources */,
|
||||
60B18457127F544400CD9F1E /* pilotfile_convert.cpp in Sources */,
|
||||
60B18459127F544400CD9F1E /* plr.cpp in Sources */,
|
||||
60B1845A127F544400CD9F1E /* plr_convert.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -1280,6 +1280,30 @@
|
||||
<Unit filename="../../../code/physics/physics.h">
|
||||
<Option virtualFolder="physics/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/csg.cpp">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/csg_convert.cpp">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/pilotfile.cpp">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/pilotfile.h">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/pilotfile_convert.cpp">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/pilotfile_convert.h">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/plr.cpp">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/pilotfile/plr_convert.cpp">
|
||||
<Option virtualFolder="pilotfile/" />
|
||||
</Unit>
|
||||
<Unit filename="../../../code/playerman/managepilot.cpp">
|
||||
<Option virtualFolder="playerman/" />
|
||||
</Unit>
|
||||
|
||||
Reference in new issue
Block a user