[Scummvm-cvs-logs] SF.net SVN: scummvm: [27422] scummvm/trunk/base
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Jun 15 19:16:23 CEST 2007
Revision: 27422
http://scummvm.svn.sourceforge.net/scummvm/?rev=27422&view=rev
Author: fingolfin
Date: 2007-06-15 10:13:13 -0700 (Fri, 15 Jun 2007)
Log Message:
-----------
Added some doxygen comments to (Plain)GameDescriptor, and added a findPlainGameDescriptor convenience function
Modified Paths:
--------------
scummvm/trunk/base/game.cpp
scummvm/trunk/base/game.h
Modified: scummvm/trunk/base/game.cpp
===================================================================
--- scummvm/trunk/base/game.cpp 2007-06-15 16:38:05 UTC (rev 27421)
+++ scummvm/trunk/base/game.cpp 2007-06-15 17:13:13 UTC (rev 27422)
@@ -26,6 +26,16 @@
#include "base/game.h"
#include "base/plugins.h"
+const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list) {
+ const PlainGameDescriptor *g = list;
+ while (g->gameid) {
+ if (0 == scumm_stricmp(gameid, g->gameid))
+ break;
+ g++;
+ }
+ return g;
+}
+
void GameDescriptor::updateDesc(const char *extra) {
// TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone.
// We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or
@@ -58,7 +68,7 @@
namespace Base {
-// TODO: Find a better place for this function.
+// TODO: Find a better name & place for this function.
GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin) {
// Find the GameDescriptor for this target
const PluginList &plugins = PluginManager::instance().getPlugins();
Modified: scummvm/trunk/base/game.h
===================================================================
--- scummvm/trunk/base/game.h 2007-06-15 16:38:05 UTC (rev 27421)
+++ scummvm/trunk/base/game.h 2007-06-15 17:13:13 UTC (rev 27422)
@@ -31,11 +31,31 @@
#include "common/array.h"
#include "common/hash-str.h"
+/**
+ * A simple structure used to map gameids (like "monkey", "sword1", ...) to
+ * nice human readable and descriptive game titles (like "The Secret of Monkey Island").
+ * This is a plain struct to make it possible to declare NULL-terminated C arrays
+ * consisting of PlainGameDescriptors.
+ */
struct PlainGameDescriptor {
const char *gameid;
- const char *description; // TODO: Rename this to "title" or so
+ const char *description;
};
+/**
+ * Given a list of PlainGameDescriptors, returns the first PlainGameDescriptor
+ * matching the given gameid. If not match is found return 0.
+ * The end of the list marked by a PlainGameDescriptor with gameid equal to 0.
+ */
+const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
+
+/**
+ * A hashmap describing details about a given game. In a sense this is a refined
+ * version of PlainGameDescriptor, as it also contains a gameid and a description string.
+ * But in addition, platform and language settings, as well as arbitrary other settings,
+ * can be contained in a GameDescriptor.
+ * This is an essential part of the glue between the game engines and the launcher code.
+ */
class GameDescriptor : public Common::StringMap {
public:
GameDescriptor() {
@@ -90,7 +110,7 @@
namespace Base {
-// TODO: Find a better place for this function.
+// TODO: Find a better name & place for this function.
GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL);
} // End of namespace Base
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