[Opentnl-cvs] tnl/zap UIEditor.cpp,1.20,1.21
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2004-10-18 22:41:14
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28494/zap Modified Files: UIEditor.cpp Log Message: Added editor code to display the width of barriers Index: UIEditor.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIEditor.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** UIEditor.cpp 18 Oct 2004 00:09:22 -0000 1.20 --- UIEditor.cpp 18 Oct 2004 22:41:02 -0000 1.21 *************** *** 392,395 **** --- 392,418 ---- renderPoly(i); glLineWidth(1); + Point first = convertLevelToCanvasCoord(i.verts[0]); + for(S32 j = 1; j < i.verts.size(); j++) + { + Point v = convertLevelToCanvasCoord(i.verts[j]); + F32 width = i.width * mCurrentScale / mGridSize; + + Point dir = v - first; + if(dir.len() > 0) + { + dir.normalize(); + Point crs(dir.y, -dir.x); + crs *= width * 0.5; + + glBegin(GL_LINE_LOOP); + glColor3f(0.5, 0.5, 1); + glVertex(first + crs); + glVertex(first - crs); + glVertex(v - crs); + glVertex(v + crs); + glEnd(); + } + first = v; + } } for(S32 j = 0; j < i.verts.size(); j++) |