From 2cc500aad82c991877b0f0ba42cb70436ac13d30 Mon Sep 17 00:00:00 2001 From: Andrea Corna Date: Thu, 29 Aug 2013 23:05:49 +0200 Subject: [PATCH] EMI: Split GrimEngine::getUpdateFilename into EmiEngine --- engines/grim/emi/emi.cpp | 29 +++++++++++++++++++++++++++++ engines/grim/emi/emi.h | 2 ++ engines/grim/grim.cpp | 33 +++------------------------------ engines/grim/grim.h | 2 +- 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/engines/grim/emi/emi.cpp b/engines/grim/emi/emi.cpp index 90682ba70f0..6a423a799f0 100644 --- a/engines/grim/emi/emi.cpp +++ b/engines/grim/emi/emi.cpp @@ -48,6 +48,35 @@ LuaBase *EMIEngine::createLua() { return new Lua_V2(); } +const char *EMIEngine::getUpdateFilename() { + if (getGamePlatform() == Common::kPlatformWindows && !(getGameFlags() & ADGF_DEMO)) { + switch (getGameLanguage()) { + case Common::FR_FRA: + return "MonkeyUpdate_FRA.exe"; + break; + case Common::DE_DEU: + return "MonkeyUpdate_DEU.exe"; + break; + case Common::IT_ITA: + return "MonkeyUpdate_ITA.exe"; + break; + case Common::PT_BRA: + return "MonkeyUpdate_BRZ.exe"; + break; + case Common::ES_ESP: + return "MonkeyUpdate_ESP.exe"; + break; + case Common::EN_ANY: + case Common::EN_GRB: + case Common::EN_USA: + default: + return "MonkeyUpdate.exe"; + break; + } + } else + return 0; +} + void EMIEngine::pushText(Common::List *objects) { _textstack.push_back(objects); } diff --git a/engines/grim/emi/emi.h b/engines/grim/emi/emi.h index c5f38822b38..060f89f8bec 100644 --- a/engines/grim/emi/emi.h +++ b/engines/grim/emi/emi.h @@ -35,6 +35,8 @@ public: EMIEngine(OSystem *syst, uint32 gameFlags, GrimGameType gameType, Common::Platform platform, Common::Language language); virtual ~EMIEngine(); + virtual const char *getUpdateFilename(); + void pushText(Common::List *objects); Common::List *popText(); diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp index f8bc8f87195..eac7ea8902c 100644 --- a/engines/grim/grim.cpp +++ b/engines/grim/grim.cpp @@ -223,37 +223,10 @@ void GrimEngine::createRenderer() { } const char *GrimEngine::getUpdateFilename() { - if (getGamePlatform() != Common::kPlatformWindows || (getGameFlags() & ADGF_DEMO)) - return 0; - - if (getGameType() == GType_GRIM) + if (!(getGameFlags() & ADGF_DEMO)) return "gfupd101.exe"; - else if (getGameType() == GType_MONKEY4) { - switch (getGameLanguage()) { - case Common::FR_FRA: - return "MonkeyUpdate_FRA.exe"; - break; - case Common::DE_DEU: - return "MonkeyUpdate_DEU.exe"; - break; - case Common::IT_ITA: - return "MonkeyUpdate_ITA.exe"; - break; - case Common::PT_BRA: - return "MonkeyUpdate_BRZ.exe"; - break; - case Common::ES_ESP: - return "MonkeyUpdate_ESP.exe"; - break; - case Common::EN_ANY: - case Common::EN_GRB: - case Common::EN_USA: - default: - return "MonkeyUpdate.exe"; - break; - } - } - return 0; + else + return 0; } Common::Error GrimEngine::run() { diff --git a/engines/grim/grim.h b/engines/grim/grim.h index 7025326c8af..8d2895e50e5 100644 --- a/engines/grim/grim.h +++ b/engines/grim/grim.h @@ -91,7 +91,7 @@ public: GrimGameType getGameType() { return _gameType; } Common::Language getGameLanguage() { return _gameLanguage; } Common::Platform getGamePlatform() { return _gamePlatform; } - const char *getUpdateFilename(); + virtual const char *getUpdateFilename(); bool canLoadGameStateCurrently() { return true; } Common::Error loadGameState(int slot);