Nightly update (ISO SHA-1 54758c6)
This commit is contained in:
1 parent
4f77433555
commit
f9fe277d40
59 files changed
+212
-200
No files matched your search
@@ -30,9 +30,9 @@ public class CSpriteDitherColor : CSpriteBase
|
||||
U16 dither_color;
|
||||
};
|
||||
|
||||
public class CSpriteW : CSpriteBase
|
||||
public class CSpriteT : CSpriteBase
|
||||
{
|
||||
I32 width;
|
||||
I32 thick;
|
||||
};
|
||||
|
||||
public class CSpritePt : CSpriteBase
|
||||
@@ -120,7 +120,7 @@ public class CSpritePtMeshU8s : CSpriteBase
|
||||
#define SPT_END 0 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
|
||||
#define SPT_COLOR 1 //$LK,"CSpriteColor",A="MN:CSpriteColor"$
|
||||
#define SPT_DITHER_COLOR 2 //$LK,"CSpriteDitherColor",A="MN:CSpriteDitherColor"$
|
||||
#define SPT_WIDTH 3 //$LK,"CSpriteW",A="MN:CSpriteW"$
|
||||
#define SPT_THICK 3 //$LK,"CSpriteT",A="MN:CSpriteT"$
|
||||
#define SPT_PLANAR_SYMMETRY 4 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$
|
||||
#define SPT_TRANSFORM_ON 5 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
|
||||
#define SPT_TRANSFORM_OFF 6 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
|
||||
@@ -163,7 +163,7 @@ public class CSprite
|
||||
CSpriteBase b;
|
||||
CSpriteColor c;
|
||||
CSpriteDitherColor d;
|
||||
CSpriteW w;
|
||||
CSpriteT t;
|
||||
CSpritePt p;
|
||||
CSpritePtPt pp;
|
||||
CSpritePtPtAng ppa;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Option(OPTf_WARN_HEADER_MISMATCH,OFF);
|
||||
public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
{//2D. No clipping or transformation or pen width.
|
||||
{//2D. No clipping or transformation or thick.
|
||||
U8 *dst;
|
||||
I32 *db;
|
||||
I64 d,dist;
|
||||
@@ -1662,7 +1662,7 @@ gr_done:
|
||||
}
|
||||
|
||||
public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
{//3D. No transformation or pen width.
|
||||
{//3D. No transformation or thick.
|
||||
//Returns cnt of pixs changed
|
||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
||||
I64 dist,dx,dz,z,res=0,i,j,d;
|
||||
@@ -1831,7 +1831,7 @@ gr_done:
|
||||
}
|
||||
|
||||
public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
{//3D. No transformation or pen width.
|
||||
{//3D. No transformation or thick.
|
||||
//Returns cnt of pixs changed
|
||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
||||
I64 dist,dy,dz,z,res=0,i,j,d;
|
||||
|
||||
@@ -92,7 +92,7 @@ public I64 GrRect3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,I64 w,I64 h)
|
||||
|
||||
public U0 GrBorder(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
I64 step=1,I64 start=0)
|
||||
{//2D. Transformation with pen width.
|
||||
{//2D. Transformation with thick.
|
||||
//Can be used with ROPF_DITHER+WHITE<<16+BLACK for dotted rect.
|
||||
GrLine3(dc,x1,y1,0,x2,y1,0,step,start);
|
||||
GrLine3(dc,x2,y1,0,x2,y2,0,step,start);
|
||||
@@ -102,7 +102,7 @@ public U0 GrBorder(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
|
||||
public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
|
||||
I64 x2,I64 y2,I64 z2,F64 w=2.75,I64 step=1,I64 start=0)
|
||||
{//3D. Transformation with pen width.
|
||||
{//3D. Transformation with thick.
|
||||
I64 _x1,_y1,_z1,_x2,_y2,_z2,dx,dy;
|
||||
F64 d;
|
||||
Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE;
|
||||
@@ -121,7 +121,7 @@ public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
|
||||
res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start);
|
||||
dx=_x2-_x1; dy=_y2-_y1;
|
||||
if (d=Sqrt(dx*dx+dy*dy)) {
|
||||
d=w*dc->pen_width/d;
|
||||
d=w*dc->thick/d;
|
||||
res|=Line(dc,_x2-dx*d+dy*d+0.5,_y2-dy*d-dx*d+0.5,_z2,
|
||||
_x2,_y2,_z2,&GrPlot3,step);
|
||||
res|=Line(dc,_x2-dx*d-dy*d+0.5,_y2-dy*d+dx*d+0.5,_z2,
|
||||
@@ -134,7 +134,7 @@ public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
|
||||
res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start);
|
||||
dx=x2-x1; dy=y2-y1;
|
||||
if (d=Sqrt(dx*dx+dy*dy)) {
|
||||
d=w*dc->pen_width/d;
|
||||
d=w*dc->thick/d;
|
||||
res|=Line(dc,x2-dx*d+dy*d+0.5,y2-dy*d-dx*d+0.5,z2,
|
||||
x2,y2,z2,&GrPlot3,step);
|
||||
res|=Line(dc,x2-dx*d-dy*d+0.5,y2-dy*d+dx*d+0.5,z2,
|
||||
@@ -299,7 +299,7 @@ public U0 DrawStdMs(CDC *dc,I64 x,I64 y)
|
||||
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
//Called by $LK,"DrawMs",A="MN:DrawMs"$() which is
|
||||
//called by $LK,"WinFinalUpdate",A="MN:WinFinalUpdate"$().
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
|
||||
GrArrow3(dc,x+8,y+8,0,x,y,0);
|
||||
}
|
||||
@@ -308,16 +308,16 @@ gr.fp_draw_ms=&DrawStdMs;
|
||||
|
||||
public U0 DrawWaitMs(CDC *dc,I64 x,I64 y)
|
||||
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
I64 old_pen_width=dc->pen_width;
|
||||
I64 old_pen_width=dc->thick;
|
||||
CColorROPU32 old_color=dc->color;
|
||||
dc->pen_width=3;
|
||||
dc->thick=3;
|
||||
dc->color=LTRED;
|
||||
GrCircle3(dc,x,y,0,7);
|
||||
GrLine3(dc,x-6,y+6,0,x+6,y-6,0);
|
||||
dc->color=RED;
|
||||
GrCircle(dc,x,y,7);
|
||||
GrLine(dc,x-6,y+6,x+6,y-6);
|
||||
dc->pen_width=old_pen_width;
|
||||
dc->thick=old_pen_width;
|
||||
dc->color=old_color;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public I64 Mat4x4NormSqr65536(I64 *r)
|
||||
|
||||
public U0 DCMat4x4Set(CDC *dc=NULL,I64 *r)
|
||||
{//Set device context's rot matrix. Will be $LK,"Free",A="MN:Free"$d() in $LK,"DCDel",A="MN:DCDel"$().Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
||||
//The main purpose is to set matrix norm for pen width scaling.
|
||||
//The main purpose is to set matrix norm for thick scaling.
|
||||
//NULL as dc means gr.dc
|
||||
if (!dc) dc=gr.dc;
|
||||
dc->r=r;
|
||||
@@ -95,7 +95,7 @@ public U0 DCLighting(CDC *dc,
|
||||
//TempleOS will generate a random U16
|
||||
//and compare to dither_probability_u16 and
|
||||
//will pick from two colors.
|
||||
//Probability dithering does not work with pen_width>1 at this time.
|
||||
//Probability dithering does not work with thick>1 at this time.
|
||||
if (color.c0.rop&ROPBF_TWO_SIDED) {
|
||||
color.c0.rop&=~ROPBF_TWO_SIDED;
|
||||
i=AbsI64(i)<<1;
|
||||
@@ -137,7 +137,7 @@ public U0 DCRst(CDC *dc)
|
||||
dc->color2=BLACK;
|
||||
dc->bkcolor=BLACK;
|
||||
dc->collision_cnt=0;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
dc->ls.x=37837; //1<<16/Sqrt(3)
|
||||
dc->ls.y=37837;
|
||||
dc->ls.z=37837;
|
||||
@@ -365,7 +365,7 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
|
||||
MemCpy(res->body,ptr,body_size);
|
||||
ptr+=body_size;
|
||||
}
|
||||
res->pen_width=1;
|
||||
res->thick=1;
|
||||
res->r=Mat4x4IdentNew(task);
|
||||
res->r_norm.u32[1]=1;
|
||||
res->dc_signature=DCS_SIGNATURE_VAL;
|
||||
|
||||
@@ -4,5 +4,5 @@ extern I64 GrBlot3(CDC *dc,I64 x1,I64 y1,I64 z1,CDC *img);
|
||||
extern I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL);
|
||||
extern U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL);
|
||||
extern CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_thick=NULL,
|
||||
I64 *_xx=NULL,I64 *_yy=NULL);
|
||||
@@ -4,7 +4,7 @@ U0 GrInit1()
|
||||
{
|
||||
DefineLstLoad("ST_SPRITE_ELEM_TYPES",
|
||||
"End\0Color\0Dither Color\0"
|
||||
"Width\0Planar Symmetry\0Transform On\0Transform Off\0Shift\0"
|
||||
"Thick\0Planar Symmetry\0Transform On\0Transform Off\0Shift\0"
|
||||
"Point\0PolyPoint\0Line\0PolyLine\0Rect\0Rotated Rect\0"
|
||||
"Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2 Closed\0"
|
||||
"BSpline3\0BSpline3 Closed\0"
|
||||
@@ -12,7 +12,7 @@ U0 GrInit1()
|
||||
"Arrow\0Text\0Text Box\0Text Diamond\0");
|
||||
DefineLstLoad("ST_SPRITE_ELEM_CODES",
|
||||
"End\0Color\0Color\0"
|
||||
"Width\0PlanarSymmetry\0Transform\0Transform\0Shift\0"
|
||||
"Thick\0PlanarSymmetry\0Transform\0Transform\0Shift\0"
|
||||
"Pt\0PolyPt\0Line\0PolyLine\0Rect\0Rect\0"
|
||||
"Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2\0BSpline3\0BSpline3\0"
|
||||
"FloodFill\0FloodFill\0BitMap\0Mesh\0Mesh\0"
|
||||
|
||||
@@ -160,15 +160,15 @@ public I64 *Mat4x4Scale(I64 *m,F64 s)
|
||||
return m;
|
||||
}
|
||||
|
||||
public U0 DCPenWidthScale(CDC *dc=gr.dc)
|
||||
{//Scale device context's pen width by norm of transformation.
|
||||
public U0 DCThickScale(CDC *dc=gr.dc)
|
||||
{//Scale device context's thick by norm of transformation.
|
||||
I64 d;
|
||||
if (dc->flags&DCF_TRANSFORMATION) {
|
||||
if (dc->pen_width) {
|
||||
d=dc->pen_width*dc->r_norm+0x80000000; //Round
|
||||
dc->pen_width=d.i32[1];
|
||||
if (dc->pen_width<1)
|
||||
dc->pen_width=1;
|
||||
if (dc->thick) {
|
||||
d=dc->thick*dc->r_norm+0x80000000; //Round
|
||||
dc->thick=d.i32[1];
|
||||
if (dc->thick<1)
|
||||
dc->thick=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2,
|
||||
}
|
||||
|
||||
public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
{//2D. Clipping but No transformation or pen width.
|
||||
{//2D. Clipping but No transformation or thick.
|
||||
I32 *db=dc->depth_buf;
|
||||
CTask *win_task;
|
||||
CColorROPU32 old_color;
|
||||
@@ -79,7 +79,7 @@ public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
}
|
||||
|
||||
Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
{//Clipping but No transformation or pen width, called with db_z set
|
||||
{//Clipping but No transformation or thick, called with db_z set
|
||||
CTask *win_task;
|
||||
CColorROPU32 old_color;
|
||||
if (dc->brush) {
|
||||
@@ -410,7 +410,7 @@ public I64 GrFillCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter)
|
||||
}
|
||||
|
||||
public Bool GrPlot3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
{//3D. Clipping and transformation but no pen_width.
|
||||
{//3D. Clipping and transformation but no thick.
|
||||
I64 _x,_y,_z;
|
||||
Bool was_transform=FALSE,was_symmetry=FALSE;
|
||||
if (dc->flags & DCF_TRANSFORMATION) {
|
||||
@@ -439,7 +439,7 @@ gr_done:
|
||||
}
|
||||
|
||||
public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
{//3D. Clipping and transformation and pen width.
|
||||
{//3D. Clipping and transformation and thick.
|
||||
I64 _x,_y,_z,w,dist;
|
||||
CColorROPU32 old_color=dc->color;
|
||||
Bool record,was_transform=FALSE,was_symmetry=FALSE;
|
||||
@@ -458,57 +458,57 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
if (dc->flags&DCF_JUST_MIRROR)
|
||||
goto gr_done;
|
||||
}
|
||||
w=dc->pen_width>>1;
|
||||
w=dc->thick>>1;
|
||||
dc->db_z=z;
|
||||
if (dc->brush || w<=0)
|
||||
GrPlot1(dc,x,y);
|
||||
else if (dc->pen_width<GR_PEN_BRUSHES_NUM) {
|
||||
else if (dc->thick<GR_PEN_BRUSHES_NUM) {
|
||||
if (dc->color.c0.rop!=ROPB_COLLISION)
|
||||
dc->color.c0.rop=ROPB_MONO;
|
||||
if (dc->depth_buf) {
|
||||
if (dc->color.c1.rop&ROPBF_DITHER) {
|
||||
dc->color.c1.rop=dc->color.c0.rop;
|
||||
if (((x-w)^(y-w))&1) {
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->thick]);
|
||||
dc->color.c0=dc->color.c1;
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->thick]);
|
||||
} else {
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->thick]);
|
||||
dc->color.c0=dc->color.c1;
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->thick]);
|
||||
}
|
||||
} else {
|
||||
if (dc->color.c0.rop==ROPB_COLLISION) {
|
||||
if (dc->color.c0.color!=dc->bkcolor.c0.color &&
|
||||
dc->color.c0.color!=TRANSPARENT)
|
||||
record=GrBlot3(dc,x-w,y-w,z,
|
||||
gr.collision_pen_brushes[dc->pen_width]);
|
||||
gr.collision_pen_brushes[dc->thick]);
|
||||
else
|
||||
record=FALSE;
|
||||
} else
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->pen_width]);
|
||||
record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->thick]);
|
||||
}
|
||||
} else {
|
||||
if (dc->color.c1.rop&ROPBF_DITHER) {
|
||||
dc->color.c1.rop=dc->color.c0.rop;
|
||||
if (((x-w)^(y-w))&1) {
|
||||
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->thick]);
|
||||
dc->color.c0=dc->color.c1;
|
||||
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->thick]);
|
||||
} else {
|
||||
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->thick]);
|
||||
dc->color.c0=dc->color.c1;
|
||||
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->thick]);
|
||||
}
|
||||
} else {
|
||||
if (dc->color.c0.rop==ROPB_COLLISION) {
|
||||
if (dc->color.c0.color!=dc->bkcolor.c0.color &&
|
||||
dc->color.c0.color!=TRANSPARENT)
|
||||
record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->pen_width]);
|
||||
record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->thick]);
|
||||
else
|
||||
record=FALSE;
|
||||
} else
|
||||
record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->pen_width]);
|
||||
record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->thick]);
|
||||
}
|
||||
}
|
||||
if (record) {
|
||||
@@ -525,7 +525,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
if (dc->flags & DCF_RECORD_EXTENTS) {
|
||||
if (x-w<dc->min_x) dc->min_x=x-w;
|
||||
if (y-w<dc->min_y) dc->min_y=y-w;
|
||||
if (dc->pen_width & 1) {
|
||||
if (dc->thick & 1) {
|
||||
if (x+w>dc->max_x) dc->max_x=x+w;
|
||||
if (y+w>dc->max_y) dc->max_y=y+w;
|
||||
} else {
|
||||
@@ -535,7 +535,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
}
|
||||
}
|
||||
} else
|
||||
GrFillCircle(dc,x,y,dc->db_z,dc->pen_width);
|
||||
GrFillCircle(dc,x,y,dc->db_z,dc->thick);
|
||||
gr_done:
|
||||
dc->color=old_color;
|
||||
if (was_transform)
|
||||
@@ -615,7 +615,7 @@ public Bool GrRegPoly(CDC *dc=gr.dc,
|
||||
I64 step=1,
|
||||
F64 start_radians=0,
|
||||
F64 len_radians=2*ã)
|
||||
{//2D. Clipping but no transform or pen width.
|
||||
{//2D. Clipping but no transform or thick.
|
||||
Bool res;
|
||||
I32 *db=dc->depth_buf;
|
||||
dc->depth_buf=NULL;
|
||||
@@ -626,22 +626,22 @@ public Bool GrRegPoly(CDC *dc=gr.dc,
|
||||
}
|
||||
|
||||
public Bool Gr2Bezier(CDC *dc=gr.dc,CD3I32 *ctrl)
|
||||
{//2nd order. Clipping but no transform or pen width.
|
||||
{//2nd order. Clipping but no transform or thick.
|
||||
return Bezier2(dc,ctrl,&GrLinePlot);
|
||||
}
|
||||
|
||||
public Bool Gr3Bezier(CDC *dc=gr.dc,CD3I32 *ctrl)
|
||||
{//3rd order. Clipping but no transform or pen width.
|
||||
{//3rd order. Clipping but no transform or thick.
|
||||
return Bezier3(dc,ctrl,&GrLinePlot);
|
||||
}
|
||||
|
||||
public Bool Gr2BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
|
||||
{//2nd order. Clipping but no transform or pen width.
|
||||
{//2nd order. Clipping but no transform or thick.
|
||||
return BSpline2(dc,ctrl,cnt,&GrLinePlot,closed);
|
||||
}
|
||||
|
||||
public Bool Gr3BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
|
||||
{//3rd order. Clipping but no transform or pen width.
|
||||
{//3rd order. Clipping but no transform or thick.
|
||||
return BSpline3(dc,ctrl,cnt,&GrLinePlot,closed);
|
||||
}
|
||||
|
||||
@@ -769,7 +769,7 @@ I64 GrLineFat3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||
|
||||
public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||
I64 step=1,I64 start=0)
|
||||
{//3D. Transformation with pen width.
|
||||
{//3D. Transformation with thick.
|
||||
I64 _x1,_y1,_z1,_x2,_y2,_z2;
|
||||
Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE;
|
||||
if (dc->flags & DCF_TRANSFORMATION) {
|
||||
@@ -785,11 +785,11 @@ public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||
DCReflect(dc,&_x2,&_y2,&_z2);
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
if (step==1 && !dc->brush) {
|
||||
if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf
|
||||
if (!start && dc->thick<2 && !dc->depth_buf) {//TODO: clip z depbuf
|
||||
if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2))
|
||||
res=Line(dc,_x1,_y1,0,_x2,_y2,0,&GrLinePlot0,step,start);
|
||||
} else {
|
||||
if (GrLineFat3(dc,_x1,_y1,_z1,_x2,_y2,_z2,dc->pen_width,start))
|
||||
if (GrLineFat3(dc,_x1,_y1,_z1,_x2,_y2,_z2,dc->thick,start))
|
||||
res=TRUE;
|
||||
}
|
||||
} else
|
||||
@@ -799,11 +799,11 @@ public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||
goto gr_done;
|
||||
}
|
||||
if (step==1 && !dc->brush) {
|
||||
if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf
|
||||
if (!start && dc->thick<2 && !dc->depth_buf) {//TODO: clip z depbuf
|
||||
if (DCClipLine(dc,&x1,&y1,&x2,&y2))
|
||||
res|=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start);
|
||||
} else {
|
||||
if (GrLineFat3(dc,x1,y1,z1,x2,y2,z2,dc->pen_width,start))
|
||||
if (GrLineFat3(dc,x1,y1,z1,x2,y2,z2,dc->thick,start))
|
||||
res=TRUE;
|
||||
}
|
||||
} else
|
||||
@@ -856,7 +856,7 @@ public Bool GrEllipse3(CDC *dc=gr.dc,
|
||||
I64 step=1,
|
||||
F64 start_radians=0,
|
||||
F64 len_radians=2*ã)
|
||||
{//3D. Transformation with pen width.
|
||||
{//3D. Transformation with thick.
|
||||
Bool res;
|
||||
I64 x,y,z,xx,yy,zz;
|
||||
F64 m1,arg1,m2,arg2,s,c;
|
||||
@@ -905,7 +905,7 @@ public Bool GrEllipse3(CDC *dc=gr.dc,
|
||||
|
||||
public Bool GrCircle3(CDC *dc=gr.dc,I64 cx,I64 cy,I64 cz,I64 radius,
|
||||
I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
|
||||
{//3D. Transformation with pen width.
|
||||
{//3D. Transformation with thick.
|
||||
if (dc->flags & DCF_TRANSFORMATION)
|
||||
return GrEllipse3(dc,cx,cy,cz,radius,radius,0,step,
|
||||
start_radians,len_radians);
|
||||
@@ -921,7 +921,7 @@ public Bool GrRegPoly3(CDC *dc=gr.dc,
|
||||
I64 step=1,
|
||||
F64 start_radians=0,
|
||||
F64 len_radians=2*ã)
|
||||
{//3D. Clipping and transform and pen width.
|
||||
{//3D. Clipping and transform and thick.
|
||||
Bool res;
|
||||
I64 x,y,z,xx,yy,zz;
|
||||
F64 m1,arg1,m2,arg2,s,c;
|
||||
@@ -1215,7 +1215,7 @@ Option(OPTf_WARN_HEADER_MISMATCH,ON);
|
||||
#help_index "Graphics"
|
||||
|
||||
public Bool Gr2Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl)
|
||||
{//2nd order. Clipping and transform and pen width.
|
||||
{//2nd order. Clipping and transform and thick.
|
||||
Bool res=FALSE;
|
||||
I64 i,x,y,z,
|
||||
old_flags=dc->flags;
|
||||
@@ -1260,7 +1260,7 @@ gr_done:
|
||||
}
|
||||
|
||||
public Bool Gr3Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl)
|
||||
{//3rd order. Clipping and transform and pen width.
|
||||
{//3rd order. Clipping and transform and thick.
|
||||
Bool res=FALSE;
|
||||
I64 i,x,y,z,
|
||||
old_flags=dc->flags;
|
||||
@@ -1305,7 +1305,7 @@ gr_done:
|
||||
}
|
||||
|
||||
public I64 Gr2BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
|
||||
{//2nd order. Clipping and transform and pen width.
|
||||
{//2nd order. Clipping and transform and thick.
|
||||
Bool res=FALSE;
|
||||
I64 i,x,y,z,
|
||||
old_flags=dc->flags;
|
||||
@@ -1350,7 +1350,7 @@ gr_done:
|
||||
}
|
||||
|
||||
public Bool Gr3BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
|
||||
{//3rd order. Clipping and transform and pen width.
|
||||
{//3rd order. Clipping and transform and thick.
|
||||
Bool res=FALSE;
|
||||
I64 i,x,y,z,
|
||||
old_flags=dc->flags;
|
||||
|
||||
@@ -20,7 +20,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
{//Plot a sprite into a CDC.
|
||||
CSprite *tmpg=elems-offset(CSprite.start);
|
||||
I64 i,j,k,x1,y1,z1,x2,y2,
|
||||
*old_r,*r2,old_flags=dc->flags,old_pen_width=dc->pen_width;
|
||||
*old_r,*r2,old_flags=dc->flags,old_pen_width=dc->thick;
|
||||
I32 *ptr;
|
||||
CColorROPU32 old_color=dc->color;
|
||||
CDC *img;
|
||||
@@ -39,9 +39,9 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
tmpg->d.dither_color.u8[0]|
|
||||
tmpg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
dc->pen_width=tmpg->w.width;
|
||||
DCPenWidthScale(dc);
|
||||
case SPT_THICK:
|
||||
dc->thick=tmpg->t.thick;
|
||||
DCThickScale(dc);
|
||||
break;
|
||||
case SPT_TRANSFORM_ON:
|
||||
if (!(dc->flags&DCF_TRANSFORMATION)) {
|
||||
@@ -237,7 +237,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
}
|
||||
MemCpy(&dc->sym,&old_sym,sizeof(CGrSym));
|
||||
dc->color=old_color;
|
||||
dc->pen_width=old_pen_width;
|
||||
dc->thick=old_pen_width;
|
||||
dc->flags=dc->flags&~(DCF_SYMMETRY|DCF_TRANSFORMATION) |
|
||||
old_flags&(DCF_SYMMETRY|DCF_TRANSFORMATION);
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
GrBorder(dc,xx1-1,yy1-1,xx2,yy2);//This is done little bit too often.
|
||||
|
||||
while (msg_code=ScanMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
|
||||
@@ -308,7 +308,7 @@ bm_menu:
|
||||
if (i>=0) color=i;
|
||||
goto bm_menu;
|
||||
case SPBM_WIDTH:
|
||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||
i=PopUpRangeI64(1,16,1,"Thick\n");
|
||||
if (i>=0) width=i;
|
||||
goto bm_menu;
|
||||
case SPBM_UNDO:
|
||||
@@ -357,7 +357,7 @@ bm_menu:
|
||||
switch (mode) {
|
||||
case SPBM_PT:
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
img->thick=width;
|
||||
GrPlot3(img,arg1-xx1,arg2-yy1,0);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
break;
|
||||
@@ -367,7 +367,7 @@ bm_menu:
|
||||
x1=arg1; y1=arg2;
|
||||
down=TRUE;
|
||||
dc->color=color;
|
||||
dc->pen_width=width;
|
||||
dc->thick=width;
|
||||
case SPBM_LINE:
|
||||
GrLine3(dc,x1,y1,0,arg1,arg2,0);
|
||||
break;
|
||||
@@ -383,7 +383,7 @@ bm_menu:
|
||||
case SPBM_COPY:
|
||||
case SPBM_DELETE:
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
GrBorder(dc,x1,y1,x1,y1);
|
||||
break;
|
||||
end:
|
||||
@@ -434,7 +434,7 @@ bm_menu:
|
||||
x1=arg1; y1=arg2;
|
||||
down=TRUE;
|
||||
dc->color=color;
|
||||
dc->pen_width=width;
|
||||
dc->thick=width;
|
||||
GrLine3(dc,x1,y1,0,arg1,arg2,0);
|
||||
}
|
||||
break;
|
||||
@@ -442,7 +442,7 @@ bm_menu:
|
||||
x1=arg1; y1=arg2;
|
||||
down=TRUE;
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
img->thick=width;
|
||||
GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
break;
|
||||
@@ -456,7 +456,7 @@ bm_menu:
|
||||
if (down) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
dc->pen_width=width;
|
||||
dc->thick=width;
|
||||
if (mode==SPBM_ARROW)
|
||||
GrArrow3(dc,x1,y1,0,arg1,arg2,0);
|
||||
else
|
||||
@@ -503,7 +503,7 @@ bm_menu:
|
||||
y22=y1;
|
||||
}
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
GrBorder(dc,x11,y11,x22,y22);
|
||||
}
|
||||
break;
|
||||
@@ -511,7 +511,7 @@ bm_menu:
|
||||
if (down) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
dc->pen_width=width;
|
||||
dc->thick=width;
|
||||
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(arg1-x1)+SqrI64(arg2-y1)));
|
||||
}
|
||||
break;
|
||||
@@ -549,7 +549,7 @@ bm_menu:
|
||||
case SPBM_POLYPT:
|
||||
if (down) {
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
img->thick=width;
|
||||
GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
x1=arg1; y1=arg2;
|
||||
@@ -564,7 +564,7 @@ bm_menu:
|
||||
case SPBM_POLYPT:
|
||||
case SPBM_POLYLINE:
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
img->thick=width;
|
||||
if (mode==SPBM_ARROW)
|
||||
GrArrow3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
|
||||
else
|
||||
@@ -621,7 +621,7 @@ bm_menu:
|
||||
goto bm_menu;
|
||||
case SPBM_CIRCLE:
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
img->thick=width;
|
||||
GrCircle3(img,x1-xx1,y1-yy1,0,
|
||||
Sqrt(SqrI64(arg1-x1)+SqrI64(arg2-y1)));
|
||||
down=FALSE;
|
||||
|
||||
@@ -51,8 +51,8 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
|
||||
case SPT_CIRCLE:
|
||||
DocPrint(doc,"{(%d,%d):%d}",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
DocPrint(doc,"{%d}",tmpg->w.width);
|
||||
case SPT_THICK:
|
||||
DocPrint(doc,"{%d}",tmpg->t.thick);
|
||||
break;
|
||||
case SPT_ELLIPSE:
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->pwha.x1,tmpg->pwha.y1,
|
||||
@@ -280,10 +280,10 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
else
|
||||
g.type=SPT_FLOOD_FILL;
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
case SPT_THICK:
|
||||
Lex(cc); //Skip {
|
||||
g.w.width=LexExpressionI64(cc);
|
||||
g.type=SPT_WIDTH;
|
||||
g.t.thick=LexExpressionI64(cc);
|
||||
g.type=SPT_THICK;
|
||||
break;
|
||||
case SPT_CIRCLE:
|
||||
Lex(cc); //Skip {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_thick=NULL,
|
||||
I64 *_xx=NULL,I64 *_yy=NULL)
|
||||
{
|
||||
CSprite *res=head->next;
|
||||
I64 width=1,xx=0,yy=0;
|
||||
I64 thick=1,xx=0,yy=0;
|
||||
CColorROPU32 color=BLACK;
|
||||
if (dc) DCRst(dc);
|
||||
while (elem_num-->0 && res!=head) {
|
||||
@@ -19,9 +19,9 @@ CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
|
||||
res->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
||||
if (dc) dc->color=color;
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
width=res->w.width;
|
||||
if (dc) dc->pen_width=width;
|
||||
case SPT_THICK:
|
||||
thick=res->t.thick;
|
||||
if (dc) dc->thick=thick;
|
||||
break;
|
||||
case SPT_SHIFT:
|
||||
xx+=res->p.x1;
|
||||
@@ -43,7 +43,7 @@ CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
|
||||
res=res->next;
|
||||
}
|
||||
if (_color) *_color=color;
|
||||
if (_width) *_width=width;
|
||||
if (_thick) *_thick=thick;
|
||||
if (_xx) *_xx=xx;
|
||||
if (_yy) *_yy=yy;
|
||||
return res;
|
||||
@@ -380,9 +380,9 @@ U0 SpriteTransformQue(CSprite *head,I64 *r)
|
||||
while (tmpg!=head) {
|
||||
if (Bt(&tmpg->type,SPf_SEL))
|
||||
switch (tmpg->type&SPG_TYPE_MASK) {
|
||||
case SPT_WIDTH:
|
||||
tmpg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536;
|
||||
if (tmpg->w.width<0) tmpg->w.width=0;
|
||||
case SPT_THICK:
|
||||
tmpg->t.thick*=Sqrt(Mat4x4NormSqr65536(r))/65536;
|
||||
if (tmpg->t.thick<0) tmpg->t.thick=0;
|
||||
break;
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
case SPT_ARROW:
|
||||
|
||||
@@ -23,7 +23,7 @@ I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num,
|
||||
|
||||
DocPrint(doc,"$$MU-UL,\"Color (4-bit)\",LE=SPT_COLOR$$\n"
|
||||
"$$MU-UL,\"Dither Color (4-bit)\",LE=SPT_DITHER_COLOR$$\n"
|
||||
"$$MU-UL,\"Width\",LE=SPT_WIDTH$$\n"
|
||||
"$$MU-UL,\"Thick\",LE=SPT_THICK$$\n"
|
||||
"$$MU-UL,\"Planar Symmetry\",LE=SPT_PLANAR_SYMMETRY$$\n"
|
||||
"\n$$MU-UL,\"Point\",LE=SPT_PT$$\n"
|
||||
"$$MU-UL,\"Line\",LE=SPT_LINE$$\n"
|
||||
@@ -104,13 +104,13 @@ Bool PopUpExtents(I64 *_x1,I64 *_x2,I64 *_y1,I64 *_y2)
|
||||
U0 SpriteScrnInit(CDC *dc,I64,I64)
|
||||
{
|
||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
||||
I64 xx,yy,old_pen_width=dc->pen_width;
|
||||
I64 xx,yy,old_pen_width=dc->thick;
|
||||
CColorROPU32 old_color=dc->color;
|
||||
Refresh;
|
||||
DCFill(dc);
|
||||
if (dc->flags&DCF_SYMMETRY) {
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
xx=dc->sym.sny*8192;
|
||||
yy=-dc->sym.snx*8192;
|
||||
dc->color=RED;
|
||||
@@ -125,7 +125,7 @@ U0 SpriteScrnInit(CDC *dc,I64,I64)
|
||||
dc->flags|=DCF_SYMMETRY;
|
||||
}
|
||||
dc->color=old_color;
|
||||
dc->pen_width=old_pen_width;
|
||||
dc->thick=old_pen_width;
|
||||
}
|
||||
|
||||
CSprite *SMLine(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
|
||||
@@ -176,10 +176,10 @@ CSprite *SMPlanarSymmetry(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2)
|
||||
{
|
||||
I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,old_width,old_flags;
|
||||
CSprite *res;
|
||||
old_width=dc->pen_width;
|
||||
old_width=dc->thick;
|
||||
old_flags=dc->flags;
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
do {
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
@@ -188,7 +188,7 @@ CSprite *SMPlanarSymmetry(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2)
|
||||
x2=arg1; y2=arg2;
|
||||
} while (msg_code!=MSG_MS_L_UP);
|
||||
dc->flags=old_flags&DCF_SYMMETRY|dc->flags&~DCF_SYMMETRY;
|
||||
dc->pen_width=old_width;
|
||||
dc->thick=old_width;
|
||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
|
||||
res->type=SPT_PLANAR_SYMMETRY;
|
||||
res->pp.x1=x1-x;
|
||||
@@ -238,8 +238,8 @@ CSprite *SMScrnBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,
|
||||
xx1=arg1,yy1=arg2,xx2=arg1,yy2=arg2,old_width;
|
||||
CDC *dc3,*img;
|
||||
CSprite *res;
|
||||
old_width=dc2->pen_width;
|
||||
dc2->pen_width=1;
|
||||
old_width=dc2->thick;
|
||||
dc2->thick=1;
|
||||
do {
|
||||
dc2->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
GrBorder(dc2,xx1+Fs->pix_left+Fs->scroll_x,yy1+Fs->pix_top+Fs->scroll_y,
|
||||
@@ -279,7 +279,7 @@ CSprite *SMScrnBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,
|
||||
MemCpy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
DCDel(img);
|
||||
DCDel(dc3);
|
||||
dc2->pen_width=old_width;
|
||||
dc2->thick=old_width;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS
|
||||
-WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL;
|
||||
return res;
|
||||
@@ -596,8 +596,8 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
if (sel) {
|
||||
xx1=arg1; yy1=arg2;
|
||||
xx2=arg1; yy2=arg2;
|
||||
old_width=dc->pen_width;
|
||||
dc->pen_width=1;
|
||||
old_width=dc->thick;
|
||||
dc->thick=1;
|
||||
do {
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
GrBorder(dc,xx1,yy1,xx2,yy2);
|
||||
@@ -615,7 +615,7 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
yy1=y1; yy2=y2;
|
||||
}
|
||||
} while (msg_code!=MSG_MS_L_UP);
|
||||
dc->pen_width=old_width;
|
||||
dc->thick=old_width;
|
||||
}
|
||||
|
||||
xx2++; yy2++;
|
||||
@@ -812,7 +812,7 @@ U0 SMTaskTitleSet(I64 eletype)
|
||||
I64 SpriteMainEd(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
I64 res,i,x,y,arg1,arg2,xx,yy,xx1,yy1,xx2,yy2,width,eletype=SPT_MENU,
|
||||
I64 res,i,x,y,arg1,arg2,xx,yy,xx1,yy1,xx2,yy2,thick,eletype=SPT_MENU,
|
||||
cur_elem_num,old_border_src=Fs->border_src,old_title_src=Fs->title_src,
|
||||
old_de_flags=doc_ce->de_flags;
|
||||
CColorROPU32 bm_bkcolor,color;
|
||||
@@ -831,7 +831,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
|
||||
while (TRUE) {
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
||||
&color,&width,&x,&y);
|
||||
&color,&thick,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
DCFill;
|
||||
if (eletype==SPT_MENU) {
|
||||
@@ -847,7 +847,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
eletype=PopUpSpriteMain(&head,&cur_elem_num,doc,doc_ce);
|
||||
xx+=StrLen(doc_ce->tag)*FONT_WIDTH;
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,x,y,
|
||||
&color,&width,&x,&y);
|
||||
&color,&thick,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
@@ -982,14 +982,14 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_MS_L|WIF_FOCUS_TASK_MS_R|
|
||||
WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL;
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
case SPT_THICK:
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||
i=PopUpRangeI64(1,16,1,"Thick\n");
|
||||
if (i>=1) {
|
||||
width=i;
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH));
|
||||
tmpg->type=SPT_WIDTH;
|
||||
tmpg->w.width=width;
|
||||
thick=i;
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_THICK));
|
||||
tmpg->type=SPT_THICK;
|
||||
tmpg->t.thick=thick;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
@@ -1027,7 +1027,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
|
||||
if (eletype!=SPT_MENU) {
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
||||
&color,&width,&x,&y);
|
||||
&color,&thick,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
SpriteScrnInit(dc,x,y);
|
||||
if (eletype==SPT_EXIT) {
|
||||
|
||||
@@ -800,7 +800,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
else
|
||||
dc->color=ROP_XOR+TRANSPARENT;
|
||||
GrPrint(dc,0,0,"%6.3f%% (%d,%d,%d)",e->view_scale*100,x,y,z);
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
dc->color&=0xF;
|
||||
if (Blink(10))
|
||||
dc->color^=0xF;
|
||||
@@ -808,7 +808,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
if (e->sel_rect) {
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
if (Blink)
|
||||
dc->color=ROPF_DITHER+RED<<16+WHITE;
|
||||
else
|
||||
|
||||
@@ -7,7 +7,7 @@ I64 sprite_elem_base_sizes[SPT_TYPES_NUM]={
|
||||
sizeof(CSpriteBase), //SPT_END
|
||||
sizeof(CSpriteColor), //SPT_COLOR
|
||||
sizeof(CSpriteDitherColor), //SPT_DITHER_COLOR
|
||||
sizeof(CSpriteW), //SPT_WIDTH
|
||||
sizeof(CSpriteT), //SPT_THICK
|
||||
sizeof(CSpritePtPt), //SPT_PLANAR_SYMMETRY
|
||||
sizeof(CSpriteBase), //SPT_TRANSFORM_ON
|
||||
sizeof(CSpriteBase), //SPT_TRANSFORM_OFF
|
||||
@@ -153,8 +153,8 @@ public U8 *SpriteElem2Summary(CSprite *tmpg)
|
||||
case SPT_CIRCLE:
|
||||
CatPrint(buf," (%d,%d):%dR",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
CatPrint(buf," %d",tmpg->w.width);
|
||||
case SPT_THICK:
|
||||
CatPrint(buf," %d",tmpg->t.thick);
|
||||
break;
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
|
||||
@@ -90,7 +90,7 @@ U0 DrawWinGrid(CDC *dc)
|
||||
{
|
||||
F64 d;
|
||||
dc->color=BLACK;
|
||||
dc->pen_width=1;
|
||||
dc->thick=1;
|
||||
for (d=ms_grid.x_offset;d<GR_WIDTH; d+=ms_grid.x)
|
||||
GrLine(dc,d,0,d,GR_HEIGHT-1);
|
||||
for (d=ms_grid.y_offset;d<GR_HEIGHT;d+=ms_grid.y)
|
||||
|
||||
Reference in new issue
Block a user