File: VDrawSeg.c

package info (click to toggle)
acm4 4.7-18
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,776 kB
  • ctags: 1,621
  • sloc: ansic: 16,777; makefile: 364; sh: 31
file content (24 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "Vlib.h"

void VDrawSegments (v, seg, nseg, color)
Viewport	*v;
Segment		*seg;
int		nseg;
Color		color; {

	register ZInfo	*z;

	if (v->ztop == v->zsize) {
		printf ("Z-information pool overflow\n");
		return;
	}

	z = &(v->zpool[(v->ztop)++]);
	z->depth = --v->depth;
	z->color = color;

	for ( ; nseg > 0; -- nseg) {
		DrawLine (v->w, seg->x1, seg->y1, seg->x2, seg->y2, z);
		++ seg;
	}
}