diff options
author | Borja Lorente | 2016-06-05 20:55:29 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-14 18:07:22 +0200 |
commit | d56f5a3bc43dd978244d17902e993704da8ace5e (patch) | |
tree | f7ce978e1f8c557a78a9fa11b831f14d422ca95c /engines | |
parent | c6070c0d99215d2e0207feeffd8fdb9013af6bed (diff) | |
download | scummvm-rg350-d56f5a3bc43dd978244d17902e993704da8ace5e.tar.gz scummvm-rg350-d56f5a3bc43dd978244d17902e993704da8ace5e.tar.bz2 scummvm-rg350-d56f5a3bc43dd978244d17902e993704da8ace5e.zip |
MACVENTURE: Add empty event loop
Diffstat (limited to 'engines')
-rw-r--r-- | engines/macventure/macventure.cpp | 40 | ||||
-rw-r--r-- | engines/macventure/macventure.h | 6 |
2 files changed, 36 insertions, 10 deletions
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp index a031513f3d..8cf6ba01cd 100644 --- a/engines/macventure/macventure.cpp +++ b/engines/macventure/macventure.cpp @@ -20,8 +20,7 @@ * */ -#include "common/scummsys.h" - +#include "common/system.h" #include "common/debug-channels.h" #include "common/debug.h" #include "common/error.h" @@ -52,24 +51,47 @@ MacVentureEngine::~MacVentureEngine() { Common::Error MacVentureEngine::run() { debug("MacVenture::MacVentureEngine::init()"); - initGraphics(kScreenWidth, kScreenHeight, true); - - //_screen.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8()); - - //_wm = new Graphics::MacWindowManager(); - //_wm->setScreen(&_screen); + initGraphics(kScreenWidth, kScreenHeight, true); - // Create debugger console. It requires GFX to be initialized _debugger = new Console(this); // Additional setup. debug("MacVentureEngine::init"); + _screen.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8()); + + _wm = new Graphics::MacWindowManager(); + _wm->setScreen(&_screen); + + // Your main even loop should be (invoked from) here. debug("MacVentureEngine::go: Hello, World!"); + _shouldQuit = false; + while (!_shouldQuit) { + processEvents(); + + debug("Ping"); + + g_system->updateScreen(); + g_system->delayMillis(50); + } return Common::kNoError; } +void MacVentureEngine::processEvents() { + Common::Event event; + + while (_eventMan->pollEvent(event)) { + switch (event.type) { + case Common::EVENT_QUIT: + _shouldQuit = true; + break; + default: + break; + } + } +} + } // End of namespace MacVenture diff --git a/engines/macventure/macventure.h b/engines/macventure/macventure.h index 39574943c7..ab29eedea7 100644 --- a/engines/macventure/macventure.h +++ b/engines/macventure/macventure.h @@ -60,14 +60,18 @@ public: virtual Common::Error run(); private: + void processEvents(); + +private: const ADGameDescription *_gameDescription; Common::RandomSource *_rnd; Console *_debugger; Graphics::MacWindowManager *_wm; - Graphics::ManagedSurface _screen; + + bool _shouldQuit; }; |