ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sprite.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 AGS_ENGINE_AC_SPRITE_H
23 #define AGS_ENGINE_AC_SPRITE_H
24 
25 #include "ags/shared/ac/sprite_cache.h"
26 #include "ags/shared/gfx/bitmap.h"
27 
28 namespace AGS3 {
29 
30 // Converts from 32-bit RGBA image, to a 15/16/24-bit destination image,
31 // replacing more than half-translucent alpha pixels with transparency mask pixels.
32 Shared::Bitmap *remove_alpha_channel(Shared::Bitmap *from);
33 Size get_new_size_for_sprite(const Size &size, const uint32_t sprite_flags);
34 // Initializes a loaded sprite for use in the game, adjusts the sprite flags.
35 // Returns a resulting bitmap, which may be a new or old bitmap; or null on failure.
36 // Original bitmap **gets deleted** if a new bitmap had to be created,
37 // or if failed to properly initialize one.
38 Shared::Bitmap *initialize_sprite(Shared::sprkey_t index, Shared::Bitmap *image, uint32_t &sprite_flags);
39 void post_init_sprite(Shared::sprkey_t index);
40 
41 } // namespace AGS3
42 
43 #endif
Definition: ags.h:40