changeset 272:d8cefe8ce6e6 trunk

[svn] - add copy surface
author nenolod
date Sun, 19 Nov 2006 11:27:16 -0800
parents b166ce84af57
children fac0b72ee0de
files ChangeLog src/paranormal/builtins.c src/paranormal/general.c
diffstat 3 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 19 11:20:18 2006 -0800
+++ b/ChangeLog	Sun Nov 19 11:27:16 2006 -0800
@@ -1,3 +1,13 @@
+2006-11-19 19:20:18 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [570]
+  - add swap surface
+  
+  trunk/src/paranormal/TODO       |    1 -
+  trunk/src/paranormal/builtins.c |    2 ++
+  trunk/src/paranormal/general.c  |   14 ++++++++++++++
+  3 files changed, 16 insertions(+), 1 deletion(-)
+
+
 2006-11-19 18:34:45 +0000  William Pitcock <nenolod@nenolod.net>
   revision [568]
   - by constant request, add a TODO.
--- a/src/paranormal/builtins.c	Sun Nov 19 11:20:18 2006 -0800
+++ b/src/paranormal/builtins.c	Sun Nov 19 11:27:16 2006 -0800
@@ -31,6 +31,7 @@
 DECLARE_ACTUATOR (general_invert);
 DECLARE_ACTUATOR (general_replace);
 DECLARE_ACTUATOR (general_swap);
+DECLARE_ACTUATOR (general_copy);
 
 /* **************** misc **************** */
 DECLARE_ACTUATOR (misc_floater);
@@ -71,6 +72,7 @@
   &builtin_general_invert,
   &builtin_general_replace,
   &builtin_general_swap,
+  &builtin_general_copy,
   /* **************** misc **************** */
   &builtin_misc_floater,
   /* **************** wave **************** */
--- a/src/paranormal/general.c	Sun Nov 19 11:20:18 2006 -0800
+++ b/src/paranormal/general.c	Sun Nov 19 11:27:16 2006 -0800
@@ -250,3 +250,19 @@
   0, NULL,
   NULL, NULL, general_swap_exec
 };
+
+/* **************** general_copy **************** */
+static void
+general_copy_exec (const struct pn_actuator_option *opts,
+	   gpointer data)
+{
+  memcpy(pn_image_data->surface[1], pn_image_data->surface[0], 
+         (pn_image_data->width * pn_image_data->height));
+}
+
+struct pn_actuator_desc builtin_general_copy =
+{
+  "general_copy", "Copy Surface", "Copies the surface to the other surface.",
+  0, NULL,
+  NULL, NULL, general_copy_exec
+};