Branch: Tag:

1999-05-24

1999-05-24 12:22:51 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

new getrgb function call bugfixes in change_color and paste_alpha_color
(s/MAXIMUM/MINIMUM/ in code to skip wrongly assumed alpha channel)

Rev: src/modules/Image/blit.c:1.33
Rev: src/modules/Image/image.c:1.137

1: - /* $Id: blit.c,v 1.32 1999/05/20 17:34:34 mirar Exp $ */ + /* $Id: blit.c,v 1.33 1999/05/24 12:22:51 mirar Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.32 1999/05/20 17:34:34 mirar Exp $ + **! $Id: blit.c,v 1.33 1999/05/24 12:22:51 mirar Exp $   **! class Image   */   
97:    img->rgb.r=(unsigned char)sp[-args+args_start].u.integer;    img->rgb.g=(unsigned char)sp[1-args+args_start].u.integer;    img->rgb.b=(unsigned char)sp[2-args+args_start].u.integer; +  + fprintf(stderr,"args=%d args_start=%d diff=%d\n", +  args,args_start,args-args_start);    if (args-args_start>=4)    if (sp[3-args+args_start].type!=T_INT)    error("Illegal alpha argument to %s\n",name);
562:    if (!mask->img) return;       if (args==6 || args==4 || args==2 || args==3) /* color at arg 2.. */ -  arg=1+getrgb(THIS,1,args,"image->paste_alpha_color()\n"); +  arg=1+getrgb(THIS,1,MINIMUM(args,4),"image->paste_alpha_color()\n");    if (args>arg+1)    {    if (sp[arg-args].type!=T_INT -  || sp[arg-args].type!=T_INT) +  || sp[1+arg-args].type!=T_INT)    error("illegal coordinate arguments to image->paste_alpha_color()\n");    x1=sp[arg-args].u.integer; -  y1=sp[arg-args].u.integer; +  y1=sp[1+arg-args].u.integer;    }    else x1=y1=0;