mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Tools: Automatically create directories for tools (#17971)
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <set>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
using G3D::Vector3;
|
||||
using G3D::AABox;
|
||||
@@ -55,7 +56,7 @@ namespace VMAP
|
||||
TileAssembler::TileAssembler(const std::string& pSrcDirName, const std::string& pDestDirName)
|
||||
: iDestDir(pDestDirName), iSrcDir(pSrcDirName), iFilterMethod(NULL), iCurrentUniqueNameId(0)
|
||||
{
|
||||
//mkdir(iDestDir);
|
||||
boost::filesystem::create_directory(iDestDir);
|
||||
//init();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include "PathCommon.h"
|
||||
#include "MapBuilder.h"
|
||||
#include "Timer.h"
|
||||
@@ -42,10 +44,7 @@ bool checkDirectories(bool debugOutput)
|
||||
|
||||
dirFiles.clear();
|
||||
if (getDirContents(dirFiles, "mmaps") == LISTFILE_DIRECTORY_NOT_FOUND)
|
||||
{
|
||||
printf("'mmaps' directory does not exist\n");
|
||||
return false;
|
||||
}
|
||||
return boost::filesystem::create_directory("mmaps");
|
||||
|
||||
dirFiles.clear();
|
||||
if (debugOutput)
|
||||
|
||||
@@ -26,14 +26,21 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
Trinity::Banner::Show("VMAP assembler", [](char const* text) { std::cout << text << std::endl; }, nullptr);
|
||||
|
||||
if (argc != 3)
|
||||
std::string src = "Buildings";
|
||||
std::string dest = "vmaps";
|
||||
|
||||
if (argc > 3)
|
||||
{
|
||||
std::cout << "usage: " << argv[0] << " <raw data dir> <vmap dest dir>" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string src = argv[1];
|
||||
std::string dest = argv[2];
|
||||
else
|
||||
{
|
||||
if (argc > 1)
|
||||
src = argv[1];
|
||||
if (argc > 2)
|
||||
dest = argv[2];
|
||||
}
|
||||
|
||||
std::cout << "using " << src << " as source directory and writing output to " << dest << std::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user