NEVERHOOD: Simplified detection tables

This commit is contained in:
Eugene Sandulenko 2020-08-24 23:24:10 +02:00
parent 4d0530117e
commit 1aa0367b8a
3 changed files with 81 additions and 107 deletions

View file

@ -28,33 +28,30 @@
#include "neverhood/neverhood.h"
enum NeverhoodGameFeatures {
GF_BIG_DEMO = (1 << 0)
};
namespace Neverhood {
struct NeverhoodGameDescription {
ADGameDescription desc;
uint32 features;
};
const char *NeverhoodEngine::getGameId() const {
return _gameDescription->desc.gameId;
return _gameDescription->gameId;
}
Common::Platform NeverhoodEngine::getPlatform() const {
return _gameDescription->desc.platform;
return _gameDescription->platform;
}
Common::Language NeverhoodEngine::getLanguage() const {
return _gameDescription->desc.language;
return _gameDescription->language;
}
bool NeverhoodEngine::isDemo() const {
return _gameDescription->desc.flags & ADGF_DEMO;
return _gameDescription->flags & ADGF_DEMO;
}
bool NeverhoodEngine::isBigDemo() const {
return _gameDescription->features & GF_BIG_DEMO;
return _gameDescription->flags & GF_BIG_DEMO;
}
bool NeverhoodEngine::applyResourceFixes() const {
@ -70,93 +67,75 @@ static const PlainGameDescriptor neverhoodGames[] = {
namespace Neverhood {
static const NeverhoodGameDescription gameDescriptions[] = {
static const ADGameDescription gameDescriptions[] = {
// Neverhood English version
{
// Neverhood English version
{
"neverhood",
0,
AD_ENTRY1s("hd.blb", "22958d968458c9ff221aee38577bb2b2", 4279716),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
0
},
{
// Neverhood English big demo version
{
"neverhood",
"Big Demo",
AD_ENTRY1s("nevdemo.blb", "e637221d296f9a25ff22eaed96b07519", 117274189),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DEMO | ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
GF_BIG_DEMO
},
{
// Neverhood English demo version
{
"neverhood",
"Demo",
AD_ENTRY1s("nevdemo.blb", "05b735cfb1086892bec79b54dca5545b", 22564568),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DEMO | ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
0
},
{
// Neverhood earlier English demo version
{
"neverhood",
"Demo",
AD_ENTRY1s("nevdemo.blb", "9cbc33bc8ebacacfc8071f3e26a9c85f", 22357020),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DEMO | ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
0
},
{
// Neverhood Russian version. Dyadyushka Risech
{
"neverhood",
"DR",
AD_ENTRY1s("hd.blb", "787951bf094aad9962291e69a707bdde", 4248635),
Common::RU_RUS,
Common::kPlatformWindows,
ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
0
},
{
// Neverhood Russian version. Fargus
{
"neverhood",
"Fargus",
AD_ENTRY1s("hd.blb", "c87c69db423f560d3708e9de78751a7f", 4425816),
Common::RU_RUS,
Common::kPlatformWindows,
ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
"neverhood",
0,
AD_ENTRY1s("hd.blb", "22958d968458c9ff221aee38577bb2b2", 4279716),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
{ AD_TABLE_END_MARKER, 0 }
// Neverhood English big demo version
{
"neverhood",
"Big Demo",
AD_ENTRY1s("nevdemo.blb", "e637221d296f9a25ff22eaed96b07519", 117274189),
Common::EN_ANY,
Common::kPlatformWindows,
GF_BIG_DEMO | ADGF_DEMO | ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
// Neverhood English demo version
{
"neverhood",
"Demo",
AD_ENTRY1s("nevdemo.blb", "05b735cfb1086892bec79b54dca5545b", 22564568),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DEMO | ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
// Neverhood earlier English demo version
{
"neverhood",
"Demo",
AD_ENTRY1s("nevdemo.blb", "9cbc33bc8ebacacfc8071f3e26a9c85f", 22357020),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_DEMO | ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
// Neverhood Russian version. Dyadyushka Risech
{
"neverhood",
"DR",
AD_ENTRY1s("hd.blb", "787951bf094aad9962291e69a707bdde", 4248635),
Common::RU_RUS,
Common::kPlatformWindows,
ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
// Neverhood Russian version. Fargus
{
"neverhood",
"Fargus",
AD_ENTRY1s("hd.blb", "c87c69db423f560d3708e9de78751a7f", 4425816),
Common::RU_RUS,
Common::kPlatformWindows,
ADGF_DROPPLATFORM,
GUIO1(GUIO_NONE)
},
AD_TABLE_END_MARKER
};
} // End of namespace Neverhood
@ -185,7 +164,7 @@ static const ExtraGuiOption neverhoodExtraGuiOption3 = {
class NeverhoodMetaEngine : public AdvancedMetaEngine {
public:
NeverhoodMetaEngine() : AdvancedMetaEngine(Neverhood::gameDescriptions, sizeof(Neverhood::NeverhoodGameDescription), neverhoodGames) {
NeverhoodMetaEngine() : AdvancedMetaEngine(Neverhood::gameDescriptions, sizeof(ADGameDescription), neverhoodGames) {
_guiOptions = GUIO2(GUIO_NOSUBTITLES, GUIO_NOMIDI);
}
@ -231,11 +210,10 @@ bool Neverhood::NeverhoodEngine::hasFeature(EngineFeature f) const {
}
bool NeverhoodMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const Neverhood::NeverhoodGameDescription *gd = (const Neverhood::NeverhoodGameDescription *)desc;
if (gd) {
*engine = new Neverhood::NeverhoodEngine(syst, gd);
if (desc) {
*engine = new Neverhood::NeverhoodEngine(syst, desc);
}
return gd != 0;
return desc != 0;
}
const ExtraGuiOptions NeverhoodMetaEngine::getExtraGuiOptions(const Common::String &target) const {

View file

@ -47,7 +47,7 @@
namespace Neverhood {
NeverhoodEngine::NeverhoodEngine(OSystem *syst, const NeverhoodGameDescription *gameDesc) :
NeverhoodEngine::NeverhoodEngine(OSystem *syst, const ADGameDescription *gameDesc) :
Engine(syst), _gameDescription(gameDesc) {
// Setup mixer
if (!_mixer->isReady()) {

View file

@ -35,14 +35,10 @@
#include "neverhood/console.h"
#include "neverhood/messages.h"
struct ADGameDescription;
namespace Neverhood {
enum NeverhoodGameFeatures {
GF_BIG_DEMO = (1 << 0)
};
struct NeverhoodGameDescription;
class GameModule;
class GameVars;
class ResourceMan;
@ -64,11 +60,11 @@ protected:
void mainLoop();
public:
NeverhoodEngine(OSystem *syst, const NeverhoodGameDescription *gameDesc);
NeverhoodEngine(OSystem *syst, const ADGameDescription *gameDesc);
~NeverhoodEngine() override;
// Detection related functions
const NeverhoodGameDescription *_gameDescription;
const ADGameDescription *_gameDescription;
const char *getGameId() const;
Common::Platform getPlatform() const;
Common::Language getLanguage() const;