* Added copyright string to all engine plugins

* Modified about dialog to list all available plugins with their resp. copyright
* Modified about dialog credits to show the GPL last (like movie end credits do with their legal text, too)

svn-id: r23645
This commit is contained in:
Max Horn 2006-07-31 13:41:21 +00:00
parent a1bb64e24b
commit 4a80db4c7b
16 changed files with 70 additions and 42 deletions

View file

@ -519,11 +519,10 @@ unknownOption:
/** List all supported game IDs, i.e. all games which any loaded plugin supports. */
static void listGames() {
const PluginList &plugins = PluginManager::instance().getPlugins();
printf("Game ID Full Title \n"
"-------------------- ------------------------------------------------------\n");
const PluginList &plugins = PluginManager::instance().getPlugins();
PluginList::const_iterator iter = plugins.begin();
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
GameList list = (*iter)->getSupportedGames();
@ -535,12 +534,11 @@ static void listGames() {
/** List all targets which are configured in the config file. */
static void listTargets() {
using namespace Common;
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
printf("Target Description \n"
"-------------------- ------------------------------------------------------\n");
using namespace Common;
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
ConfigManager::DomainMap::const_iterator iter = domains.begin();
for (iter = domains.begin(); iter != domains.end(); ++iter) {
Common::String name(iter->_key);

View file

@ -60,8 +60,8 @@ typedef DetectedGameList (*DetectFunc)(const FSList &fslist);
#else
PluginRegistrator::PluginRegistrator(const char *name, GameList games, GameIDQueryFunc qf, EngineFactory ef, DetectFunc df)
: _name(name), _qf(qf), _ef(ef), _df(df), _games(games) {
PluginRegistrator::PluginRegistrator(const char *name, const char *copyright, GameList games, GameIDQueryFunc qf, EngineFactory ef, DetectFunc df)
: _name(name), _copyright(copyright), _qf(qf), _ef(ef), _df(df), _games(games) {
//printf("Automatically registered plugin '%s'\n", name);
}
@ -115,6 +115,7 @@ public:
}
const char *getName() const { return _plugin->_name; }
const char *getCopyright() const { return _plugin->_copyright; }
PluginError createInstance(OSystem *syst, Engine **engine) const {
assert(_plugin->_ef);
@ -144,6 +145,7 @@ class DynamicPlugin : public Plugin {
Common::String _filename;
Common::String _name;
Common::String _copyright;
GameIDQueryFunc _qf;
EngineFactory _ef;
DetectFunc _df;
@ -156,6 +158,7 @@ public:
: _dlHandle(0), _filename(filename), _qf(0), _ef(0), _df(0), _games() {}
const char *getName() const { return _name.c_str(); }
const char *getCopyright() const { return _copyright.c_str(); }
PluginError createInstance(OSystem *syst, Engine **engine) const {
assert(_ef);
@ -226,6 +229,14 @@ bool DynamicPlugin::loadPlugin() {
}
_name = nameFunc();
// Query the plugin's copyright
nameFunc = (NameFunc)findSymbol("PLUGIN_copyright");
if (!nameFunc) {
unloadPlugin();
return false;
}
_copyright = nameFunc();
// Query the plugin for the game ids it supports
GameIDListFunc gameListFunc = (GameIDListFunc)findSymbol("PLUGIN_gameIDList");
if (!gameListFunc) {
@ -316,7 +327,7 @@ void PluginManager::loadPlugins() {
}
for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
Common::String name(i->displayName());
Common::String name(i->name());
if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
tryLoadPlugin(new DynamicPlugin(i->path()));
}

View file

@ -92,6 +92,7 @@ public:
virtual void unloadPlugin() {}
virtual const char *getName() const = 0;
virtual const char *getCopyright() const = 0;
virtual int getVersion() const { return 0; } // TODO!
virtual GameList getSupportedGames() const = 0;
@ -127,10 +128,10 @@ public:
*/
#ifndef DYNAMIC_MODULES
#define REGISTER_PLUGIN(ID,name) \
#define REGISTER_PLUGIN(ID,name,copyright) \
PluginRegistrator *g_##ID##_PluginReg; \
void g_##ID##_PluginReg_alloc() { \
g_##ID##_PluginReg = new PluginRegistrator(name, \
g_##ID##_PluginReg = new PluginRegistrator(name, copyright, \
Engine_##ID##_gameIDList(), \
Engine_##ID##_findGameID, \
Engine_##ID##_create, \
@ -139,9 +140,10 @@ public:
} \
void dummyFuncToAllowTrailingSemicolon()
#else
#define REGISTER_PLUGIN(ID,name) \
#define REGISTER_PLUGIN(ID,name,copyright) \
extern "C" { \
PLUGIN_EXPORT const char *PLUGIN_name() { return name; } \
PLUGIN_EXPORT const char *PLUGIN_copyright() { return copyright; } \
PLUGIN_EXPORT GameList PLUGIN_gameIDList() { return Engine_##ID##_gameIDList(); } \
PLUGIN_EXPORT GameDescriptor PLUGIN_findGameID(const char *gameid) { return Engine_##ID##_findGameID(gameid); } \
PLUGIN_EXPORT PluginError PLUGIN_createEngine(OSystem *syst, Engine **engine) { return Engine_##ID##_create(syst, engine); } \
@ -164,13 +166,14 @@ public:
protected:
const char *_name;
const char *_copyright;
GameIDQueryFunc _qf;
EngineFactory _ef;
DetectFunc _df;
GameList _games;
public:
PluginRegistrator(const char *name, GameList games, GameIDQueryFunc qf, EngineFactory ef, DetectFunc df);
PluginRegistrator(const char *name, const char *copyright, GameList games, GameIDQueryFunc qf, EngineFactory ef, DetectFunc df);
};
#endif

View file

@ -640,4 +640,4 @@ PluginError Engine_AGI_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(AGI, "AGI Engine");
REGISTER_PLUGIN(AGI, "AGI Engine", "TODO (C) TODO");

View file

@ -117,7 +117,7 @@ PluginError Engine_CINE_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(CINE, "CINE Engine");
REGISTER_PLUGIN(CINE, "CINE Engine", "TODO (C) TODO");
namespace Cine {

View file

@ -419,4 +419,4 @@ PluginError Engine_GOB_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(GOB, "Gob Engine");
REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision");

View file

@ -255,7 +255,7 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine");
REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine", "The Legend of Kyrandia (C) Westwood Studios");
#pragma mark -

View file

@ -159,7 +159,7 @@ PluginError Engine_LURE_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(LURE, "Lure of the Temptress Engine");
REGISTER_PLUGIN(LURE, "Lure of the Temptress Engine", "Lure of the Temptress (C) Revolution");
namespace Lure {

View file

@ -130,7 +130,7 @@ PluginError Engine_QUEEN_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(QUEEN, "Flight of the Amazon Queen");
REGISTER_PLUGIN(QUEEN, "Flight of the Amazon Queen", "Flight of the Amazon Queen (C) John Passfield and Steve Stamatiadis");
namespace Queen {

View file

@ -82,7 +82,7 @@ PluginError Engine_SAGA_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(SAGA, "SAGA Engine");
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
namespace Saga {
#include "sagagame.cpp"

View file

@ -1508,7 +1508,9 @@ PluginError Engine_SCUMM_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(SCUMM, "Scumm Engine");
REGISTER_PLUGIN(SCUMM, "Scumm Engine",
"LucasArts SCUMM Games (C) LucasArts\n"
"Humongous SCUMM Games (C) Humongous" );
#ifdef PALMOS_68K
#include "scumm_globals.h"

View file

@ -135,7 +135,7 @@ PluginError Engine_SIMON_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(SIMON, "Simon the Sorcerer");
REGISTER_PLUGIN(SIMON, "Simon the Sorcerer", "Simon the Sorcerer (C) Adventure Soft");
namespace Simon {

View file

@ -115,7 +115,7 @@ PluginError Engine_SKY_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(SKY, "Beneath a Steel Sky");
REGISTER_PLUGIN(SKY, "Beneath a Steel Sky", "Beneath a Steel Sky (C) Revolution");
namespace Sky {

View file

@ -125,7 +125,7 @@ PluginError Engine_SWORD1_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(SWORD1, "Broken Sword");
REGISTER_PLUGIN(SWORD1, "Broken Sword", "Broken Sword Games (C) Revolution");
namespace Sword1 {

View file

@ -116,7 +116,7 @@ PluginError Engine_SWORD2_create(OSystem *syst, Engine **engine) {
return kNoError;
}
REGISTER_PLUGIN(SWORD2, "Broken Sword 2");
REGISTER_PLUGIN(SWORD2, "Broken Sword 2", "Broken Sword Games (C) Revolution");
namespace Sword2 {

View file

@ -21,6 +21,7 @@
#include "common/stdafx.h"
#include "base/engine.h"
#include "base/plugins.h"
#include "base/version.h"
#include "common/system.h"
#include "common/util.h"
@ -50,21 +51,7 @@ enum {
//
// TODO: Add different font sizes (for bigger headlines)
// TODO: Allow color change in the middle of a line...
static const char *credits_intro[] = {
"\\C""Copyright (C) 2002-2006 The ScummVM project",
"\\C""http://www.scummvm.org",
"\\C""",
"\\C""LucasArts SCUMM Games (C) LucasArts",
"\\C""Humongous SCUMM Games (C) Humongous",
"\\C""Simon the Sorcerer (C) Adventure Soft",
"\\C""Beneath a Steel Sky (C) Revolution",
"\\C""Broken Sword Games (C) Revolution",
"\\C""Flight of the Amazon Queen (C) John Passfield",
"\\C""and Steve Stamatiadis",
"\\C""Inherit the Earth (C) Wyrmkeep Entertainment",
"\\C""Goblins Games (C) Coktel Vision",
"\\C""The Legend of Kyrandia (C) Westwood Studios",
"\\C""",
static const char *gpl_text[] = {
"\\C""This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.",
"\\C""",
"\\C""This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.",
@ -116,18 +103,45 @@ AboutDialog::AboutDialog()
date += ')';
_lines.push_back(date);
Common::String features("\\C\\c2""Supports: ");
addLine("");
addLine("\\C""Copyright (C) 2002-2006 The ScummVM project");
addLine("\\C""http://www.scummvm.org");
addLine("");
addLine("\\C\\c1""Features compiled in:");
Common::String features("\\C");
features += gScummVMFeatures;
addLine(features.c_str());
_lines.push_back("");
for (i = 0; i < ARRAYSIZE(credits_intro); i++)
addLine(credits_intro[i]);
addLine("\\C\\c1""Available engines:");
const PluginList &plugins = PluginManager::instance().getPlugins();
PluginList::const_iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
Common::String str;
str = "\\C";
str += (**iter).getName();
addLine(str.c_str());
str = "\\C\\c2";
str += (**iter).getCopyright();
addLine(str.c_str());
//addLine("");
}
_lines.push_back("");
for (i = 0; i < ARRAYSIZE(credits); i++)
addLine(credits[i]);
_lines.push_back("");
for (i = 0; i < ARRAYSIZE(gpl_text); i++)
addLine(gpl_text[i]);
// Center the dialog
_x = (screenW - _w) / 2;
_y = (screenH - _h) / 2;