ScummVM API documentation
screen.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef PINK_SCREEN_H
23 #define PINK_SCREEN_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 #include "common/system.h"
28 
29 #include "graphics/macgui/macwindowmanager.h"
30 #include "graphics/screen.h"
31 
32 namespace Graphics {
33  class MacMenu;
34 }
35 
36 namespace Pink {
37 
38 class Actor;
39 class ActionCEL;
40 class ActionSound;
41 class ActionText;
42 class PinkEngine;
43 
44 class Screen {
45 public:
46  Screen(PinkEngine *vm);
47  ~Screen();
48 
49  void update();
50  bool processEvent(Common::Event &event);
51 
52  void setPalette(const byte *palette);
53 
54  void addTextAction(ActionText *action);
55  void removeTextAction(ActionText *action);
56 
57  void addSprite(ActionCEL *sprite);
58  void removeSprite(ActionCEL *sprite);
59 
60  void addDirtyRect(const Common::Rect &rect);
61  void addDirtyRects(ActionCEL *sprite);
62 
63  void addSound(ActionSound *sound) { _sounds.push_back(sound); };
64  void removeSound(ActionSound *sound);
65 
66  void addTextWindow(Graphics::MacTextWindow *window);
67  void removeTextWindow(Graphics::MacTextWindow *window);
68 
69  void clear();
70 
71  void pause(bool pause);
72  bool isMenuActive();
73 
74  void saveStage();
75  void loadStage();
76 
77  Actor *getActorByPoint(Common::Point point);
78 
79  Graphics::MacWindowManager &getWndManager() { return *_wm; };
80 
81  void draw(bool blit = true);
82 
83  const Graphics::Font *getTextFont() { return _textFont; }
84 
85 private:
86  void mergeDirtyRects();
87  void drawRect(const Common::Rect &rect);
88 
89 private:
90  Graphics::Screen _surface;
92  Common::Array<Common::Rect> _dirtyRects;
94  Common::Array<ActionCEL *> _savedSprites;
96  Common::Array<ActionText *> _textActions;
98  bool _textRendered;
99 
100  const Graphics::Font *_textFont;
101  bool _textFontCleanup;
102 };
103 
104 } // End of namespace Pink
105 
106 
107 #endif
Definition: font.h:83
Definition: action_text.h:35
Definition: mactextwindow.h:30
Definition: pink.h:95
Definition: rect.h:144
Definition: screen.h:48
Definition: macwindowmanager.h:149
Definition: action_sound.h:30
Definition: archive.h:35
Definition: screen.h:44
Definition: events.h:199
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: action_cel.h:32
Definition: actor.h:39