ScummVM API documentation
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
28namespace AGS3 {
29
30void DynamicSprite_Delete(ScriptDynamicSprite *sds);
31ScriptDrawingSurface *DynamicSprite_GetDrawingSurface(ScriptDynamicSprite *dss);
32int DynamicSprite_GetGraphic(ScriptDynamicSprite *sds);
33int DynamicSprite_GetWidth(ScriptDynamicSprite *sds);
34int DynamicSprite_GetHeight(ScriptDynamicSprite *sds);
35int DynamicSprite_GetColorDepth(ScriptDynamicSprite *sds);
36void DynamicSprite_Resize(ScriptDynamicSprite *sds, int width, int height);
37void DynamicSprite_Flip(ScriptDynamicSprite *sds, int direction);
38void DynamicSprite_CopyTransparencyMask(ScriptDynamicSprite *sds, int sourceSprite);
39void DynamicSprite_ChangeCanvasSize(ScriptDynamicSprite *sds, int width, int height, int x, int y);
40void DynamicSprite_Crop(ScriptDynamicSprite *sds, int x1, int y1, int width, int height);
41void DynamicSprite_Rotate(ScriptDynamicSprite *sds, int angle, int width, int height);
42void DynamicSprite_Tint(ScriptDynamicSprite *sds, int red, int green, int blue, int saturation, int luminance);
43int DynamicSprite_SaveToFile(ScriptDynamicSprite *sds, const char *namm);
44ScriptDynamicSprite *DynamicSprite_CreateFromSaveGame(int sgslot, int width, int height);
45ScriptDynamicSprite *DynamicSprite_CreateFromFile(const char *filename);
46ScriptDynamicSprite *DynamicSprite_CreateFromScreenShot(int width, int height);
47ScriptDynamicSprite *DynamicSprite_CreateFromExistingSprite(int slot, int preserveAlphaChannel);
48ScriptDynamicSprite *DynamicSprite_CreateFromDrawingSurface(ScriptDrawingSurface *sds, int x, int y, int width, int height);
49ScriptDynamicSprite *DynamicSprite_Create(int width, int height, int alphaChannel);
50ScriptDynamicSprite *DynamicSprite_CreateFromExistingSprite_Old(int slot);
51ScriptDynamicSprite *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[].
56int 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[].
61int 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
63void free_dynamic_sprite(int slot, bool notify_all = true);
64
65} // namespace AGS3
66
67#endif
Definition: ptr.h:572