aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2010-06-28 11:40:39 +0000
committerPaul Gilbert2010-06-28 11:40:39 +0000
commit6063a9cba32443234be31d77e3a7a57870c88007 (patch)
tree45ebe1d0265c649cfe1aabdd7f2d9146ed436687
parente5509d38b609b23c6fa65f0c511baa6895162ec1 (diff)
downloadscummvm-rg350-6063a9cba32443234be31d77e3a7a57870c88007.tar.gz
scummvm-rg350-6063a9cba32443234be31d77e3a7a57870c88007.tar.bz2
scummvm-rg350-6063a9cba32443234be31d77e3a7a57870c88007.zip
Bugfix to properly erase text messages when they expire
svn-id: r50432
-rw-r--r--engines/m4/mads_views.cpp17
-rw-r--r--engines/m4/mads_views.h1
2 files changed, 9 insertions, 9 deletions
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp
index 7b0b1443a8..1766603dc8 100644
--- a/engines/m4/mads_views.cpp
+++ b/engines/m4/mads_views.cpp
@@ -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
diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h
index fc001740d3..8bc507f20b 100644
--- a/engines/m4/mads_views.h
+++ b/engines/m4/mads_views.h
@@ -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};