aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-12-02 07:59:35 +0100
committerEinar Johan Trøan Sømåen2012-12-02 07:59:35 +0100
commit9d42b57c3659f247df09a0d5f97de655dc28af73 (patch)
tree66b94d364d896a657328807eb8d6f63cea6bb88d /engines/wintermute/base
parent72b198b752d4b05cda3be2f5fa8cd6532b3dd2b2 (diff)
downloadscummvm-rg350-9d42b57c3659f247df09a0d5f97de655dc28af73.tar.gz
scummvm-rg350-9d42b57c3659f247df09a0d5f97de655dc28af73.tar.bz2
scummvm-rg350-9d42b57c3659f247df09a0d5f97de655dc28af73.zip
WINTERMUTE: Draw invalid tickets too (as they must have become invalid AFTER their draw-call)
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index 350fc2d87c..67c2b06ce1 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -421,9 +421,12 @@ void BaseRenderOSystem::addDirtyRect(const Common::Rect &rect) {
void BaseRenderOSystem::drawTickets() {
RenderQueueIterator it = _renderQueue.begin();
// Clean out the old tickets
+ // Note: We draw invalid tickets too, otherwise we wouldn't be honouring
+ // the draw request they obviously made BEFORE becoming invalid, either way
+ // we have a copy of their data, so their invalidness won't affect us.
int decrement = 0;
while (it != _renderQueue.end()) {
- if ((*it)->_wantsDraw == false || (*it)->_isValid == false) {
+ if ((*it)->_wantsDraw == false) {
RenderTicket *ticket = *it;
addDirtyRect((*it)->_dstRect);
it = _renderQueue.erase(it);
@@ -453,7 +456,7 @@ void BaseRenderOSystem::drawTickets() {
for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
RenderTicket *ticket = *it;
assert(ticket->_drawNum == _drawNum++);
- if (ticket->_isValid && ticket->_dstRect.intersects(*_dirtyRect)) {
+ if (ticket->_dstRect.intersects(*_dirtyRect)) {
// dstClip is the area we want redrawn.
Common::Rect dstClip(ticket->_dstRect);
// reduce it to the dirty rect
@@ -476,6 +479,23 @@ void BaseRenderOSystem::drawTickets() {
// Revert the colorMod-state.
_colorMod = oldColorMod;
+
+ it = _renderQueue.begin();
+ // Clean out the old tickets
+ decrement = 0;
+ while (it != _renderQueue.end()) {
+ if ((*it)->_isValid == false) {
+ RenderTicket *ticket = *it;
+ addDirtyRect((*it)->_dstRect);
+ it = _renderQueue.erase(it);
+ delete ticket;
+ decrement++;
+ } else {
+ (*it)->_drawNum -= decrement;
+ ++it;
+ }
+ }
+
}
// Replacement for SDL2's SDL_RenderCopy