diff --git a/lib/master.pike b/lib/master.pike index 0f3b44e397919383c24372538dea8e192cc02331..c5947dee41f6d8cf827bc27e3dd7721bf77d7258 100644 --- a/lib/master.pike +++ b/lib/master.pike @@ -24,6 +24,11 @@ void create() add_constant("mkmultiset",lambda(mixed *a) { return aggregate_multiset(@a); }); add_constant("strlen",sizeof); + add_constant("clone",lambda(program p,mixed ... a) + { return p(@a); } ); + add_constant("new",lambda(program p,mixed ... a) + { return p(@a); } ); + random_seed(time() + (getpid() * 0x11111111)); } @@ -103,7 +108,7 @@ object cast_to_object(string oname) if(ret=objects[oname]) return ret; - return objects[oname]=clone(cast_to_program(oname)); + return objects[oname]=cast_to_program(oname)(); } mapping (string:string) environment=([]); @@ -136,7 +141,7 @@ void _main(string *argv, string *env) add_constant("getenv",getenv); add_constant("putenv",putenv); - add_constant("write",clone(cast_to_program("/precompiled/file"),"stdout")->write); + add_constant("write",cast_to_program("/precompiled/file")("stdout")->write); a=backtrace()[-1][0]; q=a/"/"; diff --git a/src/modules/image/blit.c b/src/modules/image/blit.c index 9d33009f0bd19e5bfa80be78c4a0c49d23ef1060..85201600283d9c430bb56a584881186e9500060f 100644 --- a/src/modules/image/blit.c +++ b/src/modules/image/blit.c @@ -213,7 +213,6 @@ void image_paste(INT32 args) y1=sp[2-args].u.integer; } else x1=y1=0; - pop_n_elems(args-1); x2=x1+img->xsize-1; y2=y1+img->ysize-1; @@ -227,6 +226,10 @@ void image_paste(INT32 args) blitheight, THIS->xsize, img->xsize); + + pop_n_elems(args); + THISOBJ->refs++; + push_object(THISOBJ); } void image_paste_alpha(INT32 args) diff --git a/src/modules/image/doc/image.html b/src/modules/image/doc/image.html index 3de2b77bb3c5b8004168cc23333120398aa9bcfa..a7f513e2210fd25fdf99efafd43dd4c62c70d97a 100644 --- a/src/modules/image/doc/image.html +++ b/src/modules/image/doc/image.html @@ -557,4 +557,10 @@ object image->skewx_expand(int diff,rgb); object image->skewy_expand(int diff,rgb); object image->rotate(int|float angle,rgb); object image->rotate_expand(int|float angle,rgb); +object image->turbulence(colorrange,int octaves=3,float scale=1, + float xdiff=0,float ydiff=0,float cscale=1); +object image->noise(colorrange,float scale=0.1, + float xdiff=0,float ydiff=0,float cscale=1); + where colorrange is ({ float position=0..1, ({r,g,b}), + float position=0..1, ({r,g,b}), ... }) </pre> \ No newline at end of file