NANCY: Clean up graphics loop

Removed some leftovers from an older version of the graphics manager and made the drawing code only loop once through all render objects instead of twice.
This commit is contained in:
fracturehill 2021-03-13 14:58:41 +02:00 committed by Eugene Sandulenko
parent b3d06c327e
commit a16c9b90ae

View file

@ -47,6 +47,7 @@ void GraphicsManager::init() {
initGraphics(640, 480, &screenPixelFormat);
_screen.create(640, 480, screenPixelFormat);
_screen.setTransparentColor(getTransColor());
_screen.clear();
Common::SeekableReadStream *ob = NanEngine.getBootChunkStream("OB0");
ob->seek(0);
@ -57,17 +58,10 @@ void GraphicsManager::init() {
}
void GraphicsManager::draw() {
// First go through all objects and update them
// Then add dirty rects to layers below if transparent
for (auto it : _objects) {
RenderObject &current = *it;
current.updateGraphics();
}
Common::Array<Common::Rect> drawn;
for (auto it : _objects) {
RenderObject &current = *it;
if (current._isVisible && current._needsRedraw) {
// object is visible and updated