ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gfx_util.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 //=============================================================================
23 //
24 // Intermediate level drawing utility functions.
25 //
26 // GfxUtil namespace is meant for intermediate-to-lower level functions, that
27 // implement specific conversions, tricks and hacks for drawing bitmaps and
28 // geometry.
29 // The suggested convention is to add only those functions, that do not require
30 // any knowledge of higher-level engine types and objects.
31 //
32 //=============================================================================
33 
34 #ifndef AGS_ENGINE_GFX_GFX_UTIL_H
35 #define AGS_ENGINE_GFX_GFX_UTIL_H
36 
37 #include "ags/shared/gfx/bitmap.h"
38 #include "ags/shared/gfx/gfx_def.h"
39 
40 namespace AGS3 {
41 namespace AGS {
42 namespace Engine {
43 
44 using Shared::Bitmap;
45 
46 namespace GfxUtil {
47 // Creates a COPY of the source bitmap, converted to the given format.
48 // Keeps mask pixels intact, only converting mask color value if necessary.
49 Bitmap *ConvertBitmap(Bitmap *src, int dst_color_depth);
50 
51 // Considers the given information about source and destination surfaces,
52 // then draws a bimtap over another either using requested blending mode,
53 // or fallbacks to common "magic pink" transparency mode;
54 // optionally uses blending alpha (overall image transparency).
55 void DrawSpriteBlend(Bitmap *ds, const Point &ds_at, Bitmap *sprite,
56  Shared::BlendMode blend_mode, bool dst_has_alpha = true, bool src_has_alpha = true, int blend_alpha = 0xFF);
57 
58 // Draws a bitmap over another one with given alpha level (0 - 255),
59 // takes account of the bitmap's mask color,
60 // ignores image's alpha channel, even if there's one;
61 // does a conversion if sprite and destination color depths do not match.
62 void DrawSpriteWithTransparency(Bitmap *ds, Bitmap *sprite, int x, int y, int alpha = 0xFF);
63 } // namespace GfxUtil
64 
65 } // namespace Engine
66 } // namespace AGS
67 } // namespace AGS3
68 
69 #endif
Definition: achievements_tables.h:27
Definition: display_client.h:58
Definition: engine.h:144
Definition: ags.h:40