diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mortevielle/dialogs.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.h | 3 | ||||
-rw-r--r-- | engines/mortevielle/outtext.cpp | 5 | ||||
-rw-r--r-- | engines/mortevielle/outtext.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/utils.cpp | 6 |
6 files changed, 13 insertions, 9 deletions
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index f6fe9661ac..ba5d984886 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -481,9 +481,9 @@ void DialogManager::displayIntroScreen(bool drawFrame2Fl) { */ void DialogManager::displayIntroFrame2() { _vm->_crep = _vm->getAnimOffset(1, 1); - _vm->displayPicture(&_vm->_mem[(kAdrAni * 16) + _vm->_crep], 63, 12); + _vm->displayPicture(&_vm->_curAnim[_vm->_crep], 63, 12); _vm->_crep = _vm->getAnimOffset(2, 1); - _vm->displayPicture(&_vm->_mem[(kAdrAni * 16) + _vm->_crep], 63, 12); + _vm->displayPicture(&_vm->_curAnim[_vm->_crep], 63, 12); _vm->_largestClearScreen = (_vm->_resolutionScaler == 1); _vm->handleDescriptionText(2, kDialogStringIndex + 143); } diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 7e73d116dd..8eea0cabb5 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -102,11 +102,13 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g memset(_mem, 0, sizeof(_mem)); _curPict = nullptr; + _curAnim = nullptr; _rightFramePict = nullptr; } MortevielleEngine::~MortevielleEngine() { free(_curPict); + free(_curAnim); free(_rightFramePict); } diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index dbd0449d9a..94e9716e7b 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -476,8 +476,9 @@ public: // TODO: Replace the following with proper implementations, or refactor out the code using them byte _mem[65536 * 16]; byte *_curPict; + byte *_curAnim; byte *_rightFramePict; - + Debugger _debugger; ScreenSurface _screenSurface; PaletteManager _paletteManager; diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp index 85cc5809dc..99c06c7c4c 100644 --- a/engines/mortevielle/outtext.cpp +++ b/engines/mortevielle/outtext.cpp @@ -159,8 +159,11 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt error("Missing file - %s", filename.c_str()); assert(skipSize + length <= f.size()); + + free(_vm->_curAnim); + _vm->_curAnim = (byte *)malloc(sizeof(byte) * length); f.seek(skipSize); - f.read(&_vm->_mem[(kAdrAni * 16)], length); + f.read(_vm->_curAnim, length); f.close(); } diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h index 1c69d9b9b4..44868036d5 100644 --- a/engines/mortevielle/outtext.h +++ b/engines/mortevielle/outtext.h @@ -33,8 +33,6 @@ namespace Mortevielle { class MortevielleEngine; -const int kAdrAni = 0x7314; - class TextHandler { private: MortevielleEngine *_vm; diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp index f82f6f7837..001b2d3baf 100644 --- a/engines/mortevielle/utils.cpp +++ b/engines/mortevielle/utils.cpp @@ -2581,12 +2581,12 @@ void MortevielleEngine::adzon() { * @remarks Originally called 'animof' */ int MortevielleEngine::getAnimOffset(int frameNum, int animNum) { - int animCount = _mem[(kAdrAni * 16) + 1]; + int animCount = _curAnim[1]; int aux = animNum; if (frameNum != 1) aux += animCount; - return (animCount << 2) + 2 + READ_BE_UINT16(&_mem[(kAdrAni * 16) + (aux << 1)]); + return (animCount << 2) + 2 + READ_BE_UINT16(&_curAnim[aux << 1]); } /** @@ -2969,7 +2969,7 @@ void MortevielleEngine::displayAnimFrame(int frameNum, int animId) { int offset = getAnimOffset(frameNum, animId); GfxSurface surface; - surface.decode(&_mem[(kAdrAni * 16) + offset]); + surface.decode(&_curAnim[offset]); _screenSurface.drawPicture(surface, 0, 12); prepareScreenType1(); |