diff options
Diffstat (limited to 'engines/kyra/scene_lol.cpp')
-rw-r--r-- | engines/kyra/scene_lol.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index d28477b148..e38e5ebc22 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -200,6 +200,7 @@ int LoLEngine::assignLevelDecorationShapes(int index) { if (pv) { _levelDecorationProperties[o].shapeIndex[i] = pv; } else { + releaseDecorations(_lvlShapeIndex, 1); _levelDecorationShapes[_lvlShapeIndex] = getLevelDecorationShapes(t); p1[t] = _lvlShapeIndex; _levelDecorationProperties[o].shapeIndex[i] = _lvlShapeIndex++; @@ -232,6 +233,13 @@ uint8 *LoLEngine::getLevelDecorationShapes(int shapeIndex) { return res; } +void LoLEngine::releaseDecorations(int first, int num) { + for (int i = first; i < (first + num); i++) { + delete[] _levelDecorationShapes[i]; + _levelDecorationShapes[i] = 0; + } +} + void LoLEngine::loadBlockProperties(const char *cmzFile) { memset(_levelBlockProperties, 0, 1024 * sizeof(LevelBlockProperty)); _screen->loadBitmap(cmzFile, 2, 2, 0); |