ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/installer.cpp
(Generate patch)

Comparing AE/Installer/trunk/source/installer.cpp (file contents):
Revision 550 by gumby, Wed May 26 23:28:22 2010 UTC vs.
Revision 551 by gumby, Thu May 27 20:30:35 2010 UTC

# Line 597 | Line 597 | void recompileAll(vector<string> install
597          else if(splitInstances == false){
598                  directory_iterator end_iter;
599                  
600 <                for ( directory_iterator dir_itr( vanilla_dir );
601 <                         dir_itr != end_iter;
602 <                         ++dir_itr )
603 <                {
604 <                        if ( is_directory( dir_itr->status() ) )
605 <                        {
606 <                                numberOfDats++;
600 >                
601 >                char levelnums[256] = {0};
602 >
603 >
604 >
605 >                for(int k = 0; k < 256; k++) {
606 >                        if( exists( (path)("./VanillaDats/level" + lexical_cast<std::string>(k) + "_final/") ) ) {
607 >                                        levelnums[k] = 1;
608 >                                        
609                          }
610                  }
611 <                
611 >        
612 >                for (int i = installedMods.size() - 1; i >= 0; i--) {                                                   //Iterates through the installed mods (backwards :P)
613 >                        for (unsigned int j = 0; j < globalPackages.size(); ++j) {                              //looking in the global packages
614 >                                if (globalPackages[j].modStringName == installedMods[i]) {      //for a mod that has BSL in it
615 >                                        for(int k = 0; k < 256; k++) {
616 >                                                if( globalPackages[j].hasOnis &&
617 >                                                        exists( (path)("packages/" + globalPackages[j].modStringName + "/oni/level" + lexical_cast<std::string>(k) + "_final/") ) ) {
618 >                                                        levelnums[k] = 1;
619 >                                                        
620 >                                                }
621 >                                        }
622 >                                }
623 >                        }
624 >                }
625 >                for (int levelnum = 0; levelnum < 256; levelnum++)
626 >                        if (levelnums[levelnum])
627 >                                numberOfDats++;
628 >
629                  out << numberOfDats;
630                  datString = out.str();
631 <                
632 <                for ( directory_iterator dir_itr( vanilla_dir );
614 <                         dir_itr != end_iter;
615 <                         ++dir_itr )
616 <                {
631 >
632 >                for(int levelnum = 0; levelnum < 256; levelnum++) {
633                          try
634                          {
635 <                                if ( is_directory( dir_itr->status() ) )
635 >                                if ( levelnums[levelnum] )
636                                  {
637 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
637 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + "level" + lexical_cast<std::string>(levelnum) + "_Final ";
638                                          for (unsigned int i = 0; i < installedMods.size(); ++i) {
639 <                                                if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
640 <                                                        importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
639 >                                                if (exists((path)("packages/" + installedMods[i] + "/oni/level" + lexical_cast<std::string>(levelnum) + "_final") ))
640 >                                                        importCommand += " packages/" + installedMods[i] + "/oni/level" + lexical_cast<std::string>(levelnum) + "_Final";
641                                          }
642 <                                        importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
642 >                                        importCommand += " ../GameDataFolder/level" + lexical_cast<std::string>(levelnum) + "_Final.dat >> Install.log";
643                                          
644                                          setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
645                                          setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +
646 <                                                                  dir_itr->path().filename() + " ");
646 >                                                                  "level" + lexical_cast<std::string>(levelnum) + "_Final"+ " ");
647                                          system(importCommand.c_str());
648                                          j++;
649                                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)