110 lines
6.6 KiB
C++
110 lines
6.6 KiB
C++
/*
|
|
|
|
This will add an outline to these
|
|
CSprite and print them to the cmd
|
|
line. They can be cut/pasted from
|
|
there.
|
|
|
|
LTGREEN is supposed to be transparent.
|
|
To make it transparent, the cut/pasted
|
|
CSprite must be edited with <CTRL-R> and
|
|
converted to transparent bitmaps.
|
|
|
|
*/
|
|
|
|
$SP,"<1>",1$
|
|
|
|
|
|
|
|
$SP,"<2>",2$
|
|
|
|
|
|
|
|
$SP,"<3>",3$
|
|
|
|
|
|
|
|
$SP,"<4>",4$
|
|
|
|
|
|
|
|
$SP,"<5>",5$
|
|
|
|
|
|
|
|
$SP,"<6>",6$
|
|
|
|
|
|
|
|
|
|
$SP,"<7>",7$
|
|
|
|
|
|
|
|
$SP,"<8>",8$
|
|
|
|
|
|
|
|
$SP,"<9>",9$
|
|
|
|
|
|
|
|
$SP,"<10>",10$
|
|
|
|
|
|
|
|
$SP,"<11>",11$
|
|
|
|
|
|
|
|
$SP,"<12>",12$
|
|
|
|
|
|
|
|
|
|
#define NUM 12
|
|
|
|
U8 *in_img[NUM]=
|
|
{$IB,"<1>",1$,$IB,"<2>",2$,$IB,"<3>",3$,$IB,"<4>",4$,$IB,"<5>",5$,$IB,"<6>",6$,
|
|
$IB,"<7>",7$,$IB,"<8>",8$,$IB,"<9>",9$,$IB,"<10>",10$,$IB,"<11>",11$,$IB,"<12>",12$};
|
|
|
|
U0 OutLine()
|
|
{
|
|
I64 n,minx,maxx,miny,maxy,w,h,i,j,k,c;
|
|
U8 *out_img;
|
|
CDC *dc;
|
|
for (n=0;n<NUM;n++) {
|
|
CSpriteExtents(in_img[n],&minx,&maxx,&miny,&maxy);
|
|
w=maxx-minx+1+2;
|
|
h=maxy-miny+1+2;
|
|
dc=DCNew(DCT_COLOR8,w,h);
|
|
dc->color=LTGREEN;
|
|
GrRect(dc,0,0,w,h);
|
|
CSpritePlot3(dc,-minx+1,-miny+1,0,in_img[n]);
|
|
|
|
for (i=0;i<h;i++)
|
|
for (j=0;j<w;j++)
|
|
if (GrPeek(dc,j,i)==LTGREEN) {
|
|
for (k=0;k<8;k++) {
|
|
c=GrPeek(dc,j+gr_x_offsets[k],i+gr_y_offsets[k]);
|
|
if (c!=-1 && c!=BLACK && c!=LTGREEN) {
|
|
dc->color=BLACK;
|
|
GrPlot(dc,j,i);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
out_img=DC2Sprite(dc);
|
|
NewLine;
|
|
PutSprite(out_img);
|
|
NewLine(4);
|
|
|
|
DCDel(dc);
|
|
Free(out_img);
|
|
}
|
|
}
|
|
|
|
OutLine;
|
|
|