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
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (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, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #include "ags/plugins/core/dynamic_sprite.h"
24 #include "ags/engine/ac/dynamic_sprite.h"
25
26 namespace AGS3 {
27 namespace Plugins {
28 namespace Core {
29
AGS_EngineStartup(IAGSEngine * engine)30 void DynamicSprite::AGS_EngineStartup(IAGSEngine *engine) {
31 ScriptContainer::AGS_EngineStartup(engine);
32
33 SCRIPT_METHOD(DynamicSprite::ChangeCanvasSize^4, DynamicSprite::ChangeCanvasSize);
34 SCRIPT_METHOD(DynamicSprite::CopyTransparencyMask^1, DynamicSprite::CopyTransparencyMask);
35 SCRIPT_METHOD(DynamicSprite::Crop^4, DynamicSprite::Crop);
36 SCRIPT_METHOD(DynamicSprite::Delete, DynamicSprite::Delete);
37 SCRIPT_METHOD(DynamicSprite::Flip^1, DynamicSprite::Flip);
38 SCRIPT_METHOD(DynamicSprite::GetDrawingSurface^0, DynamicSprite::GetDrawingSurface);
39 SCRIPT_METHOD(DynamicSprite::Resize^2, DynamicSprite::Resize);
40 SCRIPT_METHOD(DynamicSprite::Rotate^3, DynamicSprite::Rotate);
41 SCRIPT_METHOD(DynamicSprite::SaveToFile^1, DynamicSprite::SaveToFile);
42 SCRIPT_METHOD(DynamicSprite::Tint^5, DynamicSprite::Tint);
43 SCRIPT_METHOD(DynamicSprite::get_ColorDepth, DynamicSprite::GetColorDepth);
44 SCRIPT_METHOD(DynamicSprite::get_Graphic, DynamicSprite::GetGraphic);
45 SCRIPT_METHOD(DynamicSprite::get_Height, DynamicSprite::GetHeight);
46 SCRIPT_METHOD(DynamicSprite::get_Width, DynamicSprite::GetWidth);
47 SCRIPT_METHOD(DynamicSprite::Create^3, DynamicSprite::Create);
48 SCRIPT_METHOD(DynamicSprite::CreateFromBackground, DynamicSprite::CreateFromBackground);
49 SCRIPT_METHOD(DynamicSprite::CreateFromDrawingSurface^5, DynamicSprite::CreateFromDrawingSurface);
50 SCRIPT_METHOD(DynamicSprite::CreateFromExistingSprite^1, DynamicSprite::CreateFromExistingSprite_Old);
51 SCRIPT_METHOD(DynamicSprite::CreateFromExistingSprite^2, DynamicSprite::CreateFromExistingSprite);
52 SCRIPT_METHOD(DynamicSprite::CreateFromFile, DynamicSprite::CreateFromFile);
53 SCRIPT_METHOD(DynamicSprite::CreateFromSaveGame, DynamicSprite::CreateFromSaveGame);
54 SCRIPT_METHOD(DynamicSprite::CreateFromScreenShot, DynamicSprite::CreateFromScreenShot);
55 }
56
ChangeCanvasSize(ScriptMethodParams & params)57 void DynamicSprite::ChangeCanvasSize(ScriptMethodParams ¶ms) {
58 PARAMS5(ScriptDynamicSprite *, sds, int, width, int, height, int, x, int, y);
59 AGS3::DynamicSprite_ChangeCanvasSize(sds, width, height, x, y);
60 }
61
CopyTransparencyMask(ScriptMethodParams & params)62 void DynamicSprite::CopyTransparencyMask(ScriptMethodParams ¶ms) {
63 PARAMS2(ScriptDynamicSprite *, sds, int, sourceSprite);
64 AGS3::DynamicSprite_CopyTransparencyMask(sds, sourceSprite);
65 }
66
Crop(ScriptMethodParams & params)67 void DynamicSprite::Crop(ScriptMethodParams ¶ms) {
68 PARAMS5(ScriptDynamicSprite *, sds, int, x1, int, y1, int, width, int, height);
69 AGS3::DynamicSprite_Crop(sds, x1, y1, width, height);
70 }
71
Delete(ScriptMethodParams & params)72 void DynamicSprite::Delete(ScriptMethodParams ¶ms) {
73 PARAMS1(ScriptDynamicSprite *, sds);
74 AGS3::DynamicSprite_Delete(sds);
75 }
76
Flip(ScriptMethodParams & params)77 void DynamicSprite::Flip(ScriptMethodParams ¶ms) {
78 PARAMS2(ScriptDynamicSprite *, sds, int, direction);
79 AGS3::DynamicSprite_Flip(sds, direction);
80 }
81
GetDrawingSurface(ScriptMethodParams & params)82 void DynamicSprite::GetDrawingSurface(ScriptMethodParams ¶ms) {
83 PARAMS1(ScriptDynamicSprite *, dss);
84 params._result = AGS3::DynamicSprite_GetDrawingSurface(dss);
85 }
86
Resize(ScriptMethodParams & params)87 void DynamicSprite::Resize(ScriptMethodParams ¶ms) {
88 PARAMS3(ScriptDynamicSprite *, sds, int, width, int, height);
89 AGS3::DynamicSprite_Resize(sds, width, height);
90 }
91
Rotate(ScriptMethodParams & params)92 void DynamicSprite::Rotate(ScriptMethodParams ¶ms) {
93 PARAMS4(ScriptDynamicSprite *, sds, int, angle, int, width, int, height);
94 AGS3::DynamicSprite_Rotate(sds, angle, width, height);
95 }
96
SaveToFile(ScriptMethodParams & params)97 void DynamicSprite::SaveToFile(ScriptMethodParams ¶ms) {
98 PARAMS2(ScriptDynamicSprite *, sds, const char *, namm);
99 params._result = AGS3::DynamicSprite_SaveToFile(sds, namm);
100 }
101
Tint(ScriptMethodParams & params)102 void DynamicSprite::Tint(ScriptMethodParams ¶ms) {
103 PARAMS6(ScriptDynamicSprite *, sds, int, red, int, green, int, blue, int, saturation, int, luminance);
104 AGS3::DynamicSprite_Tint(sds, red, green, blue, saturation, luminance);
105 }
106
GetColorDepth(ScriptMethodParams & params)107 void DynamicSprite::GetColorDepth(ScriptMethodParams ¶ms) {
108 PARAMS1(ScriptDynamicSprite *, sds);
109 params._result = AGS3::DynamicSprite_GetColorDepth(sds);
110 }
111
GetGraphic(ScriptMethodParams & params)112 void DynamicSprite::GetGraphic(ScriptMethodParams ¶ms) {
113 PARAMS1(ScriptDynamicSprite *, sds);
114 params._result = AGS3::DynamicSprite_GetGraphic(sds);
115 }
116
GetHeight(ScriptMethodParams & params)117 void DynamicSprite::GetHeight(ScriptMethodParams ¶ms) {
118 PARAMS1(ScriptDynamicSprite *, sds);
119 params._result = AGS3::DynamicSprite_GetHeight(sds);
120 }
121
GetWidth(ScriptMethodParams & params)122 void DynamicSprite::GetWidth(ScriptMethodParams ¶ms) {
123 PARAMS1(ScriptDynamicSprite *, sds);
124 params._result = AGS3::DynamicSprite_GetWidth(sds);
125 }
126
Create(ScriptMethodParams & params)127 void DynamicSprite::Create(ScriptMethodParams ¶ms) {
128 PARAMS3(int, width, int, height, int, alphaChannel);
129 params._result = AGS3::DynamicSprite_Create(width, height, alphaChannel);
130 }
131
CreateFromBackground(ScriptMethodParams & params)132 void DynamicSprite::CreateFromBackground(ScriptMethodParams ¶ms) {
133 PARAMS5(int, frame, int, x1, int, y1, int, width, int, height);
134 params._result = AGS3::DynamicSprite_CreateFromBackground(frame, x1, y1, width, height);
135 }
136
CreateFromDrawingSurface(ScriptMethodParams & params)137 void DynamicSprite::CreateFromDrawingSurface(ScriptMethodParams ¶ms) {
138 PARAMS5(ScriptDrawingSurface *, sds, int, x, int, y, int, width, int, height);
139 params._result = AGS3::DynamicSprite_CreateFromDrawingSurface(sds, x, y, width, height);
140 }
141
CreateFromExistingSprite_Old(ScriptMethodParams & params)142 void DynamicSprite::CreateFromExistingSprite_Old(ScriptMethodParams ¶ms) {
143 PARAMS1(int, slot);
144 params._result = AGS3::DynamicSprite_CreateFromExistingSprite_Old(slot);
145 }
146
CreateFromExistingSprite(ScriptMethodParams & params)147 void DynamicSprite::CreateFromExistingSprite(ScriptMethodParams ¶ms) {
148 PARAMS2(int, slot, int, preserveAlphaChannel);
149 params._result = AGS3::DynamicSprite_CreateFromExistingSprite(slot, preserveAlphaChannel);
150 }
151
CreateFromFile(ScriptMethodParams & params)152 void DynamicSprite::CreateFromFile(ScriptMethodParams ¶ms) {
153 PARAMS1(const char *, filename);
154 params._result = AGS3::DynamicSprite_CreateFromFile(filename);
155 }
156
CreateFromSaveGame(ScriptMethodParams & params)157 void DynamicSprite::CreateFromSaveGame(ScriptMethodParams ¶ms) {
158 PARAMS3(int, sgslot, int, width, int, height);
159 params._result = AGS3::DynamicSprite_CreateFromSaveGame(sgslot, width, height);
160 }
161
CreateFromScreenShot(ScriptMethodParams & params)162 void DynamicSprite::CreateFromScreenShot(ScriptMethodParams ¶ms) {
163 PARAMS2(int, width, int, height);
164 params._result = AGS3::DynamicSprite_CreateFromScreenShot(width, height);
165 }
166
167 } // namespace Core
168 } // namespace Plugins
169 } // namespace AGS3
170