Beispiel #1
0
void Console::cmdDump2DA(const CommandLine &cl) {
	if (cl.args.empty()) {
		printCommandHelp(cl.cmd);
		return;
	}

	if (dump2DA(cl.args))
		printf("Dumped 2DA \"%s\"", cl.args.c_str());
	else
		printf("Failed dumping 2DA \"%s\"", cl.args.c_str());
}
Beispiel #2
0
void convert2DA(const Common::UString &file, const Common::UString &outFile, Format format) {
	Aurora::TwoDAFile *twoDA = get2DAGDA(new Common::ReadFile(file));

	try {
		dump2DA(*twoDA, outFile, format);
	} catch (...) {
		delete twoDA;
		throw;
	}

	delete twoDA;
}
Beispiel #3
0
void Console::cmdDumpAll2DA(const CommandLine &cl) {
	std::list<Aurora::ResourceManager::ResourceID> twoda;
	ResMan.getAvailableResources(Aurora::kFileType2DA, twoda);

	std::list<Aurora::ResourceManager::ResourceID>::const_iterator t;
	for (t = twoda.begin(); t != twoda.end(); ++t) {
		if (dump2DA(t->name))
			printf("Dumped 2DA \"%s\"", t->name.c_str());
		else
			printf("Failed dumping 2DA \"%s\"", t->name.c_str());
	}
}
Beispiel #4
0
void convert2DA(const std::vector<Common::UString> &files, const Common::UString &outFile, Format format) {
	if (files.size() == 1) {
		convert2DA(files[0], outFile, format);
		return;
	}

	Aurora::GDAFile gda(new Common::ReadFile(files[0]));

	for (size_t i = 1; i < files.size(); i++)
		gda.add(new Common::ReadFile(files[i]));

	Aurora::TwoDAFile twoDA(gda);

	dump2DA(twoDA, outFile, format);
}