[Scummvm-cvs-logs] SF.net SVN: scummvm:[34589] scummvm/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Sep 17 19:31:33 CEST 2008
Revision: 34589
http://scummvm.svn.sourceforge.net/scummvm/?rev=34589&view=rev
Author: fingolfin
Date: 2008-09-17 17:31:29 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
Moved base/game.* to engines/game.*
Modified Paths:
--------------
scummvm/trunk/base/module.mk
scummvm/trunk/common/advancedDetector.h
scummvm/trunk/engines/metaengine.h
scummvm/trunk/engines/module.mk
scummvm/trunk/gui/launcher.h
Added Paths:
-----------
scummvm/trunk/engines/game.cpp
scummvm/trunk/engines/game.h
Removed Paths:
-------------
scummvm/trunk/base/game.cpp
scummvm/trunk/base/game.h
Deleted: scummvm/trunk/base/game.cpp
===================================================================
--- scummvm/trunk/base/game.cpp 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/base/game.cpp 2008-09-17 17:31:29 UTC (rev 34589)
@@ -1,116 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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.
-
- * 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.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "base/game.h"
-#include "base/plugins.h"
-#include "graphics/surface.h"
-
-
-const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list) {
- const PlainGameDescriptor *g = list;
- while (g->gameid) {
- if (0 == scumm_stricmp(gameid, g->gameid))
- return g;
- g++;
- }
- return 0;
-}
-
-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
- // the seperator (instead of '/' use ', ' or ' ').
- const bool hasCustomLanguage = (language() != Common::UNK_LANG);
- const bool hasCustomPlatform = (platform() != Common::kPlatformUnknown);
- const bool hasExtraDesc = (extra && extra[0]);
-
- // Adapt the description string if custom platform/language is set.
- if (hasCustomLanguage || hasCustomPlatform || hasExtraDesc) {
- Common::String descr = description();
-
- descr += " (";
- if (hasExtraDesc)
- descr += extra;
- if (hasCustomPlatform) {
- if (hasExtraDesc)
- descr += "/";
- descr += Common::getPlatformDescription(platform());
- }
- if (hasCustomLanguage) {
- if (hasExtraDesc || hasCustomPlatform)
- descr += "/";
- descr += Common::getLanguageDescription(language());
- }
- descr += ")";
- setVal("description", descr);
- }
-}
-
-void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
- if (_thumbnail.get() == t)
- return;
-
- _thumbnail = Common::SharedPtr<Graphics::Surface>(t, Graphics::SharedPtrSurfaceDeleter());
-}
-
-bool SaveStateDescriptor::getBool(const Common::String &key) const {
- if (contains(key)) {
- Common::String value = getVal(key);
- if (value.equalsIgnoreCase("true") ||
- value.equalsIgnoreCase("yes") ||
- value.equals("1"))
- return true;
- if (value.equalsIgnoreCase("false") ||
- value.equalsIgnoreCase("no") ||
- value.equals("0"))
- return false;
- error("SaveStateDescriptor: %s '%s' has unknown value '%s' for boolean '%s'",
- save_slot().c_str(), description().c_str(), value.c_str(), key.c_str());
- }
- return false;
-}
-
-void SaveStateDescriptor::setDeletableFlag(bool state) {
- setVal("is_deletable", state ? "true" : "false");
-}
-
-void SaveStateDescriptor::setSaveDate(int year, int month, int day) {
- char buffer[32];
- snprintf(buffer, 32, "%.2d.%.2d.%.4d", day, month, year);
- setVal("save_date", buffer);
-}
-
-void SaveStateDescriptor::setSaveTime(int hour, int min) {
- char buffer[32];
- snprintf(buffer, 32, "%.2d:%.2d", hour, min);
- setVal("save_time", buffer);
-}
-
-void SaveStateDescriptor::setPlayTime(int hours, int minutes) {
- char buffer[32];
- snprintf(buffer, 32, "%.2d:%.2d", hours, minutes);
- setVal("play_time", buffer);
-}
-
Deleted: scummvm/trunk/base/game.h
===================================================================
--- scummvm/trunk/base/game.h 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/base/game.h 2008-09-17 17:31:29 UTC (rev 34589)
@@ -1,210 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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.
-
- * 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.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef BASE_GAME_H
-#define BASE_GAME_H
-
-#include "common/str.h"
-#include "common/array.h"
-#include "common/hash-str.h"
-#include "common/ptr.h"
-
-namespace Graphics {
- struct Surface;
-}
-
-/**
- * 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;
-};
-
-/**
- * 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 must 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() {
- setVal("gameid", "");
- setVal("description", "");
- }
-
- GameDescriptor(const PlainGameDescriptor &pgd) {
- setVal("gameid", pgd.gameid);
- setVal("description", pgd.description);
- }
-
- GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l = Common::UNK_LANG,
- Common::Platform p = Common::kPlatformUnknown) {
- setVal("gameid", g);
- setVal("description", d);
- if (l != Common::UNK_LANG)
- setVal("language", Common::getLanguageCode(l));
- if (p != Common::kPlatformUnknown)
- setVal("platform", Common::getPlatformCode(p));
- }
-
- /**
- * Update the description string by appending (LANG/PLATFORM/EXTRA) to it.
- */
- void updateDesc(const char *extra = 0);
-
- Common::String &gameid() { return getVal("gameid"); }
- Common::String &description() { return getVal("description"); }
- const Common::String &gameid() const { return getVal("gameid"); }
- const Common::String &description() const { return getVal("description"); }
- Common::Language language() const { return contains("language") ? Common::parseLanguage(getVal("language")) : Common::UNK_LANG; }
- Common::Platform platform() const { return contains("platform") ? Common::parsePlatform(getVal("platform")) : Common::kPlatformUnknown; }
-
- const Common::String &preferredtarget() const {
- return contains("preferredtarget") ? getVal("preferredtarget") : getVal("gameid");
- }
-};
-
-/** List of games. */
-class GameList : public Common::Array<GameDescriptor> {
-public:
- GameList() {}
- GameList(const GameList &list) : Common::Array<GameDescriptor>(list) {}
- GameList(const PlainGameDescriptor *g) {
- while (g->gameid) {
- push_back(GameDescriptor(g->gameid, g->description));
- g++;
- }
- }
-};
-
-/**
- * A hashmap describing details about a given save state.
- * TODO
- * Guaranteed to contain save_slot, filename and description values.
- * Additional ideas: Playtime, creation date, thumbnail, ...
- */
-class SaveStateDescriptor : public Common::StringMap {
-protected:
- Common::SharedPtr<Graphics::Surface> _thumbnail; // can be 0
-
-public:
- SaveStateDescriptor() : _thumbnail() {
- setVal("save_slot", "-1"); // FIXME: default to 0 (first slot) or to -1 (invalid slot) ?
- setVal("description", "");
- setVal("filename", "");
- }
-
- SaveStateDescriptor(int s, const Common::String &d, const Common::String &f) : _thumbnail() {
- char buf[16];
- sprintf(buf, "%d", s);
- setVal("save_slot", buf);
- setVal("description", d);
- setVal("filename", f);
- }
-
- SaveStateDescriptor(const Common::String &s, const Common::String &d, const Common::String &f) : _thumbnail() {
- setVal("save_slot", s);
- setVal("description", d);
- setVal("filename", f);
- }
-
- /** The saveslot id, as it would be passed to the "-x" command line switch. */
- Common::String &save_slot() { return getVal("save_slot"); }
-
- /** The saveslot id, as it would be passed to the "-x" command line switch (read-only variant). */
- const Common::String &save_slot() const { return getVal("save_slot"); }
-
- /** A human readable description of the save state. */
- Common::String &description() { return getVal("description"); }
-
- /** A human readable description of the save state (read-only variant). */
- const Common::String &description() const { return getVal("description"); }
-
- /** The filename of the savestate, for use with the SaveFileManager API. */
- Common::String &filename() { return getVal("filename"); }
-
- /** The filename of the savestate, for use with the SaveFileManager API (read-only variant). */
- const Common::String &filename() const { return getVal("filename"); }
-
- /** Optional entries only included when querying via MetaEngine::querySaveMetaInfo */
-
- /**
- * Returns the value of a given key as boolean.
- * It accepts 'true', 'yes' and '1' for true and
- * 'false', 'no' and '0' for false.
- * (FIXME:) On unknown value it errors out ScummVM.
- * On unknown key it returns false as default.
- */
- bool getBool(const Common::String &key) const;
-
- /**
- * Sets the 'is_deletable' key, which indicates, if the
- * given savestate is safe for deletion.
- */
- void setDeletableFlag(bool state);
-
- /**
- * Return a thumbnail graphics surface representing the savestate visually
- * This is usually a scaled down version of the game graphics. The size
- * should be either 160x100 or 160x120 pixels, depending on the aspect
- * ratio of the game. If another ratio is required, contact the core team.
- */
- const Graphics::Surface *getThumbnail() const { return _thumbnail.get(); }
-
- void setThumbnail(Graphics::Surface *t);
-
- /**
- * Sets the 'save_date' key properly, based on the given values
- */
- void setSaveDate(int year, int month, int day);
-
- /**
- * Sets the 'save_time' key properly, based on the given values
- */
- void setSaveTime(int hour, int min);
-
- /**
- * Sets the 'play_time' key properly, based on the given values
- */
- void setPlayTime(int hours, int minutes);
-};
-
-/** List of savestates. */
-typedef Common::Array<SaveStateDescriptor> SaveStateList;
-
-#endif
Modified: scummvm/trunk/base/module.mk
===================================================================
--- scummvm/trunk/base/module.mk 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/base/module.mk 2008-09-17 17:31:29 UTC (rev 34589)
@@ -3,7 +3,6 @@
MODULE_OBJS := \
main.o \
commandLine.o \
- game.o \
plugins.o \
version.o
Modified: scummvm/trunk/common/advancedDetector.h
===================================================================
--- scummvm/trunk/common/advancedDetector.h 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/common/advancedDetector.h 2008-09-17 17:31:29 UTC (rev 34589)
@@ -28,8 +28,6 @@
#include "common/fs.h"
#include "common/error.h"
-#include "base/game.h" // For PlainGameDescriptor and GameList
-
#include "engines/metaengine.h"
namespace Common {
Copied: scummvm/trunk/engines/game.cpp (from rev 34587, scummvm/trunk/base/game.cpp)
===================================================================
--- scummvm/trunk/engines/game.cpp (rev 0)
+++ scummvm/trunk/engines/game.cpp 2008-09-17 17:31:29 UTC (rev 34589)
@@ -0,0 +1,116 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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.
+
+ * 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.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "engines/game.h"
+#include "base/plugins.h"
+#include "graphics/surface.h"
+
+
+const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list) {
+ const PlainGameDescriptor *g = list;
+ while (g->gameid) {
+ if (0 == scumm_stricmp(gameid, g->gameid))
+ return g;
+ g++;
+ }
+ return 0;
+}
+
+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
+ // the seperator (instead of '/' use ', ' or ' ').
+ const bool hasCustomLanguage = (language() != Common::UNK_LANG);
+ const bool hasCustomPlatform = (platform() != Common::kPlatformUnknown);
+ const bool hasExtraDesc = (extra && extra[0]);
+
+ // Adapt the description string if custom platform/language is set.
+ if (hasCustomLanguage || hasCustomPlatform || hasExtraDesc) {
+ Common::String descr = description();
+
+ descr += " (";
+ if (hasExtraDesc)
+ descr += extra;
+ if (hasCustomPlatform) {
+ if (hasExtraDesc)
+ descr += "/";
+ descr += Common::getPlatformDescription(platform());
+ }
+ if (hasCustomLanguage) {
+ if (hasExtraDesc || hasCustomPlatform)
+ descr += "/";
+ descr += Common::getLanguageDescription(language());
+ }
+ descr += ")";
+ setVal("description", descr);
+ }
+}
+
+void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
+ if (_thumbnail.get() == t)
+ return;
+
+ _thumbnail = Common::SharedPtr<Graphics::Surface>(t, Graphics::SharedPtrSurfaceDeleter());
+}
+
+bool SaveStateDescriptor::getBool(const Common::String &key) const {
+ if (contains(key)) {
+ Common::String value = getVal(key);
+ if (value.equalsIgnoreCase("true") ||
+ value.equalsIgnoreCase("yes") ||
+ value.equals("1"))
+ return true;
+ if (value.equalsIgnoreCase("false") ||
+ value.equalsIgnoreCase("no") ||
+ value.equals("0"))
+ return false;
+ error("SaveStateDescriptor: %s '%s' has unknown value '%s' for boolean '%s'",
+ save_slot().c_str(), description().c_str(), value.c_str(), key.c_str());
+ }
+ return false;
+}
+
+void SaveStateDescriptor::setDeletableFlag(bool state) {
+ setVal("is_deletable", state ? "true" : "false");
+}
+
+void SaveStateDescriptor::setSaveDate(int year, int month, int day) {
+ char buffer[32];
+ snprintf(buffer, 32, "%.2d.%.2d.%.4d", day, month, year);
+ setVal("save_date", buffer);
+}
+
+void SaveStateDescriptor::setSaveTime(int hour, int min) {
+ char buffer[32];
+ snprintf(buffer, 32, "%.2d:%.2d", hour, min);
+ setVal("save_time", buffer);
+}
+
+void SaveStateDescriptor::setPlayTime(int hours, int minutes) {
+ char buffer[32];
+ snprintf(buffer, 32, "%.2d:%.2d", hours, minutes);
+ setVal("play_time", buffer);
+}
+
Copied: scummvm/trunk/engines/game.h (from rev 34587, scummvm/trunk/base/game.h)
===================================================================
--- scummvm/trunk/engines/game.h (rev 0)
+++ scummvm/trunk/engines/game.h 2008-09-17 17:31:29 UTC (rev 34589)
@@ -0,0 +1,210 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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.
+
+ * 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.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef ENGINES_GAME_H
+#define ENGINES_GAME_H
+
+#include "common/str.h"
+#include "common/array.h"
+#include "common/hash-str.h"
+#include "common/ptr.h"
+
+namespace Graphics {
+ struct Surface;
+}
+
+/**
+ * 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;
+};
+
+/**
+ * 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 must 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() {
+ setVal("gameid", "");
+ setVal("description", "");
+ }
+
+ GameDescriptor(const PlainGameDescriptor &pgd) {
+ setVal("gameid", pgd.gameid);
+ setVal("description", pgd.description);
+ }
+
+ GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l = Common::UNK_LANG,
+ Common::Platform p = Common::kPlatformUnknown) {
+ setVal("gameid", g);
+ setVal("description", d);
+ if (l != Common::UNK_LANG)
+ setVal("language", Common::getLanguageCode(l));
+ if (p != Common::kPlatformUnknown)
+ setVal("platform", Common::getPlatformCode(p));
+ }
+
+ /**
+ * Update the description string by appending (LANG/PLATFORM/EXTRA) to it.
+ */
+ void updateDesc(const char *extra = 0);
+
+ Common::String &gameid() { return getVal("gameid"); }
+ Common::String &description() { return getVal("description"); }
+ const Common::String &gameid() const { return getVal("gameid"); }
+ const Common::String &description() const { return getVal("description"); }
+ Common::Language language() const { return contains("language") ? Common::parseLanguage(getVal("language")) : Common::UNK_LANG; }
+ Common::Platform platform() const { return contains("platform") ? Common::parsePlatform(getVal("platform")) : Common::kPlatformUnknown; }
+
+ const Common::String &preferredtarget() const {
+ return contains("preferredtarget") ? getVal("preferredtarget") : getVal("gameid");
+ }
+};
+
+/** List of games. */
+class GameList : public Common::Array<GameDescriptor> {
+public:
+ GameList() {}
+ GameList(const GameList &list) : Common::Array<GameDescriptor>(list) {}
+ GameList(const PlainGameDescriptor *g) {
+ while (g->gameid) {
+ push_back(GameDescriptor(g->gameid, g->description));
+ g++;
+ }
+ }
+};
+
+/**
+ * A hashmap describing details about a given save state.
+ * TODO
+ * Guaranteed to contain save_slot, filename and description values.
+ * Additional ideas: Playtime, creation date, thumbnail, ...
+ */
+class SaveStateDescriptor : public Common::StringMap {
+protected:
+ Common::SharedPtr<Graphics::Surface> _thumbnail; // can be 0
+
+public:
+ SaveStateDescriptor() : _thumbnail() {
+ setVal("save_slot", "-1"); // FIXME: default to 0 (first slot) or to -1 (invalid slot) ?
+ setVal("description", "");
+ setVal("filename", "");
+ }
+
+ SaveStateDescriptor(int s, const Common::String &d, const Common::String &f) : _thumbnail() {
+ char buf[16];
+ sprintf(buf, "%d", s);
+ setVal("save_slot", buf);
+ setVal("description", d);
+ setVal("filename", f);
+ }
+
+ SaveStateDescriptor(const Common::String &s, const Common::String &d, const Common::String &f) : _thumbnail() {
+ setVal("save_slot", s);
+ setVal("description", d);
+ setVal("filename", f);
+ }
+
+ /** The saveslot id, as it would be passed to the "-x" command line switch. */
+ Common::String &save_slot() { return getVal("save_slot"); }
+
+ /** The saveslot id, as it would be passed to the "-x" command line switch (read-only variant). */
+ const Common::String &save_slot() const { return getVal("save_slot"); }
+
+ /** A human readable description of the save state. */
+ Common::String &description() { return getVal("description"); }
+
+ /** A human readable description of the save state (read-only variant). */
+ const Common::String &description() const { return getVal("description"); }
+
+ /** The filename of the savestate, for use with the SaveFileManager API. */
+ Common::String &filename() { return getVal("filename"); }
+
+ /** The filename of the savestate, for use with the SaveFileManager API (read-only variant). */
+ const Common::String &filename() const { return getVal("filename"); }
+
+ /** Optional entries only included when querying via MetaEngine::querySaveMetaInfo */
+
+ /**
+ * Returns the value of a given key as boolean.
+ * It accepts 'true', 'yes' and '1' for true and
+ * 'false', 'no' and '0' for false.
+ * (FIXME:) On unknown value it errors out ScummVM.
+ * On unknown key it returns false as default.
+ */
+ bool getBool(const Common::String &key) const;
+
+ /**
+ * Sets the 'is_deletable' key, which indicates, if the
+ * given savestate is safe for deletion.
+ */
+ void setDeletableFlag(bool state);
+
+ /**
+ * Return a thumbnail graphics surface representing the savestate visually
+ * This is usually a scaled down version of the game graphics. The size
+ * should be either 160x100 or 160x120 pixels, depending on the aspect
+ * ratio of the game. If another ratio is required, contact the core team.
+ */
+ const Graphics::Surface *getThumbnail() const { return _thumbnail.get(); }
+
+ void setThumbnail(Graphics::Surface *t);
+
+ /**
+ * Sets the 'save_date' key properly, based on the given values
+ */
+ void setSaveDate(int year, int month, int day);
+
+ /**
+ * Sets the 'save_time' key properly, based on the given values
+ */
+ void setSaveTime(int hour, int min);
+
+ /**
+ * Sets the 'play_time' key properly, based on the given values
+ */
+ void setPlayTime(int hours, int minutes);
+};
+
+/** List of savestates. */
+typedef Common::Array<SaveStateDescriptor> SaveStateList;
+
+#endif
Modified: scummvm/trunk/engines/metaengine.h
===================================================================
--- scummvm/trunk/engines/metaengine.h 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/engines/metaengine.h 2008-09-17 17:31:29 UTC (rev 34589)
@@ -29,7 +29,7 @@
#include "common/str.h"
#include "common/error.h"
-#include "base/game.h"
+#include "engines/game.h"
#include "base/plugins.h"
class Engine;
Modified: scummvm/trunk/engines/module.mk
===================================================================
--- scummvm/trunk/engines/module.mk 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/engines/module.mk 2008-09-17 17:31:29 UTC (rev 34589)
@@ -1,7 +1,9 @@
MODULE := engines
MODULE_OBJS := \
+ dialogs.o \
engine.o \
- dialogs.o
+ game.o
+
# Include common rules
include $(srcdir)/rules.mk
Modified: scummvm/trunk/gui/launcher.h
===================================================================
--- scummvm/trunk/gui/launcher.h 2008-09-17 16:50:19 UTC (rev 34588)
+++ scummvm/trunk/gui/launcher.h 2008-09-17 17:31:29 UTC (rev 34589)
@@ -26,7 +26,7 @@
#define LAUNCHER_DIALOG_H
#include "gui/dialog.h"
-#include "base/game.h"
+#include "engines/game.h"
#include "common/str.h"
namespace GUI {
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