From 25aa60726ddbcd444043488e5c1756630637891a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 19 Apr 2018 07:58:01 +0200 Subject: LILLIPUT: Fix uninitialized variables --- engines/lilliput/lilliput.cpp | 31 +++++++++++++++++++++++++++++++ engines/lilliput/script.cpp | 5 +++++ 2 files changed, 36 insertions(+) (limited to 'engines/lilliput') diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index e2b2cedae5..4624209874 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -220,6 +220,37 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) _bufferIsoChars = NULL; _bufferIsoMap = NULL; _bufferCubegfx = NULL; + + _sequencesArr = nullptr; + _packedStringIndex = nullptr; + _packedStringNumb = 0; + _packedStrings = nullptr; + _initScript = nullptr; + _initScriptSize = 0; + _menuScript = nullptr; + _menuScriptSize = 0; + _arrayGameScriptIndex = nullptr; + _gameScriptIndexSize = 0; + _arrayGameScripts = nullptr; + _listNumb = 0; + _listIndex = nullptr; + _listArr = nullptr; + _rectNumb = 0; + for (int i = 0; i < 40; ++i) { + _rectXMinMax[i].min = 0; + _rectXMinMax[i].max = 0; + _rectYMinMax[i].min = 0; + _rectYMinMax[i].max = 0; + } + _interfaceHotspotNumb = 0; + for (int i = 0; i < 20; ++i) + _keyboardMapping[i] = Common::KEYCODE_DOLLAR; + + _shouldQuit = false; + _eventMan = nullptr; + _lastTime = 0; + _gameType = kGameTypeNone; + _platform = Common::kPlatformUnknown; } LilliputEngine::~LilliputEngine() { diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index 7025a6b087..5377806c71 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -77,6 +77,11 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL) for (int i = 0; i < 1600; i++) _interactions[i] = 0; + + _heroismLevel = 0; + _talkingCharacter = -1; + _byte16F05_ScriptHandler = 0; + _word18821 = 0; } LilliputScript::~LilliputScript() { -- cgit v1.2.3