aboutsummaryrefslogtreecommitdiff
path: root/aocharmovie.cpp
diff options
context:
space:
mode:
authoriamgoofball <iamgoofball@gmail.com>2018-10-17 08:11:52 -0700
committeriamgoofball <iamgoofball@gmail.com>2018-10-17 08:11:52 -0700
commitb56421365ab75173facef74cdaf8d77d51df6d0f (patch)
tree7128f12d08ea716b1c02a62156dce30240f0a28f /aocharmovie.cpp
parentd1347b2243c1595557d7b89d40eb88a68a94375b (diff)
APNG Support
Diffstat (limited to 'aocharmovie.cpp')
-rw-r--r--aocharmovie.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/aocharmovie.cpp b/aocharmovie.cpp
index b591c224..786cab20 100644
--- a/aocharmovie.cpp
+++ b/aocharmovie.cpp
@@ -3,6 +3,8 @@
#include "misc_functions.h"
#include "file_functions.h"
#include "aoapplication.h"
+#include "debug_functions.h"
+#include <string>
AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_parent)
{
@@ -21,11 +23,14 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
{
QString original_path = ao_app->get_character_path(p_char) + emote_prefix + p_emote.toLower() + ".gif";
QString alt_path = ao_app->get_character_path(p_char) + p_emote.toLower() + ".png";
+ QString apng_path = ao_app->get_character_path(p_char) + emote_prefix + p_emote.toLower() + ".apng";
QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif";
QString placeholder_default_path = ao_app->get_default_theme_path() + "placeholder.gif";
QString gif_path;
- if (file_exists(original_path))
+ if (file_exists(apng_path))
+ gif_path = apng_path;
+ else if (file_exists(original_path))
gif_path = original_path;
else if (file_exists(alt_path))
gif_path = alt_path;
@@ -148,6 +153,7 @@ void AOCharMovie::combo_resize(int w, int h)
void AOCharMovie::frame_change(int n_frame)
{
+
if (movie_frames.size() > n_frame)
{
QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame));