From 3fcbda829a2aa17cbaf6423d34f69214b91b0e6c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 1 Mar 2009 04:30:55 +0000 Subject: Merged Engine::go() and ::init() into a new run() method (currently implemented by calling the existing init&go methods; to be cleaned up by engine authors svn-id: r39002 --- engines/scumm/he/intern_he.h | 3 +-- engines/scumm/scumm.cpp | 6 +----- engines/scumm/scumm.h | 11 +++++++++-- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index a04cbc24a8..7abd6f924b 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -669,8 +669,7 @@ public: ScummEngine_vCUPhe(OSystem *syst, const DetectorResult &dr); ~ScummEngine_vCUPhe(); - Common::Error init(); - Common::Error go(); + virtual Common::Error run(); void parseEvents(); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index fd6d354d63..15fee4115c 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -824,13 +824,9 @@ ScummEngine_vCUPhe::~ScummEngine_vCUPhe() { delete _cupPlayer; } -Common::Error ScummEngine_vCUPhe::init() { +Common::Error ScummEngine_vCUPhe::run() { initGraphics(CUP_Player::kDefaultVideoWidth, CUP_Player::kDefaultVideoHeight, true); - return Common::kNoError; -} - -Common::Error ScummEngine_vCUPhe::go() { if (_cupPlayer->open(_filenamePattern.pattern)) { _cupPlayer->play(); _cupPlayer->close(); diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index f99f37d857..e08453eed8 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -447,8 +447,15 @@ public: virtual ~ScummEngine(); // Engine APIs - virtual Common::Error init(); - virtual Common::Error go(); + Common::Error init(); + Common::Error go(); + virtual Common::Error run() { + Common::Error err; + err = init(); + if (err != Common::kNoError) + return err; + return go(); + } virtual void errorString(const char *buf_input, char *buf_output, int buf_output_size); virtual GUI::Debugger *getDebugger(); virtual bool hasFeature(EngineFeature f) const; -- cgit v1.2.3