aboutsummaryrefslogtreecommitdiff
path: root/src/source.h
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-01-20 21:20:59 +0000
committerHarry Jeffery <harry@exec64.co.uk>2019-01-29 22:25:05 +0000
commit090a0ceb7c2d5135b7286405d8bad5092d8387bb (patch)
treeddccddb1aeaecae11a53a00d223eabf5f852da8d /src/source.h
parentf4305c11aa617e4151385af13bd9e7f7e7ceafb0 (diff)
downloadimv-090a0ceb7c2d5135b7286405d8bad5092d8387bb.tar.gz
imv_source: Handle gifs
Diffstat (limited to 'src/source.h')
-rw-r--r--src/source.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/source.h b/src/source.h
index 80b1e81..2f6b44d 100644
--- a/src/source.h
+++ b/src/source.h
@@ -14,6 +14,9 @@ struct imv_source_message {
/* Receiver is responsible for destroying bitmap */
struct imv_bitmap *bitmap;
+ /* If an animated gif, the frame's duration in milliseconds, else 0 */
+ int frametime;
+
/* Error message if bitmap was NULL */
const char *error;
};
@@ -30,6 +33,9 @@ struct imv_source {
/* Usually 1, more if animated */
int num_frames;
+ /* Next frame to be loaded, 0-indexed */
+ int next_frame;
+
/* Frames are returned using SDL events. These two fields must be
* populated by callers before calling any frame loading functionality
* on the source.
@@ -43,13 +49,6 @@ struct imv_source {
/* Trigger loading of next frame. */
void (*load_next_frame)(struct imv_source *src);
- /* Notify source of time passing, automatically triggers loading of
- * the next frame when due. */
- void (*time_passed)(struct imv_source *src, double dt);
-
- /* Asks the source how long we can sleep for before the next frame is due */
- double (*time_left)(struct imv_source *src);
-
/* Safely free contents of this source. After this returns
* it is safe to dealocate/overwrite the imv_source instance.
*/