diff options
-rw-r--r-- | engines/kyra/graphics/screen.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp index cd8f9404cc..d9ebb4ff88 100644 --- a/engines/kyra/graphics/screen.cpp +++ b/engines/kyra/graphics/screen.cpp @@ -52,10 +52,14 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, co memset(_pagePtrs, 0, sizeof(_pagePtrs)); memset(_pageMapping, 0, sizeof(_pageMapping)); + memset(_sjisOverlayPtrs, 0, sizeof(_sjisOverlayPtrs)); _renderMode = Common::kRenderDefault; _sjisMixedFontMode = false; + _screenPalette = _internFadePalette = 0; + _animBlockPtr = _decodeShapeBuffer = 0; + _useHiColorScreen = _vm->gameFlags().useHiColorMode; _use256ColorMode = true; _screenPageSize = SCREEN_PAGE_SIZE; @@ -69,6 +73,7 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, co _currentFontType = FTYPE_ASCII; _paletteChanged = true; _textMarginRight = SCREEN_W; + _customDimTable = 0; _curDim = 0; } @@ -91,15 +96,15 @@ Screen::~Screen() { for (uint i = 0; i < _palettes.size(); ++i) delete _palettes[i]; - for (int i = 0; i < _dimTableCount; ++i) - delete _customDimTable[i]; - delete[] _customDimTable; + if (_customDimTable) { + for (int i = 0; i < _dimTableCount; ++i) + delete _customDimTable[i]; + delete[] _customDimTable; + } } bool Screen::init() { _debugEnabled = false; - - memset(_sjisOverlayPtrs, 0, sizeof(_sjisOverlayPtrs)); _useOverlays = false; _useSJIS = false; _use16ColorMode = _vm->gameFlags().use16ColorMode; |