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 XEEN_SCREEN_H
23 #define XEEN_SCREEN_H
24 
25 #include "common/rect.h"
26 #include "graphics/screen.h"
27 #include "mm/xeen/font.h"
28 #include "mm/xeen/sprites.h"
29 
30 namespace MM {
31 namespace Xeen {
32 
33 #define SCREEN_WIDTH 320
34 #define SCREEN_HEIGHT 200
35 #define PALETTE_COUNT 256
36 #define PALETTE_SIZE (256 * 3)
37 
38 class XeenEngine;
39 
40 class Screen : public Graphics::Screen {
41 private:
42  XeenEngine *_vm;
43  byte _mainPalette[PALETTE_SIZE];
44  byte _tempPalette[PALETTE_SIZE];
45  XSurface _pages[2];
46  XSurface _savedScreens[10];
47  bool _fadeIn;
48 
52  void drawScreen();
53 
54  void fadeInner(int step);
55 
56  void updatePalette();
57 
58  void updatePalette(const byte *pal, int start, int count16);
59 public:
60  Screen(XeenEngine *vm);
61  ~Screen() override {
62  }
63 
68  void addDirtyRect(const Common::Rect &r) override {
70  }
71 
75  void loadPalette(const Common::Path &name);
76 
80  void loadBackground(const Common::Path &name);
81 
85  void loadPage(int pageNum);
86 
87  void freePages();
88 
92  void horizMerge(int xp = 0);
93 
97  void vertMerge(int yp);
98 
102  void fadeIn(int step = 4);
103 
107  void fadeOut(int step = 4);
108 
112  void saveBackground(int slot = 1);
113 
117  void restoreBackground(int slot = 1);
118 
125  bool doScroll(bool rollUp, bool fadeInFlag);
126 };
127 
128 } // End of namespace Xeen
129 } // End of namespace MM
130 
131 #endif
Definition: xsurface.h:45
void fadeOut(int step=4)
void vertMerge(int yp)
void fadeIn(int step=4)
Definition: screen.h:40
void saveBackground(int slot=1)
Definition: rect.h:144
Definition: path.h:52
void horizMerge(int xp=0)
void restoreBackground(int slot=1)
Definition: screen.h:48
virtual void addDirtyRect(const Common::Rect &r)
Definition: xeen.h:93
void loadPalette(const Common::Path &name)
Definition: detection.h:27
void loadBackground(const Common::Path &name)
void addDirtyRect(const Common::Rect &r) override
Definition: screen.h:68
void loadPage(int pageNum)
bool doScroll(bool rollUp, bool fadeInFlag)