scummvm/engines/ngi/metaengine.cpp

92 lines
2.5 KiB
C++
Raw Normal View History

/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#include "base/plugins.h"
#include "engines/advancedDetector.h"
#include "common/file.h"
#include "graphics/surface.h"
2020-10-03 23:50:25 +02:00
#include "ngi/ngi.h"
2020-10-04 00:29:04 +02:00
#include "ngi/detection.h"
2020-10-03 23:47:47 +02:00
#include "ngi/gameloader.h"
2020-10-03 23:55:39 +02:00
namespace NGI {
2020-10-04 00:00:50 +02:00
uint32 NGIEngine::getFeatures() const {
2020-10-04 00:29:04 +02:00
return _gameDescription->desc.flags;
}
2020-10-04 00:00:50 +02:00
bool NGIEngine::isDemo() {
2020-10-04 00:29:04 +02:00
return _gameDescription->desc.flags & ADGF_DEMO;
}
2020-10-04 00:00:50 +02:00
Common::Language NGIEngine::getLanguage() const {
2020-10-04 00:29:04 +02:00
return _gameDescription->desc.language;
}
2020-10-04 00:00:50 +02:00
const char *NGIEngine::getGameId() const {
2020-10-04 00:29:04 +02:00
return _gameDescription->desc.gameId;
2020-10-03 23:47:47 +02:00
}
int NGIEngine::getGameGID() const {
return _gameDescription->gameId;
}
} // End of namspace Fullpipe
2020-10-04 00:00:50 +02:00
class NGIMetaEngine : public AdvancedMetaEngine {
public:
const char *getName() const override {
2020-10-03 23:47:47 +02:00
return "ngi";
}
bool hasFeature(MetaEngineFeature f) const override;
int getMaximumSaveSlot() const override { return 99; }
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
};
2020-10-04 00:00:50 +02:00
bool NGIMetaEngine::hasFeature(MetaEngineFeature f) const {
return checkExtendedSaves(f) || (f == kSupportsLoadingDuringStartup);
}
2020-10-04 00:00:50 +02:00
bool NGI::NGIEngine::hasFeature(EngineFeature f) const {
return
(f == kSupportsReturnToLauncher) ||
(f == kSupportsLoadingDuringRuntime) ||
(f == kSupportsSavingDuringRuntime);
}
Common::Error NGIMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
*engine = new NGI::NGIEngine(syst, (const NGI::NGIGameDescription *)desc);
return Common::kNoError;
}
2020-10-03 23:47:47 +02:00
#if PLUGIN_ENABLED_DYNAMIC(NGI)
2020-10-04 00:00:50 +02:00
REGISTER_PLUGIN_DYNAMIC(NGI, PLUGIN_TYPE_ENGINE, NGIMetaEngine);
#else
2020-10-04 00:00:50 +02:00
REGISTER_PLUGIN_STATIC(NGI, PLUGIN_TYPE_ENGINE, NGIMetaEngine);
#endif