]> git.sesse.net Git - ccbs/blob - bigscreen/rotatescreen.h
Make the bigscreen application read in the number of players per machine, but don...
[ccbs] / bigscreen / rotatescreen.h
1 #ifndef _ROTATESCREEN_H
2 #define _ROTATESCREEN_H 1
3
4 #include <vector>
5 #include <time.h>
6 #include <sys/time.h>
7 #include "screen.h"
8
9 /* 
10  * Doesn't rotate the screens, but rotate _between_ them (ie. show
11  * one at a time). :-)
12  */
13 struct Subscreen {
14         unsigned char *buf;
15         GenericScreen *screen;
16 };
17
18 class RotateScreen : public GenericScreen {
19 private:
20         unsigned char *fadefrom_buf;
21         bool valid;
22         std::vector<Subscreen> subscreens;
23         unsigned current_screen;
24
25         struct timeval last_update, fade_started;
26         bool in_fade, fade_found_start_time, fade_to_new_info;
27
28         bool needs_update();
29         bool can_update();
30         
31 public:
32         RotateScreen();
33         virtual ~RotateScreen();
34
35         bool check_invalidated();
36         void draw(unsigned char *buf, unsigned width, unsigned height);
37
38         void add_screen(GenericScreen *screen);
39 //      void remove_screen(GenericScreen *screen);
40 };
41
42 #endif /* !defined(_ROTATESCREEN_H) */