diff options
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; }; |