Ejemplo n.º 1
0
/* HBB 20021128: removed GP_INLINE qualifier to avoid MSVC++ silliness */
void
draw3d_line_unconditional(
    p_vertex v1, p_vertex v2,
    struct lp_style_type *lp,
    int linetype)
{
    unsigned int x1, y1, x2, y2;
    struct lp_style_type ls = *lp;

    /* HBB 20020312: v2 can be NULL, if this call is coming from
    draw_line_hidden. --> redirect to point drawing routine */
    if (! v2) {
	draw3d_point_unconditional(v1, lp);
	return;
    }

    TERMCOORD(v1, x1, y1);
    TERMCOORD(v2, x2, y2);

    /* User-specified line styles */
    if (prefer_line_styles && linetype >= 0)
	lp_use_properties(&ls, linetype+1);

    /* The usual case of auto-generated line types */
    else
	ls.l_type = linetype;

    /* Color by Z value */
    if (ls.pm3d_color.type == TC_Z)
	    ls.pm3d_color.value = (v1->real_z + v2->real_z) * 0.5;

    term_apply_lp_properties(&ls);
    draw_clip_line(x1,y1,x2,y2);
}
Ejemplo n.º 2
0
void
clip_vector(unsigned int x, unsigned int y)
{
    draw_clip_line(move_pos_x, move_pos_y, x, y);
    move_pos_x = x;
    move_pos_y = y;
}
Ejemplo n.º 3
0
void
polyline3d_next(p_vertex v2, struct lp_style_type *lp)
{
    unsigned int x1, y1;
    unsigned int x2, y2;

    /* Copied from draw3d_line(): */
#ifndef LITE
    /* FIXME HBB 20031218: hidden3d mode will still create isolated
     * edges! */
    if (hidden3d && draw_surface) {
	draw_line_hidden(&polyline3d_previous_vertex, v2, lp);
	polyline3d_previous_vertex = *v2;
	return;
    }
#endif

    /* Copied from draw3d_line_unconditional: */
    /* If use_palette is active, polylines can't be used -->
     * revert back to old method */
    if (lp->use_palette) {
	draw3d_line_unconditional(&polyline3d_previous_vertex, v2,
				  lp, lp->l_type);
	polyline3d_previous_vertex = *v2;
	return;

    }

    TERMCOORD(&polyline3d_previous_vertex, x1, y1);
    TERMCOORD(v2, x2, y2);
    draw_clip_line(x1,y1,x2,y2);
    polyline3d_previous_vertex = *v2;
}