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 "xeen/font.h"
28 #include "xeen/sprites.h"
29 
30 namespace Xeen {
31 
32 #define SCREEN_WIDTH 320
33 #define SCREEN_HEIGHT 200
34 #define PALETTE_COUNT 256
35 #define PALETTE_SIZE (256 * 3)
36 
37 class XeenEngine;
38 
39 class Screen: public Graphics::Screen {
40 private:
41  XeenEngine *_vm;
42  byte _mainPalette[PALETTE_SIZE];
43  byte _tempPalette[PALETTE_SIZE];
44  XSurface _pages[2];
45  XSurface _savedScreens[10];
46  bool _fadeIn;
47 
51  void drawScreen();
52 
53  void fadeInner(int step);
54 
55  void updatePalette();
56 
57  void updatePalette(const byte *pal, int start, int count16);
58 public:
59  Screen(XeenEngine *vm);
60  ~Screen() override {}
61 
67 
71  void loadPalette(const Common::String &name);
72 
76  void loadBackground(const Common::String &name);
77 
81  void loadPage(int pageNum);
82 
83  void freePages();
84 
88  void horizMerge(int xp = 0);
89 
93  void vertMerge(int yp);
94 
98  void fadeIn(int step = 4);
99 
103  void fadeOut(int step = 4);
104 
108  void saveBackground(int slot = 1);
109 
113  void restoreBackground(int slot = 1);
114 
121  bool doScroll(bool rollUp, bool fadeInFlag);
122 };
123 
124 } // End of namespace Xeen
125 
126 #endif /* XEEN_SCREEN_H */
void vertMerge(int yp)
Definition: str.h:59
Definition: xsurface.h:43
void fadeOut(int step=4)
Definition: rect.h:144
Definition: screen.h:50
Definition: screen.h:39
virtual void addDirtyRect(const Common::Rect &r)
void loadBackground(const Common::String &name)
void addDirtyRect(const Common::Rect &r) override
Definition: screen.h:66
void saveBackground(int slot=1)
void loadPage(int pageNum)
Definition: xeen.h:100
void horizMerge(int xp=0)
void fadeIn(int step=4)
void restoreBackground(int slot=1)
void loadPalette(const Common::String &name)
Definition: character.h:33
bool doScroll(bool rollUp, bool fadeInFlag)