32 void pilotfile_convert::startSection(
Section::id section_id)
44 m_size_offset =
cftell(cfp);
47 void pilotfile_convert::endSection()
50 Assert( m_size_offset > 0 );
54 Assert( cur >= m_size_offset );
56 size_t section_size = cur - m_size_offset;
72 size_t count, inf_count;
73 int max_convert, num_converted = 0;
83 inf_count = old_files.size();
86 if ( old_files.empty() ) {
92 count = old_files.size();
93 for (idx = 0; idx < existing.size(); idx++) {
94 const char *fname = existing[
idx].c_str();
96 for (j = 0; j <
count; j++) {
97 if ( !
stricmp(fname, old_files[j].c_str()) ) {
111 if (i == count || max_convert <= 0) {
115 mprintf((
"PILOT: Beginning pilot file conversion...\n"));
118 count = old_files.size();
119 for (idx = 0; idx <
count; idx++) {
120 if ( old_files[idx].empty() ) {
126 bool inferno = (idx < inf_count);
128 if ( pcon->
plr_convert(old_files[idx].c_str(), inferno) ) {
132 wildcard.append(
"*.cs2");
140 for (j = 0; j < savefiles.size(); j++) {
149 if (num_converted >= max_convert) {
154 mprintf((
"PILOT: Pilot file conversion complete!\n"));
int cfwrite_ushort(ushort s, CFILE *file)
#define CF_TYPE_SINGLE_PLAYERS
bool csg_convert(const char *fname, bool inferno)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
void convert_pilot_files()
bool plr_convert(const char *fname, bool inferno)
int cfwrite_int(int i, CFILE *file)
const char * Get_file_list_child
int cfclose(CFILE *cfile)
int cf_get_file_list(SCP_vector< SCP_string > &list, int pathtype, const char *filter, int sort=CF_SORT_NONE, SCP_vector< file_list_info > *info=NULL)
int cfseek(CFILE *fp, int offset, int where)