Example #1
0
void crawlDirectory(const std::string &directory) {
	status("Crawling through game directory \"%s\"", directory.c_str());

	Gob::GameDir gameDir(directory);

	convertADL(gameDir);
	convertMDY(gameDir);

	const std::list<std::string> &tot = gameDir.getTOT();
	for (std::list<std::string>::const_iterator f = tot.begin(); f != tot.end(); ++f) {
		status("Loading TOT \"%s\"", f->c_str());

		try {
			Gob::TOTFile totFile(gameDir, *f);

			convertTOTADL(totFile);

		} catch (Common::Exception &e) {
			Common::printException(e, "WARNING: ");
		}
	}
}
Example #2
0
bool Script::loadTOT(const Common::String &fileName) {
	TOTFile totFile(_vm);

	if (!totFile.load(fileName))
		return false;

	Common::SeekableReadStream *stream = totFile.getStream();
	if (!stream)
		return false;

	if (!totFile.getProperties(_totProperties))
		return false;

	_totSize = _totProperties.scriptEnd;
	if (_totSize <= 0)
		return false;

	_totData = new byte[_totSize];
	if (stream->read(_totData, _totSize) != _totSize)
		return false;

	return true;
}