.
This commit is contained in:
parent
d2817625ac
commit
8e9c051681
1 changed files with 32 additions and 25 deletions
|
@ -14858,8 +14858,7 @@ namespace cimg_library_suffixed {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 2 : // Segment.
|
case 2 : case 6 : { // Segment.
|
||||||
case 6 : {
|
|
||||||
const unsigned int
|
const unsigned int
|
||||||
i0 = (unsigned int)primitive(0),
|
i0 = (unsigned int)primitive(0),
|
||||||
i1 = (unsigned int)primitive(1);
|
i1 = (unsigned int)primitive(1);
|
||||||
|
@ -14871,8 +14870,7 @@ namespace cimg_library_suffixed {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 3 : // Triangle.
|
case 3 : case 9 : { // Triangle.
|
||||||
case 9 : {
|
|
||||||
const unsigned int
|
const unsigned int
|
||||||
i0 = (unsigned int)primitive(0),
|
i0 = (unsigned int)primitive(0),
|
||||||
i1 = (unsigned int)primitive(1),
|
i1 = (unsigned int)primitive(1),
|
||||||
|
@ -14885,8 +14883,7 @@ namespace cimg_library_suffixed {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 4 : // Quadrangle.
|
case 4 : case 12 : { // Quadrangle.
|
||||||
case 12 : {
|
|
||||||
const unsigned int
|
const unsigned int
|
||||||
i0 = (unsigned int)primitive(0),
|
i0 = (unsigned int)primitive(0),
|
||||||
i1 = (unsigned int)primitive(1),
|
i1 = (unsigned int)primitive(1),
|
||||||
|
@ -46168,8 +46165,7 @@ namespace cimg_library_suffixed {
|
||||||
}
|
}
|
||||||
is_forward = false;
|
is_forward = false;
|
||||||
} break;
|
} break;
|
||||||
case 2 : // Segment
|
case 2 : case 6 : { // Segment
|
||||||
case 6 : {
|
|
||||||
const unsigned int
|
const unsigned int
|
||||||
i0 = (unsigned int)primitive(0),
|
i0 = (unsigned int)primitive(0),
|
||||||
i1 = (unsigned int)primitive(1);
|
i1 = (unsigned int)primitive(1);
|
||||||
|
@ -46184,8 +46180,7 @@ namespace cimg_library_suffixed {
|
||||||
zrange(l) = (z0 + z1)/2;
|
zrange(l) = (z0 + z1)/2;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 3 : // Triangle
|
case 3 : case 9 : { // Triangle
|
||||||
case 9 : {
|
|
||||||
const unsigned int
|
const unsigned int
|
||||||
i0 = (unsigned int)primitive(0),
|
i0 = (unsigned int)primitive(0),
|
||||||
i1 = (unsigned int)primitive(1),
|
i1 = (unsigned int)primitive(1),
|
||||||
|
@ -46209,8 +46204,7 @@ namespace cimg_library_suffixed {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 4 : // Quadrangle
|
case 4 : case 12 : { // Quadrangle
|
||||||
case 12 : {
|
|
||||||
const unsigned int
|
const unsigned int
|
||||||
i0 = (unsigned int)primitive(0),
|
i0 = (unsigned int)primitive(0),
|
||||||
i1 = (unsigned int)primitive(1),
|
i1 = (unsigned int)primitive(1),
|
||||||
|
@ -47141,10 +47135,14 @@ namespace cimg_library_suffixed {
|
||||||
draw_triangle(zbuffer,x3,y3,z3,x0,y0,z0,xc,yc,zc,color,tx3,ty3,tx0,ty0,txc,tyc,
|
draw_triangle(zbuffer,x3,y3,z3,x0,y0,z0,xc,yc,zc,color,tx3,ty3,tx0,ty0,txc,tyc,
|
||||||
lightprop3,lightprop0,lightpropc,opacity);
|
lightprop3,lightprop0,lightpropc,opacity);
|
||||||
else
|
else
|
||||||
draw_triangle(x0,y0,z0,x1,y1,z1,x2,y2,z2,color,tx0,ty0,tx1,ty1,tx2,ty2,
|
draw_triangle(x0,y0,z0,x1,y1,z1,xc,yc,zc,color,tx0,ty0,tx1,ty1,txc,tyc,
|
||||||
lightprop0,lightprop1,lightprop2,opacity).
|
lightprop0,lightprop1,lightpropc,opacity).
|
||||||
draw_triangle(x0,y0,z0,x2,y2,z2,x3,y3,z3,color,tx0,ty0,tx2,ty2,tx3,ty3,
|
draw_triangle(x1,y1,z1,x2,y2,z2,xc,yc,zc,color,tx1,ty1,tx2,ty2,txc,tyc,
|
||||||
lightprop0,lightprop2,lightprop3,opacity);
|
lightprop1,lightprop2,lightpropc,opacity).
|
||||||
|
draw_triangle(x2,y2,z2,x3,y3,z3,xc,yc,zc,color,tx2,ty2,tx3,ty3,txc,tyc,
|
||||||
|
lightprop2,lightprop3,lightpropc,opacity).
|
||||||
|
draw_triangle(x3,y3,z3,x0,y0,z0,xc,yc,zc,color,tx3,ty3,tx0,ty0,txc,tyc,
|
||||||
|
lightprop3,lightprop0,lightpropc,opacity);
|
||||||
#ifdef cimg_use_board
|
#ifdef cimg_use_board
|
||||||
if (pboard) {
|
if (pboard) {
|
||||||
board.setPenColorRGBi(128,128,128,(unsigned char)(opacity*255));
|
board.setPenColorRGBi(128,128,128,(unsigned char)(opacity*255));
|
||||||
|
@ -47162,17 +47160,26 @@ namespace cimg_library_suffixed {
|
||||||
lx0 = (unsigned int)lightprops(n0,0), ly0 = (unsigned int)lightprops(n0,1),
|
lx0 = (unsigned int)lightprops(n0,0), ly0 = (unsigned int)lightprops(n0,1),
|
||||||
lx1 = (unsigned int)lightprops(n1,0), ly1 = (unsigned int)lightprops(n1,1),
|
lx1 = (unsigned int)lightprops(n1,0), ly1 = (unsigned int)lightprops(n1,1),
|
||||||
lx2 = (unsigned int)lightprops(n2,0), ly2 = (unsigned int)lightprops(n2,1),
|
lx2 = (unsigned int)lightprops(n2,0), ly2 = (unsigned int)lightprops(n2,1),
|
||||||
lx3 = (unsigned int)lightprops(n3,0), ly3 = (unsigned int)lightprops(n3,1);
|
lx3 = (unsigned int)lightprops(n3,0), ly3 = (unsigned int)lightprops(n3,1),
|
||||||
|
lxc = (lx0 + lx1 + lx2 + lx3)/4, lyc = (ly0 + ly1 + ly2 + ly3)/4;
|
||||||
if (zbuffer)
|
if (zbuffer)
|
||||||
draw_triangle(zbuffer,x0,y0,z0,x1,y1,z1,x2,y2,z2,color,tx0,ty0,tx1,ty1,tx2,ty2,
|
draw_triangle(zbuffer,x0,y0,z0,x1,y1,z1,xc,yc,zc,color,tx0,ty0,tx1,ty1,txc,tyc,
|
||||||
light_texture,lx0,ly0,lx1,ly1,lx2,ly2,opacity).
|
light_texture,lx0,ly0,lx1,ly1,lxc,lyc,opacity).
|
||||||
draw_triangle(zbuffer,x0,y0,z0,x2,y2,z2,x3,y3,z3,color,tx0,ty0,tx2,ty2,tx3,ty3,
|
draw_triangle(zbuffer,x1,y1,z1,x2,y2,z2,xc,yc,zc,color,tx1,ty1,tx2,ty2,txc,tyc,
|
||||||
light_texture,lx0,ly0,lx2,ly2,lx3,ly3,opacity);
|
light_texture,lx1,ly1,lx2,ly2,lxc,lyc,opacity).
|
||||||
|
draw_triangle(zbuffer,x2,y2,z2,x3,y3,z3,xc,yc,zc,color,tx2,ty2,tx3,ty3,txc,tyc,
|
||||||
|
light_texture,lx2,ly2,lx3,ly3,lxc,lyc,opacity).
|
||||||
|
draw_triangle(zbuffer,x3,y3,z3,x0,y0,z0,xc,yc,zc,color,tx3,ty3,tx0,ty0,txc,tyc,
|
||||||
|
light_texture,lx3,ly3,lx0,ly0,lxc,lyc,opacity);
|
||||||
else
|
else
|
||||||
draw_triangle(x0,y0,z0,x1,y1,z1,x2,y2,z2,color,tx0,ty0,tx1,ty1,tx2,ty2,
|
draw_triangle(x0,y0,z0,x1,y1,z1,xc,yc,zc,color,tx0,ty0,tx1,ty1,txc,tyc,
|
||||||
light_texture,lx0,ly0,lx1,ly1,lx2,ly2,opacity).
|
light_texture,lx0,ly0,lx1,ly1,lxc,lyc,opacity).
|
||||||
draw_triangle(x0,y0,z0,x2,y2,z2,x3,y3,z3,color,tx0,ty0,tx2,ty2,tx3,ty3,
|
draw_triangle(x1,y1,z1,x2,y2,z2,xc,yc,zc,color,tx1,ty1,tx2,ty2,txc,tyc,
|
||||||
light_texture,lx0,ly0,lx2,ly2,lx3,ly3,opacity);
|
light_texture,lx1,ly1,lx2,ly2,lxc,lyc,opacity).
|
||||||
|
draw_triangle(x2,y2,z2,x3,y3,z3,xc,yc,zc,color,tx2,ty2,tx3,ty3,txc,tyc,
|
||||||
|
light_texture,lx2,ly2,lx3,ly3,lxc,lyc,opacity).
|
||||||
|
draw_triangle(x3,y3,z3,x0,y0,z0,xc,yc,zc,color,tx3,ty3,tx0,ty0,txc,tyc,
|
||||||
|
light_texture,lx3,ly3,lx0,ly0,lxc,lyc,opacity);
|
||||||
#ifdef cimg_use_board
|
#ifdef cimg_use_board
|
||||||
if (pboard) {
|
if (pboard) {
|
||||||
const float
|
const float
|
||||||
|
|
Loading…
Reference in a new issue