@@ -146,6 +146,7 @@ void BackgroundLayer::load_image(QString p_filename)
146146 qDebug () << " [BackgroundLayer] BG loaded: " << p_filename;
147147#endif
148148 start_playback (ao_app->get_image_suffix (ao_app->get_background_path (p_filename)));
149+ play ();
149150}
150151
151152void CharLayer::load_image (QString p_filename, QString p_charname,
@@ -189,7 +190,7 @@ void CharLayer::load_image(QString p_filename, QString p_charname,
189190 }
190191 is_preanim = true ;
191192 play_once = true ;
192- preanim_timer->start (duration * tick_ms );
193+ preanim_timer->start (duration);
193194 }
194195#ifdef DEBUG_MOVIE
195196 qDebug () << " [CharLayer] anim loaded: prefix " << prefix << " filename "
@@ -211,6 +212,7 @@ void CharLayer::load_image(QString p_filename, QString p_charname,
211212 ao_app->get_theme_path (
212213 " placeholder" , ao_app->default_theme )}; // Default theme placeholder path
213214 start_playback (ao_app->get_image_path (pathlist));
215+ play ();
214216}
215217
216218void SplashLayer::load_image (QString p_filename, QString p_charname,
@@ -219,6 +221,7 @@ void SplashLayer::load_image(QString p_filename, QString p_charname,
219221 transform_mode = ao_app->get_misc_scaling (p_miscname);
220222 QString final_image = ao_app->get_image (p_filename, ao_app->current_theme , ao_app->get_subtheme (), ao_app->default_theme , p_miscname, p_charname, " placeholder" );
221223 start_playback (final_image);
224+ play ();
222225}
223226
224227void EffectLayer::load_image (QString p_filename, bool p_looping)
@@ -230,13 +233,16 @@ void EffectLayer::load_image(QString p_filename, bool p_looping)
230233 continuous = false ;
231234 force_continuous = true ;
232235 start_playback (p_filename); // handled in its own file before we see it
236+ play ();
233237}
234238
235239void InterfaceLayer::load_image (QString p_filename, QString p_miscname)
236240{
241+ last_path = " " ;
237242 stretch = true ;
238243 QString final_image = ao_app->get_image (p_filename, ao_app->current_theme , ao_app->get_subtheme (), ao_app->default_theme , p_miscname);
239244 start_playback (final_image);
245+ play ();
240246}
241247
242248void StickerLayer::load_image (QString p_charname)
@@ -247,6 +253,7 @@ void StickerLayer::load_image(QString p_charname)
247253 transform_mode = ao_app->get_misc_scaling (p_miscname);
248254 QString final_image = ao_app->get_image (" sticker/" + p_charname, ao_app->current_theme , ao_app->get_subtheme (), ao_app->default_theme , p_miscname);
249255 start_playback (final_image);
256+ play ();
250257}
251258
252259void CharLayer::start_playback (QString p_image)
@@ -257,6 +264,7 @@ void CharLayer::start_playback(QString p_image)
257264 load_network_effects ();
258265 else // Use default ini FX
259266 load_effects ();
267+ play ();
260268}
261269
262270void AOLayer::start_playback (QString p_image)
@@ -275,7 +283,7 @@ void AOLayer::start_playback(QString p_image)
275283 actual_time.restart ();
276284#endif
277285 this ->clear ();
278- freeze ();
286+ this -> freeze ();
279287 movie_frames.clear ();
280288 movie_delays.clear ();
281289 QString scaling_override =
@@ -329,14 +337,12 @@ void AOLayer::start_playback(QString p_image)
329337 }
330338 else if (max_frames <= 1 ) {
331339 duration = static_duration;
332- play_once = false ;
333340#ifdef DEBUG_MOVIE
334341 qDebug () << " max_frames is <= 1, using static duration" ;
335342#endif
336343 }
337344 if (duration > 0 && cull_image == true )
338345 shfx_timer->start (duration);
339- play ();
340346#ifdef DEBUG_MOVIE
341347 qDebug () << max_frames << " Setting image to " << image_path
342348 << " Time taken to process image:" << actual_time.elapsed ();
@@ -347,15 +353,25 @@ void AOLayer::start_playback(QString p_image)
347353
348354void CharLayer::play ()
349355{
356+ if (max_frames <= 1 ) {
357+ if (play_once) {
358+ preanim_timer->start (qMax (0 , duration));
359+ }
360+ return ;
361+ }
350362 play_frame_effect (frame);
351363 AOLayer::play ();
352364}
353365
354366void AOLayer::play ()
355367{
356368 if (max_frames <= 1 ) {
357- if (play_once)
358- ticker->start (tick_ms);
369+ if (play_once) {
370+ if (duration > 0 )
371+ ticker->start (duration);
372+ else
373+ preanim_done ();
374+ }
359375 else
360376 this ->freeze ();
361377 }
0 commit comments