--- AE/Installer/trunk/source/main_window.cpp 2009/10/10 02:49:27 462 +++ AE/Installer/trunk/source/main_window.cpp 2009/10/20 22:55:16 469 @@ -195,6 +195,7 @@ int globalizeData(void) } logfile << "Exporting and moving...\n\n"; int total_steps = 8 + 2 * num_levels; + for(int i = 0; i < 15; i++) { @@ -210,6 +211,13 @@ int globalizeData(void) system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str()); create_directory( "VanillaDats/level" + levels[i] + "_Final" ); create_directory( "VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" ); + + //Moves the AKEV and other files into a safe directory so that level specific textures are not globalized... + if ( strcmp(levels[i].c_str(), "0") ){ + create_directory( "../GameDataFolder/level" + levels[i] + "_Final/AKEV" ); + system((strOniSplit + " -move:overwrite ../GameDataFolder/level" + levels[i] + "_Final/AKEV ../GameDataFolder/level" + levels[i] + "_Final/AKEV*.oni").c_str()); + + } directory_iterator end_iter; for ( directory_iterator dir_itr( "../GameDataFolder/level" + levels[i] + "_Final" ); dir_itr != end_iter; ++dir_itr ) @@ -305,8 +313,16 @@ int globalizeData(void) } + logfile << "\tCleaning up TXMPs...\n"; system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str()); + + + if ( strcmp(levels[i].c_str(), "0") ){ + system((strOniSplit + " -move:overwrite ../GameDataFolder/level" + levels[i] + "_Final ../GameDataFolder/level" + levels[i] + "_Final/AKEV/AKEV*.oni").c_str()); + remove( "../GameDataFolder/level" + levels[i] + "_Final/AKEV" ); + } + parts_done++; setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); @@ -344,6 +360,23 @@ int globalizeData(void) logfile << "\nMoving level0_Characters\n"; setStatusArea("Step " + lexical_cast(parts_done + 1) + "/" + lexical_cast(total_steps) + ": moving level0_Characters" ); copy((path)"../GameDataFolder/level0_Characters", (path)("VanillaDats/level0_Final")); + GDFPaths.push_back( Characters ); + for(int i = 0; i < GDFPaths.size(); i++) + { + directory_iterator end_iter; + for ( directory_iterator dir_itr( GDFPaths[i] ); dir_itr != end_iter; ++dir_itr ) + { + try + { + + + rename(dir_itr->path(), "../GameDataFolder/level0_Final/" + dir_itr->path().filename() ); + } + catch(exception &ex) { + + } + } + } /* printf(Step_x_x,"Step %d/%d: reimporting level0_Characters", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) )); system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str()); @@ -366,6 +399,9 @@ int globalizeData(void) setProgressBar( 1000 ); if(exists("../../persist.dat")) if(!exists("../persist.dat")) + + //TODO: Concactate level0 Dirs. + copy("../../persist.dat",".."); if(exists("../../key_config.txt"))if(!exists("../key_config.txt")) copy("../../key_config.txt","..");