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 NEVERHOOD_SCREEN_H
23 #define NEVERHOOD_SCREEN_H
24 
25 #include "common/array.h"
26 #include "graphics/surface.h"
27 #include "neverhood/neverhood.h"
28 #include "neverhood/microtiles.h"
29 #include "neverhood/graphics.h"
30 
31 namespace Video {
32  class SmackerDecoder;
33 }
34 
35 namespace Neverhood {
36 
37 struct RenderItem {
38  const Graphics::Surface *_surface;
39  const Graphics::Surface *_shadowSurface;
40  int16 _destX, _destY;
41  int16 _srcX, _srcY, _width, _height;
42  bool _transparent;
43  byte _version;
44  bool _refresh;
45  byte _alphaColor;
46  bool operator==(const RenderItem &second) const {
47  return
48  _surface == second._surface &&
49  _shadowSurface == second._shadowSurface &&
50  _destX == second._destX &&
51  _destY == second._destY &&
52  _srcX == second._srcX &&
53  _srcY == second._srcY &&
54  _width == second._width &&
55  _height == second._height &&
56  _transparent == second._transparent &&
57  _version == second._version &&
58  _alphaColor == second._alphaColor;
59  }
60 };
61 
63 
64 class Screen {
65 public:
67  ~Screen();
68  void update();
69  uint32 getNextFrameTime();
70  void saveParams();
71  void restoreParams();
72  void setFps(int fps);
73  int getFps();
74  void setYOffset(int16 yOffset);
75  int16 getYOffset();
76  void setPaletteData(byte *paletteData);
77  void unsetPaletteData(byte *paletteData);
78  byte *getPaletteData() { return _paletteData; }
79  void testPalette(byte *paletteData);
80  void updatePalette();
81  void clear();
82  void clearRenderQueue();
83  void drawSurface2(const Graphics::Surface *surface, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version,
84  const Graphics::Surface *shadowSurface = NULL, byte alphaColor = 0);
85  void drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version);
86  void drawDoubleSurface2(const Graphics::Surface *surface, NDrawRect &drawRect);
87  void drawDoubleSurface2Alpha(const Graphics::Surface *surface, NDrawRect &drawRect, byte alphaColor);
88  void drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDrawRect &sysRect, NRect &clipRect, bool transparent, byte version);
89  void drawSurfaceClipRects(const Graphics::Surface *surface, NDrawRect &drawRect, NRect *clipRects, uint clipRectsCount, bool transparent, byte version);
90  void setSmackerDecoder(Video::SmackerDecoder *smackerDecoder) { _smackerDecoder = smackerDecoder; }
91  void queueBlit(const Graphics::Surface *surface, int16 destX, int16 destY, NRect &ddRect, bool transparent, byte version,
92  const Graphics::Surface *shadowSurface = NULL, byte alphaColor = 0);
93  void blitRenderItem(const RenderItem &renderItem, const Common::Rect &clipRect);
94 protected:
95  NeverhoodEngine *_vm;
96  MicroTileArray *_microTiles;
97  Graphics::Surface *_backScreen;
98  Video::SmackerDecoder *_smackerDecoder, *_savedSmackerDecoder;
99  int32 _ticks;
100  int32 _frameDelay, _savedFrameDelay;
101  byte *_paletteData;
102  bool _paletteChanged;
103  int16 _yOffset, _savedYOffset;
104  bool _fullRefresh;
105  RenderQueue *_renderQueue, *_prevRenderQueue;
106 };
107 
108 } // End of namespace Neverhood
109 
110 #endif /* NEVERHOOD_SCREEN_H */
Definition: background.h:30
Definition: surface.h:66
Definition: screen.h:64
Definition: neverhood.h:60
Definition: array.h:52
Definition: microtiles.h:40
Definition: rect.h:144
Definition: smk_decoder.h:75
Definition: graphics.h:42
Definition: graphics.h:67
Definition: screen.h:37
Definition: avi_frames.h:36