示例#1
0
//////////////////////////////////////////////////////////
// TMapDC
// ------
//  draw a LineDef
void TMapDC::DrawMapLineDefLen (int editmode, SHORT ldnum)
{
	assert_ldnum (ldnum);

	// Use interm. vars. to accelarate
	LineDef *pLD = &LineDefs[ldnum];
	SHORT start = pLD->start;
	SHORT end   = pLD->end;

	assert_vnum (start);
	assert_vnum (end);
	Vertex *pVStart = &Vertexes[start];
	Vertex *pVEnd   = &Vertexes[end];
	SHORT x0    = pVStart->x;
	SHORT y0    = pVStart->y;
	SHORT x1    = pVEnd->x;
	SHORT y1    = pVEnd->y;

#ifndef WINDOWS_CLIPPING
	if ( ! IS_VISIBLE_MAP_RECT(x0,y0,x1,y1) )
		return;
#endif

    // Get the LineDef color
    int color = GetLineDefColor(editmode, ldnum);

	// Draw the Length
	DrawLineDefLen (x0, y0, x1, y1, color);
}
示例#2
0
//////////////////////////////////////////////////////////
// TMapDC
// ------
//  draw a LineDef
void TMapDC::DrawMapLineDef (int editmode, SHORT ldnum, BOOL DrawLen)
{
	assert_ldnum (ldnum);

	// Use interm. vars. to accelarate
	LineDef HUGE *pLD = &LineDefs[ldnum];
	SHORT start = pLD->start;
	SHORT end   = pLD->end;

	assert_vnum (start);
	assert_vnum (end);
	Vertex HUGE *pVStart = &Vertexes[start];
	Vertex HUGE *pVEnd   = &Vertexes[end];
	SHORT x0    = pVStart->x;
	SHORT y0    = pVStart->y;
	SHORT x1    = pVEnd->x;
	SHORT y1    = pVEnd->y;

#ifndef WINDOWS_CLIPPING
	if ( ! IS_VISIBLE_MAP_RECT(x0, y0, x1, y1) )
		return;
#endif

	// Set the LineDef color
	int color = GetLineDefColor(editmode, ldnum);
	SetPenColor16(color);

	// Draw the LineDef
	if ( editmode == OBJ_VERTEXES )
		DrawMapVector(x0, y0, x1, y1);
	else
		DrawMapLine(x0, y0, x1, y1);

	// Draw the Length
	if ( DrawLen )
		DrawLineDefLen(x0, y0, x1, y1, color);
}