Example #1
0
void Door::loadAppearance(const Aurora::TwoDAFile &twoda, uint32 id) {
	uint32 column = twoda.headerToColumn("ModelName");
	if (column == Aurora::kFieldIDInvalid)
		column = twoda.headerToColumn("Model");

	_modelName = twoda.getRow(id).getString(column);
}
Example #2
0
File: door.cpp Project: kevL/xoreos
void Door::loadAppearance(const Aurora::TwoDAFile &twoda, uint32 id) {
	uint32 modelColumn = twoda.headerToColumn("ModelName");
	if (modelColumn == Aurora::kFieldIDInvalid)
		modelColumn = twoda.headerToColumn("Model");

	_invisible    = twoda.getRow(id).getInt("VisibleModel") == 0;
	_modelName    = twoda.getRow(id).getString(modelColumn);
	_soundAppType = twoda.getRow(id).getInt("SoundAppType");
}
Example #3
0
void Door::loadAppearance(const Aurora::TwoDAFile &twoda, uint32 id) {
	if (_modelName.empty())
		_modelName = twoda.getRow(id).getString("ModelName");
	if (_modelName.empty())
		_modelName = twoda.getRow(id).getString("NWN2_ModelName");
	if (_modelName.empty())
		_modelName = twoda.getRow(id).getString("Model");

	_invisible    = twoda.getRow(id).getInt("VisibleModel") == 0;
	_soundAppType = twoda.getRow(id).getInt("SoundAppType");
}
Example #4
0
void Door::loadAppearance(const Aurora::TwoDAFile &twoda, uint32 id) {
	if (_appearanceID == Aurora::kFieldIDInvalid)
		return;

	uint32 column = twoda.headerToColumn("ModelName");
	if (column == Aurora::kFieldIDInvalid)
		column = twoda.headerToColumn("Model");

	_modelName    = twoda.getRow(id).getString(column);
	_soundAppType = twoda.getRow(_appearanceID).getInt("SoundAppType");
}
Example #5
0
bool dump2DA(const Common::UString &name) {
	Common::SeekableReadStream *twoDAFile = 0;
	bool success = false;

	try {

		if (!(twoDAFile = ResMan.getResource(name, Aurora::kFileType2DA)))
			return false;

		Aurora::TwoDAFile twoda;

		twoda.load(*twoDAFile);

		success = twoda.dumpASCII(name + ".2da");

	} catch (...) {
	}

	delete twoDAFile;
	return success;
}
Example #6
0
void dump2DA(Aurora::TwoDAFile &twoDA, const Common::UString &outFile, Format format) {
	Common::WriteStream *out = 0;
	if (!outFile.empty())
		out = new Common::WriteFile(outFile);
	else
		out = new Common::StdOutStream;

	try {
		if (format == kFormat2DA)
			twoDA.dumpASCII(*out);
		else
			twoDA.dumpCSV(*out);

	} catch (...) {
		delete out;
		throw;
	}

	out->flush();

	delete out;
}