# HG changeset patch # User nenolod # Date 1165318804 28800 # Node ID a9f1bd76a3e600047e60d9d9420f9d45b9c92f4e # Parent afc61c0efc05ae6e2393c719e48b22e286b1f04b [svn] - apply_xform(): check for NULL vfield (broken scripts) - add tan(), asin(), acos(), atan(), log() to script engine. diff -r afc61c0efc05 -r a9f1bd76a3e6 ChangeLog --- a/ChangeLog Tue Dec 05 02:16:09 2006 -0800 +++ b/ChangeLog Tue Dec 05 03:40:04 2006 -0800 @@ -1,3 +1,14 @@ +2006-12-05 10:16:09 +0000 William Pitcock + revision [730] + - add Trans / Movement implementation + + trunk/src/paranormal/builtins.c | 2 + trunk/src/paranormal/presets/Makefile | 2 + trunk/src/paranormal/presets/nenolod_-_transform_fun.pnv | 24 +++ + trunk/src/paranormal/xform.c | 119 +++++++++++++++ + 4 files changed, 147 insertions(+) + + 2006-12-05 09:07:41 +0000 Kiyoshi Aman revision [728] Remove old-style is_our_file() where a new-style is_our_fd() exists diff -r afc61c0efc05 -r a9f1bd76a3e6 src/paranormal/libcalc/function.c --- a/src/paranormal/libcalc/function.c Tue Dec 05 02:16:09 2006 -0800 +++ b/src/paranormal/libcalc/function.c Tue Dec 05 03:40:04 2006 -0800 @@ -33,6 +33,10 @@ /* */ +static double f_log (ex_stack *stack) { + return log (pop (stack)); +} + static double f_sin (ex_stack *stack) { return sin (pop (stack)); } @@ -41,6 +45,22 @@ return cos (pop (stack)); } +static double f_tan (ex_stack *stack) { + return tan (pop (stack)); +} + +static double f_asin (ex_stack *stack) { + return asin (pop (stack)); +} + +static double f_acos (ex_stack *stack) { + return acos (pop (stack)); +} + +static double f_atan (ex_stack *stack) { + return atan (pop (stack)); +} + static double f_if (ex_stack *stack) { double a = pop (stack); double b = pop (stack); @@ -58,6 +78,11 @@ static const func_t init[] = { { "sin", f_sin }, { "cos", f_cos }, + { "tan", f_tan }, + { "asin", f_asin }, + { "acos", f_acos }, + { "atan", f_atan }, + { "log", f_log }, { "if", f_if }, { "div", f_div } }; diff -r afc61c0efc05 -r a9f1bd76a3e6 src/paranormal/xform.c --- a/src/paranormal/xform.c Tue Dec 05 02:16:09 2006 -0800 +++ b/src/paranormal/xform.c Tue Dec 05 03:40:04 2006 -0800 @@ -63,6 +63,9 @@ register guchar *destptr; register int color; + if (vfield == NULL) + return; + for (i=0, v=vfield, destptr=pn_image_data->surface[1]; iwidth*pn_image_data->height; i++, v++, destptr++)