TempleOSCDV5.01.ISO
This commit is contained in:
1 parent
f6eacf7744
commit
320c7ee98a
219 files changed
+5211
-4853
No files matched your search
+1
-1
@@ -147,7 +147,7 @@ public class CSpritePtMeshU8s : CSpriteBase
|
||||
#define SPT_TEXT 27 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
|
||||
#define SPT_TEXT_BOX 28 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
|
||||
#define SPT_TEXT_DIAMOND 29 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
|
||||
#define SPT_NUM_TYPES 30
|
||||
#define SPT_TYPES_NUM 30
|
||||
#define SPG_TYPE_MASK 0x7F
|
||||
|
||||
#help_index "Graphics/Sprite;Sprites;Sprites/Binary"
|
||||
|
||||
@@ -178,7 +178,7 @@ public Bool GrTextBox3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,U8 *s,I64 border=2)
|
||||
return ToBool(res);
|
||||
}
|
||||
|
||||
#define MAX_DIAMOND_SLOPE 2.75
|
||||
#define DIAMOND_SLOPE_MAX 2.75
|
||||
|
||||
public Bool GrTextDiamond3(CDC *dc=gr.dc,
|
||||
I64 x1,I64 y1,I64 z1,U8 *_s,I64 border=2)
|
||||
@@ -223,12 +223,12 @@ public Bool GrTextDiamond3(CDC *dc=gr.dc,
|
||||
do {
|
||||
dx_old=dx; dy_old=dy;
|
||||
m=ToF64(dx)/dy;
|
||||
if (m<1/MAX_DIAMOND_SLOPE) {
|
||||
dy=MaxI64(dy,Ceil(MAX_DIAMOND_SLOPE*dx));
|
||||
m=1/MAX_DIAMOND_SLOPE;
|
||||
} else if (m>MAX_DIAMOND_SLOPE) {
|
||||
dy=MaxI64(dy,Ceil(dx/MAX_DIAMOND_SLOPE));
|
||||
m=MAX_DIAMOND_SLOPE;
|
||||
if (m<1/DIAMOND_SLOPE_MAX) {
|
||||
dy=MaxI64(dy,Ceil(DIAMOND_SLOPE_MAX*dx));
|
||||
m=1/DIAMOND_SLOPE_MAX;
|
||||
} else if (m>DIAMOND_SLOPE_MAX) {
|
||||
dy=MaxI64(dy,Ceil(dx/DIAMOND_SLOPE_MAX));
|
||||
m=DIAMOND_SLOPE_MAX;
|
||||
}
|
||||
dx=MaxI64(dx,w+Ceil(m*AbsI64(y-y1)));
|
||||
dx=MaxI64(dx,w+Ceil(m*AbsI64(y+FONT_HEIGHT-y1)));
|
||||
|
||||
+15
-15
@@ -149,7 +149,7 @@ public U0 DCRst(CDC *dc)
|
||||
Mat4x4IdentEqu(dc->r);
|
||||
dc->r_norm=GR_SCALE;
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_TRANSFORMATION|DCF_JUST_MIRROR);
|
||||
MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*NUM_COLORS);
|
||||
MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*COLORS_NUM);
|
||||
}
|
||||
|
||||
public U0 DCExtentsInit(CDC *dc=NULL)
|
||||
@@ -159,10 +159,10 @@ public U0 DCExtentsInit(CDC *dc=NULL)
|
||||
//You should clear the record flag yourself
|
||||
if (!dc) dc=gr.dc;
|
||||
dc->flags|=DCF_RECORD_EXTENTS;
|
||||
dc->min_x=MAX_I64;
|
||||
dc->max_x=MIN_I64;
|
||||
dc->min_y=MAX_I64;
|
||||
dc->max_y=MIN_I64;
|
||||
dc->min_x=I64_MAX;
|
||||
dc->max_x=I64_MIN;
|
||||
dc->min_y=I64_MAX;
|
||||
dc->max_y=I64_MIN;
|
||||
}
|
||||
|
||||
public CDC *DCAlias(CDC *dc=NULL,CTask *task=NULL)
|
||||
@@ -229,7 +229,7 @@ public I64 DCSize(CDC *dc)
|
||||
public I32 *DCDepthBufRst(CDC *dc)
|
||||
{//Reset device context depth buf to far away.
|
||||
if (dc->depth_buf)
|
||||
MemSetU32(dc->depth_buf,MAX_I32,dc->width_internal*dc->height);
|
||||
MemSetU32(dc->depth_buf,I32_MAX,dc->width_internal*dc->height);
|
||||
return dc->depth_buf;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
U8 *res,*ptr,*body;
|
||||
CArcCompress *arc;
|
||||
I64 body_size=dc->width_internal*dc->height,total_size,flags;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
CBGR48 palette[COLORS_NUM];
|
||||
|
||||
if (dcsf_flags&DCSF_COMPRESSED) {
|
||||
arc=CompressBuf(dc->body,body_size);
|
||||
@@ -308,10 +308,10 @@ public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
if (dcsf_flags&DCSF_PALETTE_GET)
|
||||
GrPaletteGet(palette);
|
||||
else
|
||||
MemCpy(palette,&dc->palette,NUM_COLORS*sizeof(CBGR48));
|
||||
if (MemCmp(palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48))) {
|
||||
MemCpy(palette,&dc->palette,COLORS_NUM*sizeof(CBGR48));
|
||||
if (MemCmp(palette,gr_palette_std,COLORS_NUM*sizeof(CBGR48))) {
|
||||
flags|=DCF_PALETTE;
|
||||
total_size+=NUM_COLORS*sizeof(CBGR48);
|
||||
total_size+=COLORS_NUM*sizeof(CBGR48);
|
||||
}
|
||||
|
||||
ptr=res=MAlloc(total_size);
|
||||
@@ -323,8 +323,8 @@ public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
|
||||
#assert offset(CDC.end)==offset(CDC.palette)
|
||||
if (flags&DCF_PALETTE) {
|
||||
MemCpy(ptr,palette,NUM_COLORS*sizeof(CBGR48));
|
||||
ptr+=NUM_COLORS*sizeof(CBGR48);
|
||||
MemCpy(ptr,palette,COLORS_NUM*sizeof(CBGR48));
|
||||
ptr+=COLORS_NUM*sizeof(CBGR48);
|
||||
}
|
||||
|
||||
MemCpy(ptr,body,body_size);
|
||||
@@ -349,10 +349,10 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
|
||||
ptr+=offset(CDC.end)-offset(CDC.start);
|
||||
|
||||
if (res->flags&DCF_PALETTE) {
|
||||
MemCpy(&res->palette,ptr,NUM_COLORS*sizeof(CBGR48));
|
||||
ptr+=NUM_COLORS*sizeof(CBGR48);
|
||||
MemCpy(&res->palette,ptr,COLORS_NUM*sizeof(CBGR48));
|
||||
ptr+=COLORS_NUM*sizeof(CBGR48);
|
||||
} else
|
||||
MemCpy(&res->palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48));
|
||||
MemCpy(&res->palette,gr_palette_std,COLORS_NUM*sizeof(CBGR48));
|
||||
|
||||
body_size=res->width_internal*res->height;
|
||||
if (res->flags&DCF_COMPRESSED) {
|
||||
|
||||
+9
-9
@@ -25,16 +25,16 @@ public class CGrGlbls
|
||||
U0 (*fp_draw_grab_ms)(CDC *dc,I64 x,I64 y,Bool closed);
|
||||
U8 *empty_sprite; //Gets assigned $LK,"gr.empty_sprite",A="FF:::/Adam/AMouse.HC,empty_sprite"$
|
||||
|
||||
#define GR_NUM_PEN_BRUSHES 64
|
||||
CDC *pen_brushes[GR_NUM_PEN_BRUSHES],
|
||||
*collision_pen_brushes[GR_NUM_PEN_BRUSHES],
|
||||
*even_pen_brushes[GR_NUM_PEN_BRUSHES],
|
||||
*odd_pen_brushes[GR_NUM_PEN_BRUSHES];
|
||||
I8 circle_lo[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES],
|
||||
circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES];
|
||||
#define GR_PEN_BRUSHES_NUM 64
|
||||
CDC *pen_brushes[GR_PEN_BRUSHES_NUM],
|
||||
*collision_pen_brushes[GR_PEN_BRUSHES_NUM],
|
||||
*even_pen_brushes[GR_PEN_BRUSHES_NUM],
|
||||
*odd_pen_brushes[GR_PEN_BRUSHES_NUM];
|
||||
I8 circle_lo[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM],
|
||||
circle_hi[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM];
|
||||
|
||||
#define GR_MAX_SCRN_ZOOM 8
|
||||
U8 *scrn_zoom_tables[GR_MAX_SCRN_ZOOM+1];
|
||||
#define GR_SCRN_ZOOM_MAX 8
|
||||
U8 *scrn_zoom_tables[GR_SCRN_ZOOM_MAX+1];
|
||||
I64 scrn_zoom,sx,sy;
|
||||
|
||||
//When zoomed, this keeps the mouse centered.
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ U0 GrSetUpTables()
|
||||
for (j=0;j<8;j++)
|
||||
gr.to_8_colors(U8 *)[k++]=i;
|
||||
|
||||
for (i=0;i<GR_NUM_PEN_BRUSHES;i++) {
|
||||
for (i=0;i<GR_PEN_BRUSHES_NUM;i++) {
|
||||
k=i+1;
|
||||
|
||||
rr=k*k;
|
||||
@@ -77,7 +77,7 @@ U0 GrSetUpTables()
|
||||
// MemSet(text.vga_alias,0,GR_HEIGHT*GR_WIDTH>>3);
|
||||
MemSet(gr.scrn_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
|
||||
}
|
||||
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++) {
|
||||
for (i=1;i<=GR_SCRN_ZOOM_MAX;i++) {
|
||||
dst=gr.scrn_zoom_tables[i]=MAlloc(256*i);
|
||||
for (j=0;j<256;j++) {
|
||||
m=0;
|
||||
|
||||
@@ -16,7 +16,7 @@ U0 GrPaletteIndicesSet()
|
||||
while (LBts(&sys_semas[SEMA_VGA],0))
|
||||
Yield;
|
||||
InU8(VGAP_INPUT_STAT); //Rsts attr index/data
|
||||
for (i=0;i<NUM_COLORS;i++) {
|
||||
for (i=0;i<COLORS_NUM;i++) {
|
||||
OutU8(VGAP_ATTR_INDEX,i);
|
||||
OutU8(VGAP_ATTR_DATA_WRITE,i);
|
||||
}
|
||||
@@ -61,13 +61,13 @@ public CBGR48 GrPaletteColorGet(I64 color_num)
|
||||
return res;
|
||||
}
|
||||
|
||||
public CBGR48 gr_palette_std[NUM_COLORS]={
|
||||
public CBGR48 gr_palette_std[COLORS_NUM]={
|
||||
0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA,
|
||||
0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA,
|
||||
0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF,
|
||||
0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF};
|
||||
|
||||
public CBGR48 gr_palette_gray[NUM_COLORS]={
|
||||
public CBGR48 gr_palette_gray[COLORS_NUM]={
|
||||
0x000000000000,0x111111111111,0x222222222222,0x333333333333,
|
||||
0x444444444444,0x555555555555,0x666666666666,0x777777777777,
|
||||
0x888888888888,0x999999999999,0xAAAAAAAAAAAA,0xBBBBBBBBBBBB,
|
||||
@@ -76,14 +76,14 @@ public CBGR48 gr_palette_gray[NUM_COLORS]={
|
||||
public U0 GrPaletteGet(CBGR48 *bgr48)
|
||||
{//16 colors
|
||||
I64 i;
|
||||
for (i=0;i<NUM_COLORS;i++)
|
||||
for (i=0;i<COLORS_NUM;i++)
|
||||
bgr48[i]=GrPaletteColorGet(i);
|
||||
}
|
||||
|
||||
public U0 GrPaletteSet(CBGR48 *bgr48)
|
||||
{//16 colors
|
||||
I64 i;
|
||||
for (i=0;i<NUM_COLORS;i++)
|
||||
for (i=0;i<COLORS_NUM;i++)
|
||||
GrPaletteColorSet(i,bgr48[i]);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -280,7 +280,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
if (diameter>=1)
|
||||
switch (n) {
|
||||
case 0:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=0;i<r;i++)
|
||||
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
|
||||
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
|
||||
@@ -293,7 +293,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=r+1;i<diameter;i++)
|
||||
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
|
||||
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
|
||||
@@ -306,7 +306,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=0;i<r;i++)
|
||||
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
|
||||
gr.circle_hi[diameter][i]+cy,z,z);
|
||||
@@ -319,7 +319,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=r+1;i<diameter;i++)
|
||||
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
|
||||
gr.circle_hi[diameter][i]+cy,z,z);
|
||||
@@ -332,7 +332,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=0;i<r;i++)
|
||||
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
|
||||
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
|
||||
@@ -345,7 +345,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=r+1;i<diameter;i++)
|
||||
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
|
||||
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
|
||||
@@ -358,7 +358,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=0;i<r;i++)
|
||||
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
|
||||
gr.circle_hi[diameter][i]+cy,z,z);
|
||||
@@ -371,7 +371,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=r+1;i<diameter;i++)
|
||||
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
|
||||
gr.circle_hi[diameter][i]+cy,z,z);
|
||||
@@ -391,7 +391,7 @@ public I64 GrFillCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter)
|
||||
{//2D. Clipping but not transformation.
|
||||
I64 res=0,i,k,r=diameter>>1,rr;
|
||||
if (diameter>=1) {
|
||||
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||
if (diameter<GR_PEN_BRUSHES_NUM)
|
||||
for (i=0;i<diameter;i++)
|
||||
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
|
||||
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
|
||||
@@ -462,7 +462,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
dc->db_z=z;
|
||||
if (dc->brush || w<=0)
|
||||
GrPlot1(dc,x,y);
|
||||
else if (dc->pen_width<GR_NUM_PEN_BRUSHES) {
|
||||
else if (dc->pen_width<GR_PEN_BRUSHES_NUM) {
|
||||
if (dc->color.c0.rop!=ROPB_COLLISION)
|
||||
dc->color.c0.rop=ROPB_MONO;
|
||||
if (dc->depth_buf) {
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ U0 GrUpdateTasks()
|
||||
|
||||
U0 GrFixZoomScale()
|
||||
{
|
||||
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_MAX_SCRN_ZOOM);
|
||||
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_SCRN_ZOOM_MAX);
|
||||
if (gr.scrn_zoom==1) {
|
||||
gr.sx=0;
|
||||
gr.sy=0;
|
||||
|
||||
@@ -28,7 +28,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
CGrSym old_sym;
|
||||
MemCpy(&old_sym,&dc->sym,sizeof(CGrSym));
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->nearest_dist=MAX_I64;
|
||||
dc->nearest_dist=I64_MAX;
|
||||
while (tmpg->type&SPG_TYPE_MASK) {
|
||||
switch (tmpg->type&SPG_TYPE_MASK) {
|
||||
case SPT_COLOR:
|
||||
@@ -293,16 +293,16 @@ public U0 Sprite3ZB(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64
|
||||
public U0 SpriteExtents(U8 *elems,I64 *min_x=NULL,I64 *max_x=NULL,
|
||||
I64 *min_y=NULL,I64 *max_y=NULL)
|
||||
{//Ignores flood fills.
|
||||
CDC *dc=DCNew(MAX_I32,MAX_I32,Fs,TRUE);
|
||||
CDC *dc=DCNew(I32_MAX,I32_MAX,Fs,TRUE);
|
||||
DCExtentsInit(dc);
|
||||
Sprite3(dc,MAX_I32/2,MAX_I32/2,MAX_I32/2,elems);
|
||||
Sprite3(dc,I32_MAX/2,I32_MAX/2,I32_MAX/2,elems);
|
||||
if (dc->min_x<=dc->max_x) {
|
||||
dc->min_x-=MAX_I32/2;
|
||||
dc->max_x-=MAX_I32/2;
|
||||
dc->min_x-=I32_MAX/2;
|
||||
dc->max_x-=I32_MAX/2;
|
||||
}
|
||||
if (dc->min_y<=dc->max_y) {
|
||||
dc->min_y-=MAX_I32/2;
|
||||
dc->max_y-=MAX_I32/2;
|
||||
dc->min_y-=I32_MAX/2;
|
||||
dc->max_y-=I32_MAX/2;
|
||||
}
|
||||
if (min_x) *min_x=dc->min_x;
|
||||
if (max_x) *max_x=dc->max_x;
|
||||
|
||||
+2
-2
@@ -661,7 +661,7 @@ U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num)
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocPut;
|
||||
Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs);
|
||||
doc->flags|=DOCF_MIN_SIZE|DOCF_FORM;
|
||||
doc->flags|=DOCF_SIZE_MIN|DOCF_FORM;
|
||||
while (TRUE) {
|
||||
SpriteSideBarPickNew(doc,*_head,*_cur_elem_num);
|
||||
DocHighlightCursor(,doc);
|
||||
@@ -977,7 +977,7 @@ Bool SpriteSelUnselShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
case SPED_UNSEL:
|
||||
case SPED_SHIFT_PTS:
|
||||
xx=arg1; yy=arg2;
|
||||
best_dd=MAX_I64;
|
||||
best_dd=I64_MAX;
|
||||
tmpes=head.next;
|
||||
while (tmpes!=&head) {
|
||||
switch (tmpes->type) {
|
||||
|
||||
@@ -76,7 +76,7 @@ CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
|
||||
CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
||||
{//Scrn coordinates
|
||||
CMeshEdVertex *res=NULL,*tmpv=e->vertex_head.next;
|
||||
I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64;
|
||||
I64 dd,dz,best_dd=I64_MAX,best_dz=I64_MAX;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (!(tmpv->flags&VF_IGNORE)) {
|
||||
dd=SqrI64(x-tmpv->pt.x)+SqrI64(y-tmpv->pt.y);
|
||||
@@ -1358,7 +1358,7 @@ me_clipboard_cut:
|
||||
p0b.y=ms.presnap.y;
|
||||
p0b.z=e.ms_z;
|
||||
adjusting_z=TRUE;
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,MAX_I8));
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1432,7 +1432,7 @@ me_clipboard_cut:
|
||||
p0b.y=ms.presnap.y;
|
||||
p0b.z=e.ms_z;
|
||||
adjusting_z=TRUE;
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,MAX_I8));
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
|
||||
}
|
||||
break;
|
||||
case MSG_MS_R_UP:
|
||||
@@ -1472,7 +1472,7 @@ me_clipboard_cut:
|
||||
e.ms_z=RoundI64(Sign(p0b.y-ms.presnap.y)
|
||||
*Sqrt(Sqr(p0b.x-ms.presnap.x)+Sqr(p0b.y-ms.presnap.y))
|
||||
+p0b.z,e.cur_snap);
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,MAX_I8));
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
|
||||
}
|
||||
if (moving) {
|
||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
U8 polypt_map[9]={0,1,2,3,0,4,5,6,7};
|
||||
|
||||
I64 sprite_elem_base_sizes[SPT_NUM_TYPES]={
|
||||
I64 sprite_elem_base_sizes[SPT_TYPES_NUM]={
|
||||
sizeof(CSpriteBase), //SPT_END
|
||||
sizeof(CSpriteColor), //SPT_COLOR
|
||||
sizeof(CSpriteDitherColor), //SPT_DITHER_COLOR
|
||||
@@ -90,8 +90,8 @@ I64 SpriteTypeMask(U8 *elems)
|
||||
I64 res=0;
|
||||
CSprite *tmpg=elems-offset(CSprite.start);
|
||||
while (tmpg->type&SPG_TYPE_MASK) {
|
||||
if (tmpg->type&SPG_TYPE_MASK>=SPT_NUM_TYPES)
|
||||
return 1<<SPT_NUM_TYPES;
|
||||
if (tmpg->type&SPG_TYPE_MASK>=SPT_TYPES_NUM)
|
||||
return 1<<SPT_TYPES_NUM;
|
||||
Bts(&res,tmpg->type&SPG_TYPE_MASK);
|
||||
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user