diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/neverhood/gamemodule.cpp | 6 | ||||
-rw-r--r-- | engines/neverhood/menumodule.cpp | 28 | ||||
-rw-r--r-- | engines/neverhood/menumodule.h | 2 | ||||
-rw-r--r-- | engines/neverhood/mouse.cpp | 9 | ||||
-rw-r--r-- | engines/neverhood/mouse.h | 1 | ||||
-rw-r--r-- | engines/neverhood/scene.cpp | 2 | ||||
-rw-r--r-- | engines/neverhood/screen.cpp | 7 | ||||
-rw-r--r-- | engines/neverhood/screen.h | 1 | ||||
-rw-r--r-- | engines/neverhood/smackerscene.cpp | 3 |
9 files changed, 43 insertions, 16 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index d87096df2d..a574fa52f9 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -109,7 +109,7 @@ void GameModule::handleMouseDown(int16 x, int16 y) { mousePos.x = x; mousePos.y = y; debug(2, "GameModule::handleMouseDown(%d, %d)", x, y); - sendPointMessage(_childObject, 1, mousePos); + sendPointMessage(_childObject, 0x0001, mousePos); } } @@ -119,7 +119,7 @@ void GameModule::handleMouseUp(int16 x, int16 y) { mousePos.x = x; mousePos.y = y; debug(2, "GameModule::handleMouseUp(%d, %d)", x, y); - sendPointMessage(_childObject, 2, mousePos); + sendPointMessage(_childObject, 0x0002, mousePos); } } @@ -133,7 +133,7 @@ void GameModule::handleEscapeKey() { void GameModule::handleSpaceKey() { if (_childObject) { debug(2, "GameModule::handleSpaceKey()"); - sendMessage(_childObject, 9, 0); + sendMessage(_childObject, 0x0009, 0); } } diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index 4ba6d324d0..97489194ac 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -26,7 +26,25 @@ namespace Neverhood { enum { MAIN_MENU = 0, - CREDITS_SCENE = 1 + CREDITS_SCENE = 1, + MAKING_OF = 2 +}; + +static const uint32 kMakingOfSmackerFileHashList[] = { + 0x21082409, + 0x21082809, + 0x21083009, + 0x21080009, + 0x21086009, + 0x2108A009, + 0x21092009, + 0x210A2009, + 0x210C2009, + 0x21082411, + 0x21082811, + 0x21083011, + 0x21080011, + 0 }; MenuModule::MenuModule(NeverhoodEngine *vm, Module *parentModule, int which) @@ -58,6 +76,9 @@ void MenuModule::createScene(int sceneNum, int which) { case CREDITS_SCENE: _childObject = new CreditsScene(_vm, this, true); break; + case MAKING_OF: + createSmackerScene(kMakingOfSmackerFileHashList, false, true, true); + break; } SetUpdateHandler(&MenuModule::updateScene); _childObject->handleUpdate(); @@ -88,7 +109,7 @@ void MenuModule::updateScene() { case 4: debug("QUIT GAME"); leaveModule(0); - // TODO _gameState->quitGame = true; + _vm->quitGame(); break; case 5: debug("CREDITS"); @@ -96,7 +117,7 @@ void MenuModule::updateScene() { break; case 6: debug("MAKING OF"); - // TODO playMakingOf(); + createScene(MAKING_OF, -1); break; case 7: debug("TOGGLE MUSIC"); @@ -113,6 +134,7 @@ void MenuModule::updateScene() { } break; case CREDITS_SCENE: + case MAKING_OF: createScene(MAIN_MENU, -1); break; default: diff --git a/engines/neverhood/menumodule.h b/engines/neverhood/menumodule.h index 4805f67245..77cef449d1 100644 --- a/engines/neverhood/menumodule.h +++ b/engines/neverhood/menumodule.h @@ -20,8 +20,6 @@ * */ -// TODO: I couldn't come up with a better name than 'Module' so far - #ifndef NEVERHOOD_MENUMODULE_H #define NEVERHOOD_MENUMODULE_H diff --git a/engines/neverhood/mouse.cpp b/engines/neverhood/mouse.cpp index 8cd5e602fb..105d170fce 100644 --- a/engines/neverhood/mouse.cpp +++ b/engines/neverhood/mouse.cpp @@ -42,7 +42,7 @@ Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, const NRect &mouseRect) Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, int16 x1, int16 x2) : StaticSprite(vm, 2000), _mouseType(kMouseType435), - _mouseCursorResource(vm), _frameNum(0), _x1(x1), _x2(x2), _visible(false) { + _mouseCursorResource(vm), _frameNum(0), _x1(x1), _x2(x2) { init(fileHash); if (_x <= _x1) { @@ -81,6 +81,7 @@ void Mouse::init(uint32 fileHash) { _deltaRect = _drawRect; processDelta(); _needRefresh = true; + CursorMan.showMouse(false); } void Mouse::load(uint32 fileHash) { @@ -89,12 +90,10 @@ void Mouse::load(uint32 fileHash) { } void Mouse::update() { - if (_visible && !_surface->getVisible()) { + if (CursorMan.isVisible() && !_surface->getVisible()) { CursorMan.showMouse(false); - _visible = false; - } else if (!_visible && _surface->getVisible()) { + } else if (!CursorMan.isVisible() && _surface->getVisible()) { CursorMan.showMouse(true); - _visible = true; } updateCursor(); _frameNum++; diff --git a/engines/neverhood/mouse.h b/engines/neverhood/mouse.h index 2b0e8b720e..0b927de4df 100644 --- a/engines/neverhood/mouse.h +++ b/engines/neverhood/mouse.h @@ -52,7 +52,6 @@ protected: int16 _x1; int16 _x2; int _type; - bool _visible; void init(uint32 fileHash); void update(); void updateCursorNum(); diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp index ac08c1483f..9e49c6b137 100644 --- a/engines/neverhood/scene.cpp +++ b/engines/neverhood/scene.cpp @@ -55,6 +55,8 @@ Scene::Scene(NeverhoodEngine *vm, Module *parentModule, bool clearHitRects) SetUpdateHandler(&Scene::update); SetMessageHandler(&Scene::handleMessage); + + _vm->_screen->clearRenderQueue(); } Scene::~Scene() { diff --git a/engines/neverhood/screen.cpp b/engines/neverhood/screen.cpp index a2437ba010..7321ddb233 100644 --- a/engines/neverhood/screen.cpp +++ b/engines/neverhood/screen.cpp @@ -153,6 +153,13 @@ void Screen::updatePalette() { void Screen::clear() { memset(_backScreen->pixels, 0, _backScreen->pitch * _backScreen->h); + _fullRefresh = true; + clearRenderQueue(); +} + +void Screen::clearRenderQueue() { + _renderQueue->clear(); + _prevRenderQueue->clear(); } void Screen::drawSurface2(const Graphics::Surface *surface, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version, diff --git a/engines/neverhood/screen.h b/engines/neverhood/screen.h index 69329fd59a..4e7618b7b2 100644 --- a/engines/neverhood/screen.h +++ b/engines/neverhood/screen.h @@ -70,6 +70,7 @@ public: void testPalette(byte *paletteData); void updatePalette(); void clear(); + void clearRenderQueue(); void drawSurface2(const Graphics::Surface *surface, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version, const Graphics::Surface *shadowSurface = NULL); void drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version); diff --git a/engines/neverhood/smackerscene.cpp b/engines/neverhood/smackerscene.cpp index d4f65b3652..0ed689031a 100644 --- a/engines/neverhood/smackerscene.cpp +++ b/engines/neverhood/smackerscene.cpp @@ -37,9 +37,8 @@ SmackerScene::SmackerScene(NeverhoodEngine *vm, Module *parentModule, bool doubl _canAbort = true; } - if (_doubleSurface) { + if (!_doubleSurface) _vm->_screen->clear(); - } _fileHash[0] = 0; _fileHash[1] = 0; |