mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
MORTEVIELLE: Use a specific buffer instead of _mem for the animations
This commit is contained in:
parent
e86ec8bc81
commit
8e2fe73afa
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,6 @@
|
||||
namespace Mortevielle {
|
||||
class MortevielleEngine;
|
||||
|
||||
const int kAdrAni = 0x7314;
|
||||
|
||||
class TextHandler {
|
||||
private:
|
||||
MortevielleEngine *_vm;
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user