diff options
author | Paul Gilbert | 2016-08-12 23:53:18 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-12 23:53:18 -0400 |
commit | 6a9923ec07d019cbbf8c35e36030391dac256e79 (patch) | |
tree | 0779d0d2489a9f6fda7f9c3e17484213d53d752e /engines/titanic/game/auto_animate.cpp | |
parent | 4f8c31ecf7c8ac71e1be65771ce508fb11c62749 (diff) | |
download | scummvm-rg350-6a9923ec07d019cbbf8c35e36030391dac256e79.tar.gz scummvm-rg350-6a9923ec07d019cbbf8c35e36030391dac256e79.tar.bz2 scummvm-rg350-6a9923ec07d019cbbf8c35e36030391dac256e79.zip |
TITANIC: Implemented some game object classes
Diffstat (limited to 'engines/titanic/game/auto_animate.cpp')
-rw-r--r-- | engines/titanic/game/auto_animate.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp index 172b8c44df..16e6e56747 100644 --- a/engines/titanic/game/auto_animate.cpp +++ b/engines/titanic/game/auto_animate.cpp @@ -24,24 +24,44 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CAutoAnimate, CBackground) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(InitializeAnimMsg) +END_MESSAGE_MAP() + void CAutoAnimate::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldE0, indent); + file->writeNumberLine(_enabled, indent); file->writeNumberLine(_fieldE4, indent); - file->writeNumberLine(_fieldE8, indent); + file->writeNumberLine(_repeat, indent); CBackground::save(file, indent); } void CAutoAnimate::load(SimpleFile *file) { file->readNumber(); - _fieldE0 = file->readNumber(); + _enabled = file->readNumber(); _fieldE4 = file->readNumber(); - _fieldE8 = file->readNumber(); + _repeat = file->readNumber(); CBackground::load(file); } bool CAutoAnimate::EnterViewMsg(CEnterViewMsg *msg) { - warning("CAutoAnimate::handleEvent"); + if (_enabled) { + uint flags = _repeat ? MOVIE_REPEAT : 0; + if (_startFrame != _endFrame) + playMovie(_startFrame, _endFrame, flags); + else + playMovie(flags); + + if (!_fieldE4) + _enabled = false; + } + + return true; +} + +bool CAutoAnimate::InitializeAnimMsg(CInitializeAnimMsg *msg) { + _enabled = true; return true; } |