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 VOYEUR_GRAPHICS_H
23 #define VOYEUR_GRAPHICS_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/rect.h"
28 #include "common/serializer.h"
29 #include "graphics/screen.h"
30 
31 namespace Voyeur {
32 
33 #define SCREEN_WIDTH 320
34 #define SCREEN_HEIGHT 200
35 
36 class VoyeurEngine;
37 class Screen;
38 class DisplayResource;
39 class PictureResource;
40 class ViewPortResource;
41 class ViewPortListResource;
42 class FontResource;
43 class FontInfoResource;
44 class CMapResource;
45 
46 class DrawInfo {
47 public:
48  int _penColor;
49  Common::Point _pos;
50 public:
51  DrawInfo(int penColor, const Common::Point &pos);
52 };
53 
54 typedef void (Screen::*ScreenMethodPtr)();
55 typedef void (Screen::*ViewPortSetupPtr)(ViewPortResource *);
56 typedef void (Screen::*ViewPortAddPtr)(ViewPortResource *, int idx, const Common::Rect &bounds);
57 typedef void (Screen::*ViewPortRestorePtr)(ViewPortResource *);
58 
59 class Screen: public Graphics::Screen {
60 public:
61  byte _VGAColors[PALETTE_SIZE];
62  PictureResource *_backgroundPage;
63  int _SVGAMode;
64  ViewPortListResource *_viewPortListPtr;
65  ViewPortResource *_vPort;
66  bool _saveBack;
67  Common::Rect *_clipPtr;
68  uint _planeSelect;
69  CMapResource *_backColors;
70  FontInfoResource *_fontPtr;
71  PictureResource *_fontChar;
72  DrawInfo *_drawPtr;
73  DrawInfo _defaultDrawInfo;
74 private:
75  VoyeurEngine *_vm;
76 
77  void restoreBack(Common::Array<Common::Rect> &rectList, int rectListCount,
78  PictureResource *srcPic, PictureResource *destPic);
79 public:
80  Screen(VoyeurEngine *vm);
81  ~Screen() override;
82 
83  void sInitGraphics();
84 
85  void setupMCGASaveRect(ViewPortResource *viewPort);
86  void addRectOptSaveRect(ViewPortResource *viewPort, int idx, const Common::Rect &bounds);
87  void restoreMCGASaveRect(ViewPortResource *viewPort);
88  void addRectNoSaveBack(ViewPortResource *viewPort, int idx, const Common::Rect &bounds);
89 
90  void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &initialOffset);
91  void fillPic(DisplayResource *display, byte onOff);
92  void sDisplayPic(PictureResource *pic);
93  void drawANumber(DisplayResource *display, int num, const Common::Point &pt);
94  void flipPage();
95  void setPalette(const byte *palette, int start, int count);
96  void setPalette128(const byte *palette, int start, int count);
97  void resetPalette();
98  void setColor(int idx, byte r, byte g, byte b);
99  void setOneColor(int idx, byte r, byte g, byte b);
100  void setColors(int start, int count, const byte *pal);
101  void screenReset();
102  void fadeDownICF1(int steps);
103  void fadeUpICF1(int steps = 0);
104  void fadeDownICF(int steps);
105  void drawDot();
106 
110  void synchronize(Common::Serializer &s);
111 };
112 
113 } // End of namespace Voyeur
114 
115 #endif /* VOYEUR_GRAPHICS_H */
Definition: voyeur.h:75
Definition: files.h:249
Definition: screen.h:59
Definition: files.h:319
Definition: screen.h:46
Definition: files.h:421
Definition: rect.h:144
Definition: files.h:395
Definition: atari-screen.h:60
Definition: screen.h:48
Definition: serializer.h:79
Definition: files.h:279
Definition: rect.h:45
Definition: files.h:368
Definition: animation.h:38