# HG changeset patch # User nenolod # Date 1163964436 28800 # Node ID d8cefe8ce6e6c66f92efdda7dd1555fa5d564952 # Parent b166ce84af57ba2f466a070fde8458a959315f3f [svn] - add copy surface diff -r b166ce84af57 -r d8cefe8ce6e6 ChangeLog --- 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 + 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 revision [568] - by constant request, add a TODO. diff -r b166ce84af57 -r d8cefe8ce6e6 src/paranormal/builtins.c --- 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 **************** */ diff -r b166ce84af57 -r d8cefe8ce6e6 src/paranormal/general.c --- 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 +};