mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-21 09:21:08 +00:00
TWINE: added game variant detection by gameId
This commit is contained in:
parent
94e18f53ff
commit
f8210aac82
@ -26,8 +26,8 @@
|
||||
namespace TwinE {
|
||||
|
||||
enum TwineGameType {
|
||||
GType_LBA = (1 << 1),
|
||||
GType_LBA2 = (1 << 2)
|
||||
GType_LBA = 1,
|
||||
GType_LBA2 = 2
|
||||
};
|
||||
|
||||
} // End of namespace TwinE
|
||||
|
@ -47,7 +47,14 @@ public:
|
||||
|
||||
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override {
|
||||
if (desc) {
|
||||
*engine = new TwinE::TwinEEngine(syst, desc->language, desc->flags);
|
||||
TwineGameType gameType = TwineGameType::GType_LBA;
|
||||
const Common::String gameId = desc->gameId;
|
||||
if (gameId == "lba") {
|
||||
gameType = TwineGameType::GType_LBA;
|
||||
} else if (gameId == "lba2") {
|
||||
gameType = TwineGameType::GType_LBA2;
|
||||
}
|
||||
*engine = new TwinE::TwinEEngine(syst, desc->language, desc->flags, gameType);
|
||||
}
|
||||
return desc != nullptr;
|
||||
}
|
||||
|
@ -66,8 +66,8 @@
|
||||
|
||||
namespace TwinE {
|
||||
|
||||
TwinEEngine::TwinEEngine(OSystem *system, Common::Language language, uint32 flags)
|
||||
: Engine(system), _gameLang(language), _gameFlags(flags), _rnd("twine") {
|
||||
TwinEEngine::TwinEEngine(OSystem *system, Common::Language language, uint32 flags, TwineGameType gameType)
|
||||
: Engine(system), _gameType(gameType), _gameLang(language), _gameFlags(flags), _rnd("twine") {
|
||||
// Add default file directories
|
||||
const Common::FSNode gameDataDir(ConfMan.get("path"));
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "fla");
|
||||
|
@ -158,16 +158,17 @@ private:
|
||||
int32 saveFreezedTime = 0;
|
||||
ActorMoveStruct loopMovePtr; // mainLoopVar1
|
||||
PauseToken _pauseToken;
|
||||
TwineGameType _gameType;
|
||||
|
||||
public:
|
||||
TwinEEngine(OSystem *system, Common::Language language, uint32 flags);
|
||||
TwinEEngine(OSystem *system, Common::Language language, uint32 flagsTwineGameType, TwineGameType gameType);
|
||||
~TwinEEngine() override;
|
||||
|
||||
Common::Error run() override;
|
||||
bool hasFeature(EngineFeature f) const override;
|
||||
|
||||
bool isLBA1() const { return _gameFlags & TwineGameType::GType_LBA;};
|
||||
bool isLBA2() const { return _gameFlags & TwineGameType::GType_LBA2;};
|
||||
bool isLBA1() const { return _gameType == TwineGameType::GType_LBA; };
|
||||
bool isLBA2() const { return _gameType == TwineGameType::GType_LBA2; };
|
||||
|
||||
Actor *_actor;
|
||||
Animations *_animations;
|
||||
|
Loading…
Reference in New Issue
Block a user