From b4ebed792eeaf0fb58c5105639e2dd11bb696336 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 16 Sep 2014 22:10:37 -0400 Subject: MADS: Further resource entry initialization --- engines/mads/nebular/menu_nebular.cpp | 11 ++++++++--- engines/mads/nebular/menu_nebular.h | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 979c14f3e1..d303dd7aad 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -796,13 +796,15 @@ AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) { _soundDriverLoaded = false; _previousUpdate = 0; _screenId = -1; - _showWhiteBars = true; _resetPalette = false; _resyncMode = NEVER; _v1 = 0; _v2 = -1; _resourceIndex = -1; _currentAnimation = nullptr; + _sfx = 0; + _soundFlag = _bgLoadFlag = true; + _showWhiteBars = true; load(); } @@ -921,8 +923,8 @@ void AnimationView::processLines() { resName += c; } - _resources.push_back(ResourceEntry(resName, _sfx, false, false)); - _sfx = 0; + _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag, + _bgLoadFlag, _showWhiteBars)); } // Skip any spaces @@ -939,6 +941,9 @@ void AnimationView::processCommand() { // Handle the command switch (commandChar) { + case 'B': + _soundFlag = !_soundFlag; + break; case 'H': // -h[:ex] Disable EMS / XMS high memory support if (_currentLine.hasPrefix(":")) diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index 3959244600..3bfee2d6a6 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -233,13 +233,16 @@ struct ResourceEntry { int _fx; bool _soundFlag; bool _bgFlag; + bool _showWhiteBars; ResourceEntry() {} - ResourceEntry(const Common::String &resName, int fx, bool soundFlag, bool bgFlag) { + ResourceEntry(const Common::String &resName, int fx, bool soundFlag, + bool bgFlag, bool showWhiteBars) { _resourceName = resName; _fx = fx; _soundFlag = soundFlag; _bgFlag = bgFlag; + _showWhiteBars = showWhiteBars; } }; @@ -262,10 +265,12 @@ private: uint32 _previousUpdate; Common::String _currentLine; bool _soundDriverLoaded; - bool _showWhiteBars; bool _resetPalette; ResyncMode _resyncMode; int _sfx; + bool _soundFlag; + bool _bgLoadFlag; + bool _showWhiteBars; Common::Array _resources; Common::Array _resIndex; int _v1; -- cgit v1.2.3