From 40136f25909bd8773cac0f08740a36037395e9a7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 6 Nov 2008 17:05:54 +0000 Subject: Switched various Engine APIs to use Common::Error svn-id: r34916 --- engines/m4/m4.cpp | 16 ++++++++-------- engines/m4/m4.h | 10 ++++++---- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'engines/m4') diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 67201c2aff..45185b3b86 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -141,7 +141,7 @@ M4Engine::~M4Engine() { delete _resourceManager; } -int M4Engine::init() { +Common::Error M4Engine::init() { // Initialize backend _system->beginGFXTransaction(); initCommonGFX(isM4()); @@ -197,7 +197,7 @@ int M4Engine::init() { _random = new Common::RandomSource(); g_system->getEventManager()->registerRandomSource(*_random, "m4"); - return 0; + return Common::kNoError; } void M4Engine::eventHandler() { @@ -272,14 +272,14 @@ void M4Engine::loadMenu(MenuType menuType, bool loadSaveFromHotkey, bool calledF _viewManager->moveToFront(view); } -int M4Engine::go() { +Common::Error M4Engine::go() { if (isM4()) return goM4(); else return goMADS(); } -int M4Engine::goMADS() { +Common::Error M4Engine::goMADS() { _palette->setMadsSystemPalette(); _mouse->init("cursor.ss", NULL); @@ -351,10 +351,10 @@ int M4Engine::goMADS() { g_system->delayMillis(10); } - return 0; + return Common::kNoError; } -int M4Engine::goM4() { +Common::Error M4Engine::goM4() { _script->open("m4.dat"); @@ -375,7 +375,7 @@ int M4Engine::goM4() { } #endif - return 0; + return Common::kNoError; #endif // Set up the inventory @@ -520,7 +520,7 @@ int M4Engine::goM4() { g_system->delayMillis(10); } - return 0; + return Common::kNoError; } void M4Engine::dumpFile(const char* filename, bool uncompress) { diff --git a/engines/m4/m4.h b/engines/m4/m4.h index e989bcc4e6..ac3262e7b8 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -107,12 +107,14 @@ FORCEINLINE long FixedDiv(long a, long b) { return (long)(((float)a / (float)b) class M4Engine : public Engine { private: - int goMADS(); - int goM4(); + Common::Error goMADS(); + Common::Error goM4(); protected: - int init(); - int go(); + // Engine APIs + virtual Common::Error init(); + virtual Common::Error go(); + void shutdown(); MidiPlayer *_midi; -- cgit v1.2.3