コード例 #1
0
ファイル: about.cpp プロジェクト: klusark/twin
AboutDialog::AboutDialog()
	: Dialog(10, 20, 300, 174),
	_scrollPos(0), _scrollTime(0), _willClose(false) {

	reflowLayout();

	int i;

	for (i = 0; i < 1; i++)
		_lines.push_back("");

	Common::String version("C0""ResidualVM ");
	version += gScummVMVersion;
	_lines.push_back(version);

	Common::String date = Common::String::format(_("(built on %s)"), gScummVMBuildDate);
	_lines.push_back("C2" + date);

	for (i = 0; i < ARRAYSIZE(copyright_text); i++)
		addLine(copyright_text[i]);

	Common::String features("C1");
	features += _("Features compiled in:");
	addLine(features.c_str());
	Common::String featureList("C0");
	featureList += gScummVMFeatures;
	addLine(featureList.c_str());

	_lines.push_back("");

	Common::String engines("C1");
	engines += _("Available engines:");
	addLine(engines.c_str());

	const EnginePlugin::List &plugins = EngineMan.getPlugins();
	EnginePlugin::List::const_iterator iter = plugins.begin();
	for (; iter != plugins.end(); ++iter) {
		Common::String str;
		str = "C0";
		str += (**iter).getName();
		addLine(str.c_str());

		str = "C2";
		str += (**iter)->getOriginalCopyright();
		addLine(str.c_str());

		//addLine("");
	}

	for (i = 0; i < ARRAYSIZE(gpl_text); i++)
		addLine(gpl_text[i]);

	_lines.push_back("");

	for (i = 0; i < ARRAYSIZE(credits); i++)
		addLine(credits[i]);
}
コード例 #2
0
ファイル: sci_consumer.cpp プロジェクト: gkalab/cb2pgn
save::State
Consumer::endGame(TagSet const& tags)
{
	unsigned dataOffset = m_strm.tellp();

	encodeTextSection();
	encodeDataSection(engines());
	encodeTags(tags, allowedTags(), allowExtraTags());

	ByteStream::set(m_strm.base() + m_streamPos, uint24_t(dataOffset));
	m_stream.provide();

	return m_codec.addGame(m_stream, tags, *this);
}
コード例 #3
0
ファイル: sci_consumer.cpp プロジェクト: gkalab/cb2pgn
save::State
Consumer::endGame(TagSet const& tags)
{
	TagSet const* tagSet = &tags;
	TagSet* myTags = 0;

	if (m_text.tellp() > 0 && m_lastCommentPos == plyCount() && !tags.contains(tag::Termination))
	{
		result::ID result = result::fromString(tags.value(tag::Result));

		if (result == result::White || result == result::Black)
		{
			Byte const* s = m_text.data() + m_text.tellp() - 1;

			while (s > m_text.base() && s[-1])
				--s;

			if (	::strcasecmp(reinterpret_cast<char const*>(s), "time") == 0
				|| ::strcasecmp(reinterpret_cast<char const*>(s), "time/") == 0
				|| ::strcasecmp(reinterpret_cast<char const*>(s), "time!") == 0
				|| ::strcasecmp(reinterpret_cast<char const*>(s), "time forfeit") == 0)
			{
				myTags = new TagSet(tags);
				myTags->set(tag::Termination, termination::toString(termination::TimeForfeit));
				tagSet = myTags;
			}
		}
	}

	unsigned dataOffset = m_strm.tellp();

	encodeTextSection();
	encodeDataSection(engines());
	encodeTags(*tagSet, allowedTags(), allowExtraTags());
	ByteStream::set(m_strm.base() + m_streamPos, uint24_t(dataOffset));

	m_stream.provide();
	save::State state = m_codec.addGame(m_stream, *tagSet, *this);

	if (myTags)
		delete myTags;

	return state;
}
コード例 #4
0
Transfer* Transfer::createInstance(Mode mode, int classID)
{
	const EngineEntry* entries = engines(mode);
	
	return entries[classID].lpfnCreate2(&entries[classID]);
}
コード例 #5
0
const char* Transfer::getEngineName(int id, Mode type)
{
	const EngineEntry* e = engines(type);
	return e[id].shortName;
}