ScummVM API documentation
graphics.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 #ifndef PELROCK_GRAPHICS_H
22 #define PELROCK_GRAPHICS_H
23 
24 #include "common/array.h"
25 #include "common/scummsys.h"
26 #include "common/str-array.h"
27 
28 #include "graphics/font.h"
29 #include "graphics/managed_surface.h"
30 #include "graphics/screen.h"
31 
32 #include "pelrock/types.h"
33 
34 namespace Pelrock {
35 
37 public:
39  ~GraphicsManager();
40 
41  // Overlay / palette utilities
42  Common::Point showOverlay(int height, Graphics::ManagedSurface &buf);
43  void fadeToBlack(int stepSize);
44  void fadePaletteToTarget(byte *targetPalette, int stepSize);
45  void clearScreen();
46 
47  // Text rendering
48  void drawColoredText(Graphics::ManagedSurface *screen, const Common::String &text, int x, int y, int w, byte &defaultColor, Graphics::Font *font);
49  void drawColoredTexts(Graphics::ManagedSurface *surface, const Common::StringArray &text, int x, int y, int w, int yPadding, Graphics::Font *font);
50 
51  // Frame / background management
52  void copyBackgroundToBuffer();
53  void presentFrame();
54 
55  // Sticker rendering
56  void placeStickersFirstPass();
57  void placeStickersSecondPass();
58  void placeSticker(Sticker &sticker, byte *pixels);
59 
60  // Palette animations
61  void updatePaletteAnimations();
62  void animateFadePalette(PaletteAnim *anim);
63  void animateRotatePalette(PaletteAnim *anim);
64 
66  void reflectionEffect(byte *buf, int x, int y, int width, int height);
67 
68  // scaling
69  void calculateScalingMasks();
70 
74  ScaleCalculation calculateScaling(int yPos, ScalingParams scalingParams);
75 
81  byte *scale(int scaleY, int finalWidth, int finalHeight, byte *buf);
82 
83  // Scaling look-up tables initialized by calculateScalingMasks().
84  Common::Array<Common::Array<int>> _widthScalingTable;
85  Common::Array<Common::Array<int>> _heightScalingTable;
86 };
87 
88 } // End of namespace Pelrock
89 #endif // PELROCK_GRAPHICS_H
Definition: managed_surface.h:51
Definition: types.h:384
Definition: str.h:59
Definition: font.h:83
Definition: types.h:470
Definition: actions.h:27
Definition: graphics.h:36
void reflectionEffect(byte *buf, int x, int y, int width, int height)
Definition: rect.h:144
byte * scale(int scaleY, int finalWidth, int finalHeight, byte *buf)
Definition: types.h:452
Definition: types.h:390
ScaleCalculation calculateScaling(int yPos, ScalingParams scalingParams)