[Scummvm-cvs-logs] SF.net SVN: scummvm: [23645] scummvm/trunk/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Mon Jul 31 15:41:42 CEST 2006
Revision: 23645
Author: fingolfin
Date: 2006-07-31 06:41:21 -0700 (Mon, 31 Jul 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23645&view=rev
Log Message:
-----------
* 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)
Modified Paths:
--------------
scummvm/trunk/base/commandLine.cpp
scummvm/trunk/base/plugins.cpp
scummvm/trunk/base/plugins.h
scummvm/trunk/engines/agi/agi.cpp
scummvm/trunk/engines/cine/cine.cpp
scummvm/trunk/engines/gob/gob.cpp
scummvm/trunk/engines/kyra/plugin.cpp
scummvm/trunk/engines/lure/lure.cpp
scummvm/trunk/engines/queen/queen.cpp
scummvm/trunk/engines/saga/game.cpp
scummvm/trunk/engines/scumm/plugin.cpp
scummvm/trunk/engines/simon/game.cpp
scummvm/trunk/engines/sky/sky.cpp
scummvm/trunk/engines/sword1/sword1.cpp
scummvm/trunk/engines/sword2/sword2.cpp
scummvm/trunk/gui/about.cpp
Modified: scummvm/trunk/base/commandLine.cpp
===================================================================
--- scummvm/trunk/base/commandLine.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/base/commandLine.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -519,11 +519,10 @@
/** 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 @@
/** 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);
Modified: scummvm/trunk/base/plugins.cpp
===================================================================
--- scummvm/trunk/base/plugins.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/base/plugins.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -60,8 +60,8 @@
#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 @@
}
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 @@
Common::String _filename;
Common::String _name;
+ Common::String _copyright;
GameIDQueryFunc _qf;
EngineFactory _ef;
DetectFunc _df;
@@ -156,6 +158,7 @@
: _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 @@
}
_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 @@
}
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()));
}
Modified: scummvm/trunk/base/plugins.h
===================================================================
--- scummvm/trunk/base/plugins.h 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/base/plugins.h 2006-07-31 13:41:21 UTC (rev 23645)
@@ -92,6 +92,7 @@
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 @@
*/
#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 @@
} \
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 @@
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
Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/agi/agi.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -640,4 +640,4 @@
return kNoError;
}
-REGISTER_PLUGIN(AGI, "AGI Engine");
+REGISTER_PLUGIN(AGI, "AGI Engine", "TODO (C) TODO");
Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/cine/cine.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -117,7 +117,7 @@
return kNoError;
}
-REGISTER_PLUGIN(CINE, "CINE Engine");
+REGISTER_PLUGIN(CINE, "CINE Engine", "TODO (C) TODO");
namespace Cine {
Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/gob/gob.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -419,4 +419,4 @@
return kNoError;
}
-REGISTER_PLUGIN(GOB, "Gob Engine");
+REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision");
Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/kyra/plugin.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -255,7 +255,7 @@
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 -
Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/lure/lure.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -159,7 +159,7 @@
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 {
Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/queen/queen.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -130,7 +130,7 @@
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 {
Modified: scummvm/trunk/engines/saga/game.cpp
===================================================================
--- scummvm/trunk/engines/saga/game.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/saga/game.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -82,7 +82,7 @@
return kNoError;
}
-REGISTER_PLUGIN(SAGA, "SAGA Engine");
+REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
namespace Saga {
#include "sagagame.cpp"
Modified: scummvm/trunk/engines/scumm/plugin.cpp
===================================================================
--- scummvm/trunk/engines/scumm/plugin.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/scumm/plugin.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -1508,7 +1508,9 @@
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"
Modified: scummvm/trunk/engines/simon/game.cpp
===================================================================
--- scummvm/trunk/engines/simon/game.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/simon/game.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -135,7 +135,7 @@
return kNoError;
}
-REGISTER_PLUGIN(SIMON, "Simon the Sorcerer");
+REGISTER_PLUGIN(SIMON, "Simon the Sorcerer", "Simon the Sorcerer (C) Adventure Soft");
namespace Simon {
Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/sky/sky.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -115,7 +115,7 @@
return kNoError;
}
-REGISTER_PLUGIN(SKY, "Beneath a Steel Sky");
+REGISTER_PLUGIN(SKY, "Beneath a Steel Sky", "Beneath a Steel Sky (C) Revolution");
namespace Sky {
Modified: scummvm/trunk/engines/sword1/sword1.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sword1.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/sword1/sword1.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -125,7 +125,7 @@
return kNoError;
}
-REGISTER_PLUGIN(SWORD1, "Broken Sword");
+REGISTER_PLUGIN(SWORD1, "Broken Sword", "Broken Sword Games (C) Revolution");
namespace Sword1 {
Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/engines/sword2/sword2.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -116,7 +116,7 @@
return kNoError;
}
-REGISTER_PLUGIN(SWORD2, "Broken Sword 2");
+REGISTER_PLUGIN(SWORD2, "Broken Sword 2", "Broken Sword Games (C) Revolution");
namespace Sword2 {
Modified: scummvm/trunk/gui/about.cpp
===================================================================
--- scummvm/trunk/gui/about.cpp 2006-07-31 13:37:47 UTC (rev 23644)
+++ scummvm/trunk/gui/about.cpp 2006-07-31 13:41:21 UTC (rev 23645)
@@ -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 @@
//
// 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 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list