diff options
-rw-r--r-- | engines/cine/anim.cpp | 2 | ||||
-rw-r--r-- | engines/cine/anim.h | 2 | ||||
-rw-r--r-- | engines/cine/cine.cpp | 4 | ||||
-rw-r--r-- | engines/cine/gfx.cpp | 6 |
4 files changed, 9 insertions, 5 deletions
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index 1036078fb3..a670328c12 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -49,7 +49,7 @@ struct AnimHeader2Struct { uint16 field_E; }; -AnimData animDataTable[NUM_MAX_ANIMDATA]; +Common::Array<AnimData> animDataTable; static const AnimDataEntry transparencyData[] = { {"ALPHA", 0xF}, diff --git a/engines/cine/anim.h b/engines/cine/anim.h index 317654064b..8b1541eb3f 100644 --- a/engines/cine/anim.h +++ b/engines/cine/anim.h @@ -150,7 +150,7 @@ public: #define NUM_MAX_ANIMDATA 255 -extern AnimData animDataTable[NUM_MAX_ANIMDATA]; +extern Common::Array<AnimData> animDataTable; void freeAnimDataTable(void); void freeAnimDataRange(byte startIdx, byte numIdx); diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 900f1678db..ab1f5ac5e9 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -128,6 +128,10 @@ void CineEngine::initialize() { objectTable.resize(NUM_MAX_OBJECT); resetObjectTable(); + // Resize animation data table to its correct size and reset all its elements + animDataTable.resize(NUM_MAX_ANIMDATA); + freeAnimDataTable(); + _timerDelayMultiplier = 12; // Set default speed setupOpcodes(); diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 1da4a91d7f..c6c5faf464 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -436,7 +436,7 @@ void FWRenderer::renderOverlay(const Common::List<overlay>::iterator &it) { switch (it->type) { // color sprite case 0: - sprite = animDataTable + objectTable[it->objIdx].frame; + sprite = &animDataTable[objectTable[it->objIdx].frame]; len = sprite->_realWidth * sprite->_height; mask = new byte[len]; memcpy(mask, sprite->mask(), len); @@ -1074,7 +1074,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) { if (objectTable[it->objIdx].frame < 0) { break; } - sprite = animDataTable + objectTable[it->objIdx].frame; + sprite = &animDataTable[objectTable[it->objIdx].frame]; len = sprite->_realWidth * sprite->_height; mask = new byte[len]; generateMask(sprite->data(), mask, len, objectTable[it->objIdx].part); @@ -1108,7 +1108,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) { assert(it->objIdx < NUM_MAX_OBJECT); var5 = it->x; // A global variable updated here! obj = &objectTable[it->objIdx]; - sprite = animDataTable + obj->frame; + sprite = &animDataTable[obj->frame]; if (obj->frame < 0 || it->x < 0 || it->x > 8 || !_bgTable[it->x].bg || sprite->_bpp != 1) { break; |