diff options
author | johndoe123 | 2013-04-20 00:34:32 +0200 |
---|---|---|
committer | johndoe123 | 2013-04-20 00:34:32 +0200 |
commit | 4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c (patch) | |
tree | b94c1c72f00b06a44a78751f9a13a8528df2fb84 /engines/sword25/gfx/renderobject.cpp | |
parent | 176a3babc553d1d6eb2a57fddb0a9665fc4aaa71 (diff) | |
download | scummvm-rg350-4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c.tar.gz scummvm-rg350-4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c.tar.bz2 scummvm-rg350-4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c.zip |
SWORD25: Fix blitting code
- Rename collectRenderQueue to preRender
- Only do forceRefresh() in Panel::setColor() and Text::setText() if the new values are different
- Move child object resorting from RenderObject::render() into RenderObject::preRender()
Diffstat (limited to 'engines/sword25/gfx/renderobject.cpp')
-rw-r--r-- | engines/sword25/gfx/renderobject.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index d1381513fd..807c1eb64b 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -110,13 +110,12 @@ RenderObject::~RenderObject() { RenderObjectRegistry::instance().deregisterObject(this); } -bool RenderObject::render(RectangleList *updateRects, const Common::Array<int> &updateRectsMinZ) { +void RenderObject::preRender(RenderObjectQueue *renderQueue) { // Objektänderungen validieren validateObject(); - // Falls das Objekt nicht sichtbar ist, muss gar nichts gezeichnet werden if (!_visible) - return true; + return; // Falls notwendig, wird die Renderreihenfolge der Kinderobjekte aktualisiert. if (_childChanged) { @@ -124,6 +123,20 @@ bool RenderObject::render(RectangleList *updateRects, const Common::Array<int> & _childChanged = false; } + renderQueue->add(this); + + RENDEROBJECT_ITER it = _children.begin(); + for (; it != _children.end(); ++it) + (*it)->preRender(renderQueue); + +} + +bool RenderObject::render(RectangleList *updateRects, const Common::Array<int> &updateRectsMinZ) { + + // Falls das Objekt nicht sichtbar ist, muss gar nichts gezeichnet werden + if (!_visible) + return true; + // Objekt zeichnen. bool needRender = false; int index = 0; @@ -145,19 +158,6 @@ bool RenderObject::render(RectangleList *updateRects, const Common::Array<int> & return true; } -void RenderObject::collectRenderQueue(RenderObjectQueue *renderQueue) { - - if (!_visible) - return; - - renderQueue->add(this); - - RENDEROBJECT_ITER it = _children.begin(); - for (; it != _children.end(); ++it) - (*it)->collectRenderQueue(renderQueue); - -} - void RenderObject::validateObject() { // Die Veränderungen in den Objektvariablen aufheben _oldBbox = _bbox; |