From 3bcf01bb21c60c05d52bf53828bf8361b3234a2b Mon Sep 17 00:00:00 2001 From: in1tiate Date: Fri, 13 Aug 2021 03:23:12 -0500 Subject: asynchronously load animations for bigly performant gainz --- include/aolayer.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aolayer.h b/include/aolayer.h index ffbd6dac..b8907152 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -8,6 +8,8 @@ #include #include #include +#include +#include class AOApplication; class VPath; @@ -140,11 +142,17 @@ protected: // Center the QLabel in the viewport based on the dimensions of f_pixmap void center_pixmap(QPixmap f_pixmap); - // Populates the frame and delay vectors with the next frame's data. +private: + // Populates the frame and delay vectors. + void populate_vectors(); + + // used in populate_vectors void load_next_frame(); + bool exit_loop; //awful solution but i'm not fucking using QThread + QFuture frame_loader; + QMutex mutex; + QWaitCondition frameAdded; - // used in load_next_frame - QFuture future; signals: void done(); @@ -243,4 +251,5 @@ public: StickerLayer(QWidget *p_parent, AOApplication *p_ao_app); void load_image(QString p_charname); }; + #endif // AOLAYER_H -- cgit