Implement a simple priority system.
[ccbs] / bigscreen / rotatescreen.cpp
index 275b73e..fcc975c 100644 (file)
@@ -103,12 +103,14 @@ void RotateScreen::draw(unsigned char *buf)
                // determine if we want to switch screens
        
                unsigned old_current_screen = current_screen;
+               int priority = -9999;  // bah :-P
                
                // push any invalidated screen first (for now)
                for (unsigned i = 0; i < subscreens.size(); ++i) {
-                       if (subscreens[i].screen->check_invalidated()) {
+                       if (subscreens[i].screen->check_invalidated() && subscreens[i].screen->get_priority() > priority) {
                                current_screen = i;
                                force = true;
+                               priority = subscreens[i].screen->get_priority();
                        }
                }