From a923745973bfe7d0f1fba8184add7ec9c320c5e5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 24 May 2016 07:24:30 +0200 Subject: GNAP: Fix some uninitialized variables --- engines/gnap/gamesys.cpp | 10 +++++++++- engines/gnap/resource.h | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/gnap') diff --git a/engines/gnap/gamesys.cpp b/engines/gnap/gamesys.cpp index 4b18fd14a3..8fcf1dca58 100644 --- a/engines/gnap/gamesys.cpp +++ b/engines/gnap/gamesys.cpp @@ -58,9 +58,17 @@ GameSys::GameSys(GnapEngine *vm) : _vm(vm) { _frontSurface = nullptr; for (int i = 0; i < kMaxAnimations; ++i) { _animations[i]._sequenceId = -1; - _animations[i]._id = 0; + _animations[i]._id = -1; _animations[i]._status = 0; } + _removeSequenceItems->_sequenceId = -1; + _removeSequenceItems->_id = -1; + _removeSequenceItems->_forceFrameReset = false; + _removeSpriteDrawItems->_id = -1; + _removeSpriteDrawItems->_surface = nullptr; + + _grabSpriteSurface1 = _grabSpriteSurface2 = nullptr; + _screenRect = Common::Rect(0, 0, 800, 600); } diff --git a/engines/gnap/resource.h b/engines/gnap/resource.h index 29bd31c88f..f4a3669eda 100644 --- a/engines/gnap/resource.h +++ b/engines/gnap/resource.h @@ -59,7 +59,8 @@ struct SequenceAnimation { int16 _framesCount; int16 _maxTotalDuration; SequenceFrame *frames; - SequenceAnimation() : frames(nullptr) {} + + SequenceAnimation() : frames(nullptr), _additionalDelay(0), _framesCount(0), _maxTotalDuration(0) {} ~SequenceAnimation() { delete[] frames; } void loadFromStream(Common::MemoryReadStream &stream); }; -- cgit v1.2.3