@@ -111,7 +111,6 @@ void DynamicSprite_Resize(ScriptDynamicSprite *sds, int width, int height) {
111
111
RectWH (0 , 0 , width, height));
112
112
113
113
add_dynamic_sprite (sds->slot , std::move (new_pic), (game.SpriteInfos [sds->slot ].Flags & SPF_ALPHACHANNEL) != 0 );
114
- game_sprite_updated (sds->slot );
115
114
}
116
115
117
116
void DynamicSprite_Flip (ScriptDynamicSprite *sds, int direction) {
@@ -129,7 +128,6 @@ void DynamicSprite_Flip(ScriptDynamicSprite *sds, int direction) {
129
128
new_pic->FlipBlt (sprite, 0 , 0 , static_cast <GraphicFlip>(direction));
130
129
131
130
add_dynamic_sprite (sds->slot , std::move (new_pic), (game.SpriteInfos [sds->slot ].Flags & SPF_ALPHACHANNEL) != 0 );
132
- game_sprite_updated (sds->slot );
133
131
}
134
132
135
133
void DynamicSprite_CopyTransparencyMask (ScriptDynamicSprite *sds, int sourceSprite) {
@@ -160,7 +158,6 @@ void DynamicSprite_CopyTransparencyMask(ScriptDynamicSprite *sds, int sourceSpri
160
158
}
161
159
162
160
BitmapHelper::CopyTransparency (target, source, dst_has_alpha, src_has_alpha);
163
- game_sprite_updated (sds->slot );
164
161
}
165
162
166
163
void DynamicSprite_ChangeCanvasSize (ScriptDynamicSprite *sds, int width, int height, int x, int y)
@@ -179,7 +176,6 @@ void DynamicSprite_ChangeCanvasSize(ScriptDynamicSprite *sds, int width, int hei
179
176
new_pic->Blit (sprite, 0 , 0 , x, y, sprite->GetWidth (), sprite->GetHeight ());
180
177
181
178
add_dynamic_sprite (sds->slot , std::move (new_pic), (game.SpriteInfos [sds->slot ].Flags & SPF_ALPHACHANNEL) != 0 );
182
- game_sprite_updated (sds->slot );
183
179
}
184
180
185
181
void DynamicSprite_Crop (ScriptDynamicSprite *sds, int x1, int y1, int width, int height) {
@@ -200,7 +196,6 @@ void DynamicSprite_Crop(ScriptDynamicSprite *sds, int x1, int y1, int width, int
200
196
201
197
// replace the bitmap in the sprite set
202
198
add_dynamic_sprite (sds->slot , std::move (new_pic), (game.SpriteInfos [sds->slot ].Flags & SPF_ALPHACHANNEL) != 0 );
203
- game_sprite_updated (sds->slot );
204
199
}
205
200
206
201
void DynamicSprite_Rotate (ScriptDynamicSprite *sds, int angle, int width, int height) {
@@ -231,7 +226,6 @@ void DynamicSprite_Rotate(ScriptDynamicSprite *sds, int angle, int width, int he
231
226
232
227
// replace the bitmap in the sprite set
233
228
add_dynamic_sprite (sds->slot , std::move (new_pic), (game.SpriteInfos [sds->slot ].Flags & SPF_ALPHACHANNEL) != 0 );
234
- game_sprite_updated (sds->slot );
235
229
}
236
230
237
231
void DynamicSprite_Tint (ScriptDynamicSprite *sds, int red, int green, int blue, int saturation, int luminance)
@@ -243,7 +237,6 @@ void DynamicSprite_Tint(ScriptDynamicSprite *sds, int red, int green, int blue,
243
237
tint_image (new_pic.get (), source, red, green, blue, saturation, (luminance * 25 ) / 10 );
244
238
245
239
add_dynamic_sprite (sds->slot , std::move (new_pic), (game.SpriteInfos [sds->slot ].Flags & SPF_ALPHACHANNEL) != 0 );
246
- game_sprite_updated (sds->slot );
247
240
}
248
241
249
242
int DynamicSprite_SaveToFile (ScriptDynamicSprite *sds, const char * namm)
@@ -451,6 +444,11 @@ int add_dynamic_sprite(int slot, std::unique_ptr<Bitmap> image, bool has_alpha,
451
444
uint32_t flags = SPF_DYNAMICALLOC | (SPF_ALPHACHANNEL * has_alpha) | extra_flags;
452
445
if (!spriteset.SetSprite (slot, std::move (image), flags))
453
446
return 0 ; // failed to add the sprite, bad image or realloc failed
447
+
448
+ // Notify a new (normal) dynamic sprite in case some objects
449
+ // have this number assigned to their Graphic property
450
+ if ((extra_flags & SPF_OBJECTOWNED) == 0 )
451
+ game_sprite_updated (slot);
454
452
return slot;
455
453
}
456
454
0 commit comments