Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - constant cvs_version="$Id: graphic_text.pike,v 1.139 1998/08/02 03:13:06 peter Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.140 1998/08/10 05:09:09 js Exp $";   constant thread_safe=1;      #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
Roxen.git/server/modules/graphics/graphic_text.pike:399:    for(int y=0; y<ysize; y+=foreground->ysize())    if(y%2)    b2->paste(foreground->mirrory(), x, y);    else    b2->paste(foreground, x, y);    foreground = foreground->mirrorx();    }    foreground = b2;    }    } +  int background_is_color; +  if(args->background && +  ((background = load_image(args->background, id)) || +  (sizeof(args->background)>1 && +  (background=Image.image(xsize,ysize, @(parse_color(args->background[1..])))) +  && (background_is_color=1)))) +  { +  object alpha; +  if(args->alpha && (alpha = load_image(args->alpha,id)) && background_is_color) +  { +  xsize=MAX(xsize,alpha->xsize()); +  ysize=MAX(ysize,alpha->ysize()); +  background=Image.image(xsize,ysize, @(parse_color(args->background[1..]))); +  }    -  if((args->background) && (background = load_image(args->background, id))) { -  background = background; +     if((float)args->scale >= 0.1)    background = background->scale(1.0/(float)args->scale);       if(args->tile)    {    object b2 = Image.image(xsize,ysize);    for(int x=0; x<xsize; x+=background->xsize())    for(int y=0; y<ysize; y+=background->ysize())    b2->paste(background, x, y);    background = b2;
Roxen.git/server/modules/graphics/graphic_text.pike:432:    {    for(int y=0; y<ysize; y+=background->ysize())    if(y%2)    b2->paste(background->mirrory(), x, y);    else    b2->paste(background, x, y);    background = background->mirrorx();    }    background = b2;    } +  xsize = MAX(xsize,background->xsize()); +  ysize = MAX(ysize,background->ysize()); +  werror("x: %O, y: %O\n",xsize,ysize);    -  xsize = background->xsize(); -  ysize = background->ysize(); +  if(alpha) +  background->paste_alpha_color(alpha->invert(),@bgcolor); +     switch(lower_case(args->talign||"left")) {    case "center":    xoffset = (xsize/2 - txsize/2);    yoffset = (ysize/2 - tysize/2);    break;    case "right":    xoffset = (xsize - txsize);    break;    case "left":    }
Roxen.git/server/modules/graphics/graphic_text.pike:621:    {    string c;    if(sscanf(args->rotate, "%*d,%s", c)==2)    background->setcolor(@parse_color(c));    else    background->setcolor(@bgcolor);    background = background->rotate((float)args->rotate);    }       if(args->crop) background = background->autocrop(); -  +     return background;   }      string base_key;   object mc;         array to_clean = ({});   void clean_cache_dir()   {
Roxen.git/server/modules/graphics/graphic_text.pike:1219:    if(arg->background)    arg->background = fix_relative(arg->background,id);    if(arg->texture)    arg->texture = fix_relative(arg->texture,id);    if(arg->magic_texture)    arg->magic_texture=fix_relative(arg->magic_texture,id);    if(arg->magic_background)    arg->magic_background=fix_relative(arg->magic_background,id);    if(arg->magicbg)    arg->magicbg = fix_relative(arg->magicbg,id); +  if(arg->alpha) +  arg->alpha = fix_relative(arg->alpha,id);    -  +     string gif="";    if(query("gif")) gif=".gif";      #if efun(_static_modules)    contents = parse_rxml(contents, id, foo, defines);   #else    contents = parse_rxml(contents, id, foo);   #endif       string lp, url, ea;