summaryrefslogtreecommitdiff
path: root/image/mng.c
diff options
context:
space:
mode:
Diffstat (limited to 'image/mng.c')
-rw-r--r--image/mng.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/image/mng.c b/image/mng.c
index 5498d0528..7d288a3d3 100644
--- a/image/mng.c
+++ b/image/mng.c
@@ -585,6 +585,31 @@ bool nsmng_redraw_tiled(struct content *c, int x, int y,
return ret;
}
+
+bool nsmng_clone(const struct content *old, struct content *new_content)
+{
+ const char *data;
+ unsigned long size;
+
+ /* Simply replay create/process/convert */
+ if (nsmng_create(new_content, NULL) == false)
+ return false;
+
+ data = content__get_source_data(new_content, &size);
+ if (size > 0) {
+ if (nsmng_process_data(new_content, data, size) == false)
+ return false;
+ }
+
+ if (old->status == CONTENT_STATUS_READY ||
+ old->status == CONTENT_STATUS_DONE) {
+ if (nsmng_convert(new_content) == false)
+ return false;
+ }
+
+ return true;
+}
+
/**
* Animates to the next frame
*/