aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-09-26 02:15:55 +0200
committerWillem Jan Palenstijn2013-09-26 10:49:25 +0200
commit265f7e463ee9265df7b675a43ce5861418090d2f (patch)
tree270ee7ee8a6e2aceacda17a49aba8d04bc1704a2 /engines/wintermute
parentefdf2d3ab713faf922981a721e20c5d6665f7565 (diff)
downloadscummvm-rg350-265f7e463ee9265df7b675a43ce5861418090d2f.tar.gz
scummvm-rg350-265f7e463ee9265df7b675a43ce5861418090d2f.tar.bz2
scummvm-rg350-265f7e463ee9265df7b675a43ce5861418090d2f.zip
WINTERMUTE: Cleanup
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp60
1 files changed, 27 insertions, 33 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index b362586f29..37f577d202 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -373,42 +373,40 @@ void BaseRenderOSystem::invalidateTicketsFromSurface(BaseSurfaceOSystem *surf) {
void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
renderTicket->_wantsDraw = true;
- {
+
+ ++_lastFrameIter;
+ // In-order
+ if (_renderQueue.empty() || _lastFrameIter == _renderQueue.end()) {
+ _lastFrameIter--;
+ _renderQueue.push_back(renderTicket);
++_lastFrameIter;
- // In-order
- if (_renderQueue.empty() || _lastFrameIter == _renderQueue.end()) {
- _lastFrameIter--;
- _renderQueue.push_back(renderTicket);
- ++_lastFrameIter;
- addDirtyRect(renderTicket->_dstRect);
- ++_lastAddedTicket;
- } else {
- // Before something
- RenderQueueIterator pos = _lastFrameIter;
- _renderQueue.insert(pos, renderTicket);
- --_lastFrameIter;
- addDirtyRect(renderTicket->_dstRect);
- _lastAddedTicket = pos;
- }
+ addDirtyRect(renderTicket->_dstRect);
+ ++_lastAddedTicket;
+ } else {
+ // Before something
+ RenderQueueIterator pos = _lastFrameIter;
+ _renderQueue.insert(pos, renderTicket);
+ --_lastFrameIter;
+ addDirtyRect(renderTicket->_dstRect);
+ _lastAddedTicket = pos;
}
}
void BaseRenderOSystem::drawFromQueuedTicket(const RenderQueueIterator &ticket) {
RenderTicket *renderTicket = *ticket;
renderTicket->_wantsDraw = true;
- {
- ++_lastFrameIter;
- // Was drawn last round, still in the same order
- if (*_lastFrameIter == renderTicket) {
- _drawNum++;
- ++_lastAddedTicket;
- } else {
- --_lastFrameIter;
- // Remove the ticket from the list
- _renderQueue.erase(ticket);
- // Is not in order, so readd it as if it was a new ticket
- drawFromTicket(renderTicket);
- }
+
+ ++_lastFrameIter;
+ // Was drawn last round, still in the same order
+ if (*_lastFrameIter == renderTicket) {
+ _drawNum++;
+ ++_lastAddedTicket;
+ } else {
+ --_lastFrameIter;
+ // Remove the ticket from the list
+ _renderQueue.erase(ticket);
+ // Is not in order, so readd it as if it was a new ticket
+ drawFromTicket(renderTicket);
}
}
@@ -427,14 +425,12 @@ void BaseRenderOSystem::drawTickets() {
// 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.
- uint32 decrement = 0;
while (it != _renderQueue.end()) {
if ((*it)->_wantsDraw == false) {
RenderTicket *ticket = *it;
addDirtyRect((*it)->_dstRect);
it = _renderQueue.erase(it);
delete ticket;
- decrement++;
} else {
++it;
}
@@ -485,14 +481,12 @@ void BaseRenderOSystem::drawTickets() {
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;
}