diff options
author | Paul Gilbert | 2016-10-30 08:10:36 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-10-30 08:10:36 -0400 |
commit | 96153644e6b72b7d956d8a45114172a035ce24cc (patch) | |
tree | 90ab7e74078691c4d5d96ebfb8b36cda5b01f53e /engines/titanic/game/service_elevator_window.cpp | |
parent | 6ffa5228c1691e5794600343b083bc922062be5f (diff) | |
download | scummvm-rg350-96153644e6b72b7d956d8a45114172a035ce24cc.tar.gz scummvm-rg350-96153644e6b72b7d956d8a45114172a035ce24cc.tar.bz2 scummvm-rg350-96153644e6b72b7d956d8a45114172a035ce24cc.zip |
TITANIC: Cleanup of CServiceElevatorWIndow class
Diffstat (limited to 'engines/titanic/game/service_elevator_window.cpp')
-rw-r--r-- | engines/titanic/game/service_elevator_window.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp index 84f2a8dfdf..d548bbf37e 100644 --- a/engines/titanic/game/service_elevator_window.cpp +++ b/engines/titanic/game/service_elevator_window.cpp @@ -35,25 +35,25 @@ END_MESSAGE_MAP() static const int FACTORS[4] = { 0, 20, 100, 0 }; CServiceElevatorWindow::CServiceElevatorWindow() : CBackground(), - _fieldE0(0), _notifyFlag(false), _fieldE8(0), _fieldEC(0) { + _destFloor(0), _notifyFlag(false), _isIndicator(false), _intoSpace(false) { } void CServiceElevatorWindow::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldE0, indent); + file->writeNumberLine(_destFloor, indent); file->writeNumberLine(_notifyFlag, indent); - file->writeNumberLine(_fieldE8, indent); - file->writeNumberLine(_fieldEC, indent); + file->writeNumberLine(_isIndicator, indent); + file->writeNumberLine(_intoSpace, indent); CBackground::save(file, indent); } void CServiceElevatorWindow::load(SimpleFile *file) { file->readNumber(); - _fieldE0 = file->readNumber(); + _destFloor = file->readNumber(); _notifyFlag = file->readNumber(); - _fieldE8 = file->readNumber(); - _fieldEC = file->readNumber(); + _isIndicator = file->readNumber(); + _intoSpace = file->readNumber(); CBackground::load(file); } @@ -61,7 +61,7 @@ void CServiceElevatorWindow::load(SimpleFile *file) { bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloorChangeMsg *msg) { if (getView() == findView()) { CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot")); - int fps = (_fieldE8 && doorbot) ? 65 : 15; + int fps = (_isIndicator && doorbot) ? 65 : 15; CMovieClip *clip = _movieClips.findByName("Going Up"); if (!clip) @@ -70,30 +70,33 @@ bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloor int count = clip->_endFrame - clip->_startFrame; setMovieFrameRate(1.0 * count / fps); - int startFrame = clip->_startFrame + count * FACTORS[msg->_value1] / 100; - int endFrame = clip->_startFrame + count * FACTORS[msg->_value2] / 100; + int startFrame = clip->_startFrame + count * FACTORS[msg->_startFloor] / 100; + int endFrame = clip->_startFrame + count * FACTORS[msg->_endFloor] / 100; if (_notifyFlag) { + // Service elevator indicator playMovie(startFrame, endFrame, MOVIE_NOTIFY_OBJECT); } else { + // Background outside elevator playMovie(startFrame, endFrame, 0); - if (_fieldEC) + if (_intoSpace) playClip("Into Space"); } } - _fieldE0 = msg->_value2; + _destFloor = msg->_endFloor; return true; } bool CServiceElevatorWindow::MovieEndMsg(CMovieEndMsg *msg) { + // Called when indicator reaches desired destination floor CServiceElevatorMsg elevMsg(5); elevMsg.execute(findRoom()->findByName("Service Elevator Entity")); return true; } bool CServiceElevatorWindow::EnterViewMsg(CEnterViewMsg *msg) { - if (_fieldEC) { + if (_intoSpace) { playClip("Fade Up"); playMovie(1, 2, 0); } else { @@ -101,7 +104,7 @@ bool CServiceElevatorWindow::EnterViewMsg(CEnterViewMsg *msg) { if (clip) { int frameNum = clip->_startFrame + (clip->_endFrame - clip->_startFrame) - * FACTORS[_fieldE0] / 100; + * FACTORS[_destFloor] / 100; loadFrame(frameNum); } else { loadFrame(0); |