ScummVM API documentation
screen_v2.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 KYRA_SCREEN_V2_H
23 #define KYRA_SCREEN_V2_H
24 
25 #include "kyra/graphics/screen.h"
26 #include "kyra/engine/kyra_v2.h"
27 
28 namespace Kyra {
29 
30 class Screen_v2 : public Screen {
31 public:
32  Screen_v2(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, const int dimTableSize);
33  ~Screen_v2() override;
34 
35  // screen page handling
36  void checkedPageUpdate(int srcPage, int dstPage);
37 
38  // palette handling
39  uint8 *generateOverlay(const Palette &pal, uint8 *buffer, int color, uint weight, int maxColor = -1);
40  void applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay);
41  int findLeastDifferentColor(const uint8 *paletteEntry, const Palette &pal, uint8 firstColor, uint16 numColors, bool skipSpecialColors = false);
42 
43  void getFadeParams(const Palette &pal, int delay, int &delayInc, int &diff) override;
44 
45  bool timedPaletteFadeStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTime, uint32 totalTime);
46 
47  // shape handling
48  uint8 *getPtrToShape(uint8 *shpFile, int shape);
49  const uint8 *getPtrToShape(const uint8 *shpFile, int shape);
50 
51  int getShapeScaledWidth(const uint8 *shpFile, int scale);
52  int getShapeScaledHeight(const uint8 *shpFile, int scale);
53 
54  uint16 getShapeSize(const uint8 *shp);
55 
56  uint8 *makeShapeCopy(const uint8 *src, int index);
57 
58  // rect handling
59  int getRectSize(int w, int h) override;
60  bool calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2);
61 
62  // text display
63  void setTextColorMap(const uint8 *cmap) override;
64 
65  // layer handling
66  virtual int getLayer(int x, int y);
67 
68  // special WSA handling
69  void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim);
70 
71  // used in non-interactive HoF/LoL demos
72  void copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes);
73  void copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *d, bool flag = false);
74 protected:
75  uint8 *_wsaFrameAnimBuffer;
76 };
77 
78 } // End of namespace Kyra
79 
80 #endif
Definition: kyra_v1.h:126
Definition: screen.h:565
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: screen.h:444
Definition: detection.h:27
Definition: screen.h:47
Definition: system.h:161
Definition: screen_v2.h:30