Bugfix to properly erase text messages when they expire

svn-id: r50432
This commit is contained in:
Paul Gilbert 2010-06-28 11:40:39 +00:00
parent e5509d38b6
commit 6063a9cba3
2 changed files with 9 additions and 9 deletions

View File

@ -313,7 +313,7 @@ int MadsTextDisplay::add(int xp, int yp, uint fontColour, int charSpacing, const
void MadsTextDisplay::setDirtyAreas() {
// Determine dirty areas for active text areas
for (uint idx = 0, dirtyIdx = DIRTY_AREAS_TEXT_DISPLAY_IDX; dirtyIdx < DIRTY_AREAS_SIZE; ++idx, ++dirtyIdx) {
if ((_entries[idx].expire < 0) || !_entries[idx].active)
if ((_entries[idx].expire >= 0) || !_entries[idx].active)
_owner._dirtyAreas[dirtyIdx].active = false;
else {
_owner._dirtyAreas[dirtyIdx].textActive = true;
@ -341,14 +341,6 @@ void MadsTextDisplay::draw(View *view, int yOffset) {
_entries[idx].spacing);
}
}
// Clear up any now text display entries that are to be expired
for (uint idx = 0; idx < _entries.size(); ++idx) {
if (_entries[idx].expire < 0) {
_entries[idx].active = false;
_entries[idx].expire = 0;
}
}
}
/**
@ -827,6 +819,7 @@ void MadsDirtyAreas::setTextDisplay(int dirtyIdx, const MadsTextDisplayEntry &te
* @param count Number of entries to process
*/
void MadsDirtyAreas::merge(int startIndex, int count) {
return;//***DEBUG***
if (startIndex >= count)
return;
@ -878,6 +871,11 @@ void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src, int yOffset, const Co
}
}
void MadsDirtyAreas::clear() {
for (uint i = 0; i < _entries.size(); ++i)
_entries[i].active = false;
}
/*--------------------------------------------------------------------------*/
MadsSequenceList::MadsSequenceList(MadsView &owner): _owner(owner) {
@ -1209,6 +1207,7 @@ MadsView::~MadsView() {
void MadsView::refresh() {
// Draw any sprites
_dirtyAreas.clear();
_spriteSlots.drawBackground(_yOffset);
// Process dirty areas

View File

@ -294,6 +294,7 @@ public:
bool intersects(int idx1, int idx2);
void mergeAreas(int idx1, int idx2);
void copy(M4Surface *dest, M4Surface *src, int yOffset, const Common::Point &posAdjust);
void clear();
};
enum SpriteAnimType {ANIMTYPE_CYCLED = 1, ANIMTYPE_REVERSIBLE = 2};