diff options
author | Willem Jan Palenstijn | 2011-12-26 17:39:52 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-26 17:42:19 +0100 |
commit | 017c1ed993ed8852d51c5e4ce54a868dc2f91e6b (patch) | |
tree | bec3ae577abc86fd617a31763fadbe50d4298fc6 | |
parent | c60ce59aa443471f22f9254dd6bc3810324cd672 (diff) | |
download | scummvm-rg350-017c1ed993ed8852d51c5e4ce54a868dc2f91e6b.tar.gz scummvm-rg350-017c1ed993ed8852d51c5e4ce54a868dc2f91e6b.tar.bz2 scummvm-rg350-017c1ed993ed8852d51c5e4ce54a868dc2f91e6b.zip |
DREAMWEB: Update deallocatemem for moved sprite table
-rw-r--r-- | engines/dreamweb/stubs.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 7c4bfe8a92..65c9d73ecd 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -950,18 +950,15 @@ void DreamBase::deallocateMem(uint16 segment) { debug(1, "deallocating segment %04x", segment); deallocateSegment(segment); - uint tsize = 16 * 32; - uint16 bseg = data.word(kBuffers); - if (!bseg) - return; - MutableSegmentRef buffers(this); - buffers = bseg; - uint8 *ptr = buffers.ptr(kSpritetable, tsize); - for (uint i = 0; i < tsize; i += 32) { - uint16 seg = READ_LE_UINT16(ptr + i + 6); - //debug(1, "sprite segment = %04x", seg); - if (seg == segment) - memset(ptr + i, 0xff, 32); + // CHECKME: Do we really need this? From brief testing it appears + // the sprite table is cleared entirely shortly after this happens + // anyway. + Common::List<Sprite>::iterator i; + for (i = _spriteTable.begin(); i != _spriteTable.end(); ) { + if (i->_frameData == segment) + i = _spriteTable.erase(i); + else + ++i; } } |