Subversion Repositories wimsdev

Rev

Rev 7675 | Rev 8068 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7675 Rev 8010
Line 14... Line 14...
14
 *  along with this program; if not, write to the Free Software
14
 *  along with this program; if not, write to the Free Software
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
 */
16
 */
17
 
17
 
18
#include <errno.h>
18
#include <errno.h>
-
 
19
/* bug in gdImageFillToBorder */
-
 
20
void gdImageFillToBorder1 (gdImagePtr im, int x, int y, int border, int color)
-
 
21
{
-
 
22
   int pp=x;
-
 
23
   if(pp>=image->sx) pp=image->sx-1;
-
 
24
   if(pp<0) pp=0;
-
 
25
   gdImageFillToBorder(im,pp,y,border,color);
-
 
26
}
19
 
27
 
20
/* File opening: with security */
28
/* File opening: with security */
21
FILE *open4read(char *n)
29
FILE *open4read(char *n)
22
{
30
{
23
    char *p, *p1, *p2, namebuf[2048];
31
    char *p, *p1, *p2, namebuf[2048];
Line 362... Line 370...
362
    scale(pm->pd,pm->p,1);
370
    scale(pm->pd,pm->p,1);
363
    pm->p[2]=rint(pm->pd[2]*xscale); pm->p[3]=rint(pm->pd[3]*yscale);
371
    pm->p[2]=rint(pm->pd[2]*xscale); pm->p[3]=rint(pm->pd[3]*yscale);
364
    if(pm->fill) {
372
    if(pm->fill) {
365
      gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,
373
      gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,
366
               color_bounder);
374
               color_bounder);
367
      gdImageFillToBorder(image,pm->p[0],pm->p[1],
375
      gdImageFillToBorder1(image,pm->p[0],pm->p[1],
368
                      color_bounder,pm->color[0]);
376
                      color_bounder,pm->color[0]);
369
    }
377
    }
370
    gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]);
378
    gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]);
371
    if(vimg_enable) vimg_ellipse(scale_buf[0],scale_buf[1],0.5*pm->pd[2],0.5*pm->pd[3]);
379
    if(vimg_enable) vimg_ellipse(scale_buf[0],scale_buf[1],0.5*pm->pd[2],0.5*pm->pd[3]);
372
}
380
}
Line 377... Line 385...
377
    scale(pm->pd,pm->p,1);
385
    scale(pm->pd,pm->p,1);
378
    pm->p[2]=rint(pm->pd[2]); pm->p[3]=rint(pm->pd[2]);
386
    pm->p[2]=rint(pm->pd[2]); pm->p[3]=rint(pm->pd[2]);
379
    if(pm->fill) {
387
    if(pm->fill) {
380
      gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,
388
      gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,
381
               color_bounder);
389
               color_bounder);
382
      gdImageFillToBorder(image,pm->p[0],pm->p[1],
390
      gdImageFillToBorder1(image,pm->p[0],pm->p[1],
383
                      color_bounder,pm->color[0]);
391
                      color_bounder,pm->color[0]);
384
    }
392
    }
385
    gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]);
393
    gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]);
386
}
394
}
387
 
395
 
Line 394... Line 402...
394
 
402
 
395
/* flood fill to border*/
403
/* flood fill to border*/
396
void obj_fillb(objparm *pm)
404
void obj_fillb(objparm *pm)
397
{
405
{
398
    scale(pm->pd,pm->p,1);
406
    scale(pm->pd,pm->p,1);
399
    gdImageFillToBorder(image,pm->p[0],pm->p[1],pm->color[0],pm->color[1]);
407
    gdImageFillToBorder1(image,pm->p[0],pm->p[1],pm->color[0],pm->color[1]);
400
}
408
}
401
 
409
 
402
gdImagePtr himg;
410
gdImagePtr himg;
403
 
411
 
404
int makehatchimage(int x, int y, int px, int py, int col)
412
int makehatchimage(int x, int y, int px, int py, int col)