ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
screen_lol.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 #ifdef ENABLE_LOL
23 
24 #ifndef KYRA_SCREEN_LOL_H
25 #define KYRA_SCREEN_LOL_H
26 
27 #include "kyra/graphics/screen_v2.h"
28 
29 namespace Kyra {
30 
31 class LoLEngine;
32 
33 class Screen_LoL : public Screen_v2 {
34 public:
35  Screen_LoL(LoLEngine *vm, OSystem *system);
36  ~Screen_LoL() override;
37 
38  void fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint flags, ...) GCC_PRINTF(2, 8);
39  void fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint flags, ...) GCC_PRINTF(2, 9);
40 
41  void drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2) override;
42 
43  void drawGridBox(int x, int y, int w, int h, int col);
44  void fadeClearSceneWindow(int delay);
45 
46  // smooth scrolling
47  void backupSceneWindow(int srcPageNum, int dstPageNum);
48  void restoreSceneWindow(int srcPageNum, int dstPageNum);
49  void clearGuiShapeMemory(int pageNum);
50  void copyGuiShapeFromSceneBackupBuffer(int srcPageNum, int dstPageNum);
51  void copyGuiShapeToSurface(int srcPageNum, int dstPageNum);
52  void smoothScrollZoomStepTop(int srcPageNum, int dstPageNum, int x, int y);
53  void smoothScrollZoomStepBottom(int srcPageNum, int dstPageNum, int x, int y);
54  void smoothScrollHorizontalStep(int pageNum, int x, int u2, int w);
55  void smoothScrollTurnStep1(int srcPage1Num, int srcPage2Num, int dstPageNum);
56  void smoothScrollTurnStep2(int srcPage1Num, int srcPage2Num, int dstPageNum);
57  void smoothScrollTurnStep3(int srcPage1Num, int srcPage2Num, int dstPageNum);
58 
59  void copyRegionSpecial(int page1, int w1, int h1, int x1, int y1, int page2, int w2, int h2, int x2, int y2, int w3, int h3, int mode, ...);
60 
61  // palette stuff
62  void fadeToBlack(int delay=0x54, const UpdateFunctor *upFunc = 0);
63  void fadeToPalette1(int delay);
64  void loadSpecialColors(Palette &dst);
65  void copyColor(int dstColorIndex, int srcColorIndex);
66  bool fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedTicks, uint32 totalTicks);
67  Palette **generateFadeTable(Palette **dst, Palette *src1, Palette *src2, int numTabs);
68 
69  void generateGrayOverlay(const Palette &Pal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors);
70  uint8 *getLevelOverlay(int index) { return _levelOverlays[index]; }
71 
72  void createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b);
73 
74  void copyBlockAndApplyOverlay(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, uint8 *ovl);
75  void applyOverlaySpecial(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, int flag, uint8 *ovl);
76 
77  void copyBlockAndApplyOverlayOutro(int srcPage, int dstPage, const uint8 *ovl);
78 
79  uint8 getShapePaletteSize(const uint8 *shp);
80 
81  uint8 *_paletteOverlay1;
82  uint8 *_paletteOverlay2;
83  uint8 *_grayOverlay;
84  int _fadeFlag;
85 
86  // PC98 specific
87  static void convertPC98Gfx(uint8 *data, int w, int h, int pitch);
88 
89 private:
90  static const ScreenDim _screenDimTable256C[];
91  static const ScreenDim _screenDimTable16C[];
92  static const ScreenDim _screenDimTableZH[];
93  static const int _screenDimTableCount;
94 
95  uint8 *_levelOverlays[8];
96 
97  void mergeOverlay(int x, int y, int w, int h) override;
98  void postProcessCursor(uint8 *data, int width, int height, int pitch) override;
99 };
100 
101 } // End of namespace Kyra
102 
103 #endif
104 
105 #endif // ENABLE_LOL
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: detection.h:27
Definition: system.h:161
Definition: atari-screen.h:44