Exemple #1
0
void SSFFile::load(Common::SeekableReadStream &ssf) {
	readHeader(ssf);

	if (_id != kSSFID)
		throw Common::Exception("Not a SSF file");

	if ((_version != kVersion1) && (_version != kVersion11))
		throw Common::Exception("Unsupported SSF file version %08X", _version);

	uint32 entryCount = 0;
	if (_version == kVersion1)
		entryCount = ssf.readUint32LE();

	uint32 offEntryTable = ssf.readUint32LE();

	if (_version == kVersion11)
		entryCount = (ssf.size() - offEntryTable) / 4;

	_sounds.resize(entryCount);

	try {

		readEntries(ssf, offEntryTable);

		if (ssf.err())
			throw Common::Exception(Common::kReadError);

	} catch (Common::Exception &e) {
		e.add("Failed reading SSF file");
		throw e;
	}

}
Exemple #2
0
void  Singledata::save(vector<string> liBigEntries)
{

     printlog( "Save Data = " ,ID ) ;
     readEntries();
     printlog( "Save Data = ", ID ) ;
     saveValues();

}
Exemple #3
0
void UserMenuGui::createMenu()
{
//    qDebug() << "UserMenuGui::createMenu called" << endl;
    clear();
    setTitle(i18n("User Menu"));

    // read entries from config file.
    readEntries();

    // add the "add new entry" command
    addSeparator();
    _manageAction = addAction(i18n("Manage user actions"));
}
Exemple #4
0
void DLGFile::load(const GFFStruct &dlg) {
	// General properties

	_delayEntry = dlg.getUint("DelayEntry", 0);
	_delayReply = dlg.getUint("DelayReply", 0);

	_convAbort = dlg.getString("EndConverAbort");
	_convEnd   = dlg.getString("EndConversation");

	_noZoomIn = !dlg.getBool("PreventZoomIn", true);

	// NPC lines ("entries")

	uint32 entryCount;
	const GFFList &entries = dlg.getList("EntryList", entryCount);

	_entriesNPC.reserve(entryCount);

	readEntries(entries, _entriesNPC, false);

	// PC lines ("replies")

	uint32 replyCount;
	const GFFList &replies = dlg.getList("ReplyList", replyCount);

	_entriesPC.reserve(replyCount);

	readEntries(replies, _entriesPC, true);

	// Starting lines (greetings)

	uint32 startCount;
	const GFFList &starters = dlg.getList("StartingList", startCount);

	_entriesStart.reserve(startCount);

	readLinks(starters, _entriesStart);
}
Exemple #5
0
void SSFFile::load(Common::SeekableReadStream &ssf) {
	try {
		size_t entryCount, offEntryTable;
		Version version = readSSFHeader(ssf, entryCount, offEntryTable);

		_sounds.resize(entryCount);

		readEntries(ssf, version, offEntryTable);

	} catch (Common::Exception &e) {
		e.add("Failed reading SSF file");
		throw;
	}
}
Exemple #6
0
int SSFFile::init(int n)
{
	if(!reading()) return errcode = 6;
	if(n == -1) n = initstages;
	if((n > 0) && !inited[0] && readHeader()) return errcode;
	if((n > 1) && !inited[1] && readEntries()) return errcode;
	if((n > 2) && !inited[2] && readData()) return errcode;
	if((n > 3) && !inited[3])
	{
		close();
		inited.set(3);
	}
	return errcode = 0;
}