diff options
author | Paul Gilbert | 2016-07-23 17:21:38 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-23 17:21:38 -0400 |
commit | d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909 (patch) | |
tree | b4dea5cd29cfe4f19e96b4ac48750a6caf8e0daa /engines/titanic/game | |
parent | 00c568e17572ce2ac4e9c97c21c00a734951ae9a (diff) | |
download | scummvm-rg350-d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909.tar.gz scummvm-rg350-d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909.tar.bz2 scummvm-rg350-d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909.zip |
TITANIC: Fixes for movie notification, computer game logic cleanup
Diffstat (limited to 'engines/titanic/game')
-rw-r--r-- | engines/titanic/game/cdrom.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/cdrom_tray.cpp | 46 | ||||
-rw-r--r-- | engines/titanic/game/cdrom_tray.h | 2 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.cpp | 6 |
4 files changed, 32 insertions, 24 deletions
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp index 111b090920..cd913d05f7 100644 --- a/engines/titanic/game/cdrom.cpp +++ b/engines/titanic/game/cdrom.cpp @@ -62,7 +62,7 @@ bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) { if (msg->_dropTarget && msg->_dropTarget->getName() == "newComputer") { CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray")); - if (newTray->_state && newTray->_insertedCD == "None") { + if (newTray->_isOpened && newTray->_insertedCD == "None") { CActMsg actMsg(getName()); actMsg.execute(newTray); setVisible(false); diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp index 118150bee9..1e5b135d35 100644 --- a/engines/titanic/game/cdrom_tray.cpp +++ b/engines/titanic/game/cdrom_tray.cpp @@ -33,12 +33,12 @@ BEGIN_MESSAGE_MAP(CCDROMTray, CGameObject) END_MESSAGE_MAP() -CCDROMTray::CCDROMTray() : CGameObject(), _state(0) { +CCDROMTray::CCDROMTray() : CGameObject(), _isOpened(false) { } void CCDROMTray::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_state, indent); + file->writeNumberLine(_isOpened, indent); file->writeQuotedLine(_insertedCD, indent); CGameObject::save(file, indent); @@ -46,7 +46,7 @@ void CCDROMTray::save(SimpleFile *file, int indent) { void CCDROMTray::load(SimpleFile *file) { file->readNumber(); - _state = file->readNumber(); + _isOpened = file->readNumber(); _insertedCD = file->readString(); CGameObject::load(file); @@ -54,65 +54,73 @@ void CCDROMTray::load(SimpleFile *file) { bool CCDROMTray::ActMsg(CActMsg *msg) { if (msg->_action == "ClickedOn") { - if (_state) { + if (_isOpened) { + // Closing the tray if (_insertedCD == "None") { + // No CD in tray playMovie(55, 65, 0); playSound("a#35.wav", 50, 0, 0); - _state = 0; + _isOpened = false; } else { - CTreeItem *treeItem = getRoom()->findByName(_insertedCD); - if (treeItem) { + // Ejecting tray with CD + CTreeItem *cdrom = getRoom()->findByName(_insertedCD); + if (cdrom) { CActMsg actMsg("Ejected"); - actMsg.execute(treeItem); + actMsg.execute(cdrom); } _insertedCD = "None"; loadFrame(52); } } else if (_insertedCD == "None") { + // Opening tray with no CD playMovie(44, 54, 0); playSound("a#34.wav", 50, 0, 0); - _state = 1; + _isOpened = true; } else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") { + // Opening tray with standard CD playMovie(22, 32, 0); playSound("a#34.wav", 50, 0, 0); - _state = 1; + _isOpened = true; } else if (_insertedCD == "newSTCD") { + // Opening tray with Starship Titanic CD playMovie(0, 10, 0); playSound("a#34.wav", 50, 0, 0); - _state = 1; + _isOpened = true; } - } else if (_state) { + } else if (_isOpened) { if (msg->_action == "newCD1" || msg->_action == "newCD2") { - playMovie(33, 43, 4); + // Standard CD dropped on CDROM Tray + playMovie(33, 43, MOVIE_NOTIFY_OBJECT); playSound("a#35.wav", 50, 0, 0); } else if (msg->_action == "newSTCD") { - playMovie(11, 21, 4); + // Starship Titanic CD dropped on CDROM Tray + playMovie(11, 21, MOVIE_NOTIFY_OBJECT); playSound("a#35.wav", 50, 0, 0); } else { return true; } _insertedCD = msg->_action; - _state = 0; + _isOpened = false; } return true; } bool CCDROMTray::MovieEndMsg(CMovieEndMsg *msg) { - CTreeItem *treeItem = getRoom()->findByName("newScreen"); + CTreeItem *screen = getRoom()->findByName("newScreen"); - if (treeItem) { + if (screen) { CActMsg actMsg(_insertedCD); - actMsg.execute(treeItem); + actMsg.execute(screen); } return true; } bool CCDROMTray::StatusChangeMsg(CStatusChangeMsg *msg) { - msg->_success = _state; + msg->_success = _isOpened; return true; } diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h index dbeec170d7..c91e0450fe 100644 --- a/engines/titanic/game/cdrom_tray.h +++ b/engines/titanic/game/cdrom_tray.h @@ -34,7 +34,7 @@ class CCDROMTray : public CGameObject { bool MovieEndMsg(CMovieEndMsg *msg); bool StatusChangeMsg(CStatusChangeMsg *msg); public: - int _state; + bool _isOpened; CString _insertedCD; public: CLASSDEF diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp index c73db4f879..b73beda8a7 100644 --- a/engines/titanic/game/computer_screen.cpp +++ b/engines/titanic/game/computer_screen.cpp @@ -47,10 +47,10 @@ void CComputerScreen::load(SimpleFile *file) { bool CComputerScreen::ActMsg(CActMsg *msg) { if (msg->_action == "newCD1" || msg->_action == "newCD2") { - playMovie(27, 53, 16); - playMovie(19, 26, 16); + playMovie(27, 53, MOVIE_GAMESTATE); + playMovie(19, 26, MOVIE_GAMESTATE); } else if (msg->_action == "newSTCD") { - playMovie(0, 18, 20); + playMovie(0, 18, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT); } return true; |