From a6fbfd958d372c63669f6fdc82bff39b3f151c09 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 28 Oct 2013 07:32:15 +0100 Subject: [PATCH] AVALANCHE: Fix CID 1109677, 1109678, 1109694, 1109695 --- engines/avalanche/animation.cpp | 38 +++++++++++++++++++++++++++++++++ engines/avalanche/animation.h | 3 ++- engines/avalanche/menu.cpp | 8 +++++++ engines/avalanche/menu.h | 1 + 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index ef30faa87cf..4ddeedce948 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -48,6 +48,35 @@ const int32 Animation::kCatacombMap[8][8] = { AnimationType::AnimationType(Animation *anim) { _anim = anim; + + _yLength = 0; + for (int i = 0; i < 24; i++) { + _mani[i] = nullptr; + _sil[i] = nullptr; + } + _frameNum = 0; + _seq = 0; + _characterId = 0; + _count = 0; + _facingDir = kDirNone; + _stepNum = 0; + _x = 0; + _y = 0; + _moveX = 0; + _moveY = 0; + _quick = false; + _visible = false; + _homing = false; + _doCheck = false; + _homingX = 0; + _homingY = 0; + _speedX = 0; + _speedY = 0; + _vanishIfStill = false; + _callEachStepFl = false; + _eachStepProc = Animation::kProcNone; + _fgBubbleCol = kColorWhite; + _bgBubbleCol = kColorBlack; } /** @@ -370,6 +399,13 @@ Animation::Animation(AvalancheEngine *vm) { for (int16 i = 0; i < kSpriteNumbMax; i++) { _sprites[i] = new AnimationType(this); } + + _direction = kDirNone; + _oldDirection = kDirNone; + _arrowTriggered = false; + _geidaSpin = 0; + _geidaTime = 0; + _sayWhat = 0; } Animation::~Animation() { @@ -1202,6 +1238,8 @@ void Animation::animLink() { case kProcGeida : geidaProcs(i); break; + default: + break; } } } diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h index 33f6ab02a6c..32236159853 100644 --- a/engines/avalanche/animation.h +++ b/engines/avalanche/animation.h @@ -97,7 +97,8 @@ public: static const byte kSpriteNumbMax = 5; // current max no. of sprites enum Proc { - kProcFollowAvvyY = 1, + kProcNone = 0, + kProcFollowAvvyY, kProcBackAndForth, kProcFaceAvvy, kProcArrow, diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp index a3b61b4af16..7c37b79bc8a 100644 --- a/engines/avalanche/menu.cpp +++ b/engines/avalanche/menu.cpp @@ -207,6 +207,11 @@ void MenuItem::parseKey(char c) { _menu->_vm->_sound->blip(); } +MenuBar::MenuBar() { + _menuNum = 0; + _menu = nullptr; +} + void MenuBar::init(Menu *menu) { _menu = menu; _menuNum = 0; @@ -261,6 +266,9 @@ Menu::Menu(AvalancheEngine *vm) { _vm = vm; _activeMenuItem.init(this); _menuBar.init(this); + + _menuActive = false; + _lastPerson = kPeopleNone; } void Menu::findWhatYouCanDoWithIt() { diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h index a7ec8bf2db2..b7674fbb9dd 100644 --- a/engines/avalanche/menu.h +++ b/engines/avalanche/menu.h @@ -102,6 +102,7 @@ public: HeadType _menuItems[8]; byte _menuNum; + MenuBar(); void init(Menu *menu); void createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc); void draw();