ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
dynamic_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_DYNAMICSPRITE_H
23 #define AGS_ENGINE_AC_DYNAMICSPRITE_H
24 
25 #include "ags/engine/ac/dynobj/script_dynamic_sprite.h"
26 #include "ags/engine/ac/dynobj/script_drawing_surface.h"
27 
28 namespace AGS3 {
29 
30 void DynamicSprite_Delete(ScriptDynamicSprite *sds);
31 ScriptDrawingSurface *DynamicSprite_GetDrawingSurface(ScriptDynamicSprite *dss);
32 int DynamicSprite_GetGraphic(ScriptDynamicSprite *sds);
33 int DynamicSprite_GetWidth(ScriptDynamicSprite *sds);
34 int DynamicSprite_GetHeight(ScriptDynamicSprite *sds);
35 int DynamicSprite_GetColorDepth(ScriptDynamicSprite *sds);
36 void DynamicSprite_Resize(ScriptDynamicSprite *sds, int width, int height);
37 void DynamicSprite_Flip(ScriptDynamicSprite *sds, int direction);
38 void DynamicSprite_CopyTransparencyMask(ScriptDynamicSprite *sds, int sourceSprite);
39 void DynamicSprite_ChangeCanvasSize(ScriptDynamicSprite *sds, int width, int height, int x, int y);
40 void DynamicSprite_Crop(ScriptDynamicSprite *sds, int x1, int y1, int width, int height);
41 void DynamicSprite_Rotate(ScriptDynamicSprite *sds, int angle, int width, int height);
42 void DynamicSprite_Tint(ScriptDynamicSprite *sds, int red, int green, int blue, int saturation, int luminance);
43 int DynamicSprite_SaveToFile(ScriptDynamicSprite *sds, const char *namm);
44 ScriptDynamicSprite *DynamicSprite_CreateFromSaveGame(int sgslot, int width, int height);
45 ScriptDynamicSprite *DynamicSprite_CreateFromFile(const char *filename);
46 ScriptDynamicSprite *DynamicSprite_CreateFromScreenShot(int width, int height);
47 ScriptDynamicSprite *DynamicSprite_CreateFromExistingSprite(int slot, int preserveAlphaChannel);
48 ScriptDynamicSprite *DynamicSprite_CreateFromDrawingSurface(ScriptDrawingSurface *sds, int x, int y, int width, int height);
49 ScriptDynamicSprite *DynamicSprite_Create(int width, int height, int alphaChannel);
50 ScriptDynamicSprite *DynamicSprite_CreateFromExistingSprite_Old(int slot);
51 ScriptDynamicSprite *DynamicSprite_CreateFromBackground(int frame, int x1, int y1, int width, int height);
52 
53 // Registers a new dynamic sprite, and returns a slot number;
54 // returns 0 if no free slot could be found or allocated.
55 // Updates game.SpriteInfos[].
56 int add_dynamic_sprite(std::unique_ptr<AGS::Shared::Bitmap> image, bool has_alpha = false, uint32_t extra_flags = 0u);
57 // Registers a new dynamic sprite in the given slot number,
58 // previous bitmap on this slot (if any) will be deleted.
59 // Returns same slot number on success, or 0 if there was an error.
60 // Updates game.SpriteInfos[].
61 int add_dynamic_sprite(int slot, std::unique_ptr<AGS::Shared::Bitmap> image, bool hasAlpha = false, uint32_t extra_flags = 0u);
62 // Disposes a dynamic sprite, and frees the slot
63 void free_dynamic_sprite(int slot, bool notify_all = true);
64 
65 } // namespace AGS3
66 
67 #endif
Definition: ptr.h:572
Definition: ags.h:40