[Scummvm-cvs-logs] scummvm master -> 0b81ffedd429b3914cbb1dabcd0d53621c932aa4
Strangerke
Strangerke at scummvm.org
Wed Sep 17 23:12:37 CEST 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9cb37636cf CGE: Cleanup detection, implement fallbackDetect
1769003a9b CGE2: Implement fallbackDetect
0b81ffedd4 CGE2: Reduce the scope of a variable
Commit: 9cb37636cff0bb0ae537c69281287479898515b5
https://github.com/scummvm/scummvm/commit/9cb37636cff0bb0ae537c69281287479898515b5
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-09-17T23:09:34+02:00
Commit Message:
CGE: Cleanup detection, implement fallbackDetect
Changed paths:
engines/cge/detection.cpp
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp
index 45231fe..ee67fb8 100644
--- a/engines/cge/detection.cpp
+++ b/engines/cge/detection.cpp
@@ -28,24 +28,17 @@
#include "base/plugins.h"
#include "graphics/thumbnail.h"
#include "cge/cge.h"
+#include "cge/fileio.h"
namespace CGE {
-struct CgeGameDescription {
- ADGameDescription desc;
-};
-
#define GAMEOPTION_COLOR_BLIND_DEFAULT_OFF GUIO_GAMEOPTIONS1
-} // End of namespace CGE
-
static const PlainGameDescriptor CGEGames[] = {
{ "soltys", "Soltys" },
{ 0, 0 }
};
-namespace CGE {
-
static const ADGameDescription gameDescriptions[] = {
{
"soltys", "Freeware",
@@ -104,7 +97,6 @@ static const ADGameDescription gameDescriptions[] = {
AD_TABLE_END_MARKER
};
-} // End of namespace CGE
static const ADExtraGuiOptionsMap optionsList[] = {
{
@@ -122,7 +114,7 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class CGEMetaEngine : public AdvancedMetaEngine {
public:
- CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(CGE::CgeGameDescription), CGEGames, optionsList) {
+ CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(ADGameDescription), CGEGames, optionsList) {
_singleid = "soltys";
}
@@ -134,6 +126,7 @@ public:
return "Soltys (c) 1994-1996 L.K. Avalon";
}
+ virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const;
virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
virtual int getMaximumSaveSlot() const;
@@ -142,6 +135,44 @@ public:
virtual void removeSaveState(const char *target, int slot) const;
};
+static const ADFileBasedFallback fileBasedFallback[] = {
+ { &gameDescriptions[0], { "vol.cat", "vol.dat", 0 } },
+ { 0, { 0 } }
+};
+
+static ADGameDescription s_fallbackDesc = {
+ "Soltys",
+ "Unknown version",
+ AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
+ Common::UNK_LANG,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
+};
+
+const ADGameDescription *CGEMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
+ ADFilePropertiesMap filesProps;
+
+ const ADGameDescription *game;
+ game = detectGameFilebased(allFiles, fslist, CGE::fileBasedFallback, &filesProps);
+
+ if (!game)
+ return 0;
+
+ SearchMan.clear();
+ SearchMan.addDirectory(fslist.begin()->getParent().getPath(), fslist.begin()->getParent());
+ ResourceManager *resman;
+ resman = new ResourceManager();
+ bool result = resman->exist("CGE.SAY");
+ delete resman;
+
+ if (!result)
+ return 0;
+
+ reportUnknown(fslist.begin()->getParent(), filesProps);
+ return &s_fallbackDesc;
+}
+
bool CGEMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves) ||
@@ -251,9 +282,10 @@ bool CGEMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD
}
return desc != 0;
}
+} // End of namespace CGE
#if PLUGIN_ENABLED_DYNAMIC(CGE)
- REGISTER_PLUGIN_DYNAMIC(CGE, PLUGIN_TYPE_ENGINE, CGEMetaEngine);
+REGISTER_PLUGIN_DYNAMIC(CGE, PLUGIN_TYPE_ENGINE, CGE::CGEMetaEngine);
#else
- REGISTER_PLUGIN_STATIC(CGE, PLUGIN_TYPE_ENGINE, CGEMetaEngine);
+REGISTER_PLUGIN_STATIC(CGE, PLUGIN_TYPE_ENGINE, CGE::CGEMetaEngine);
#endif
Commit: 1769003a9b7158ab77afdf98c3c11f949e988ddf
https://github.com/scummvm/scummvm/commit/1769003a9b7158ab77afdf98c3c11f949e988ddf
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-09-17T23:10:03+02:00
Commit Message:
CGE2: Implement fallbackDetect
Changed paths:
engines/cge2/detection.cpp
diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
index fa02d41..d93a090 100644
--- a/engines/cge2/detection.cpp
+++ b/engines/cge2/detection.cpp
@@ -26,6 +26,7 @@
*/
#include "cge2/cge2.h"
+#include "cge2/fileio.h"
#include "engines/advancedDetector.h"
#include "common/translation.h"
#include "graphics/surface.h"
@@ -101,6 +102,7 @@ public:
return "Sfinx (c) 1994-1997 Janus B. Wisniewski and L.K. Avalon";
}
+ virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
virtual bool hasFeature(MetaEngineFeature f) const;
virtual int getMaximumSaveSlot() const;
@@ -109,6 +111,44 @@ public:
virtual void removeSaveState(const char *target, int slot) const;
};
+static const ADFileBasedFallback fileBasedFallback[] = {
+ { &gameDescriptions[0], { "vol.cat", "vol.dat", 0 } },
+ { 0, { 0 } }
+};
+
+static ADGameDescription s_fallbackDesc = {
+ "Sfinx",
+ "Unknown version",
+ AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
+ Common::UNK_LANG,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
+};
+
+const ADGameDescription *CGE2MetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
+ ADFilePropertiesMap filesProps;
+
+ const ADGameDescription *game;
+ game = detectGameFilebased(allFiles, fslist, CGE2::fileBasedFallback, &filesProps);
+
+ if (!game)
+ return 0;
+
+ SearchMan.clear();
+ SearchMan.addDirectory(fslist.begin()->getParent().getPath(), fslist.begin()->getParent());
+ ResourceManager *resman;
+ resman = new ResourceManager();
+ bool result = resman->exist("CGE.SAY");
+ delete resman;
+
+ if (!result)
+ return 0;
+
+ reportUnknown(fslist.begin()->getParent(), filesProps);
+ return &s_fallbackDesc;
+}
+
bool CGE2MetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
if (desc)
*engine = new CGE2::CGE2Engine(syst, desc);
Commit: 0b81ffedd429b3914cbb1dabcd0d53621c932aa4
https://github.com/scummvm/scummvm/commit/0b81ffedd429b3914cbb1dabcd0d53621c932aa4
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-09-17T23:10:25+02:00
Commit Message:
CGE2: Reduce the scope of a variable
Changed paths:
engines/cge2/cge2_main.cpp
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index 1057b00..3e3d615 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -722,10 +722,9 @@ void CGE2Engine::loadTab() {
if (_resman->exist(kTabName)) {
EncryptedStream f(this, kTabName);
- uint32 v;
for (int i = 0; i < kSceneMax; i++) {
- v = f.readUint32LE();
+ uint32 v = f.readUint32LE();
_eyeTab[i]->_x = FXP(v >> 8, static_cast<int>((int8)(v & 0xff)));
v = f.readUint32LE();
More information about the Scummvm-git-logs
mailing list