- minor stuff

Sun, 09 Mar 2014 14:04:06 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 09 Mar 2014 14:04:06 +0200
changeset 689
397870c6ed38
parent 688
2f4dcc323a85
child 690
9e9c52ca955e

- minor stuff

src/GLCompiler.cc file | annotate | diff | comparison | revisions
src/GLRenderer.cc file | annotate | diff | comparison | revisions
--- a/src/GLCompiler.cc	Mon Feb 24 00:59:57 2014 +0200
+++ b/src/GLCompiler.cc	Sun Mar 09 14:04:06 2014 +0200
@@ -257,7 +257,7 @@
 //
 void GLCompiler::compileObject (LDObject* obj)
 {
-	log ("compile #%1\n", obj->getID() );
+	log ("compile #%1\n", obj->getID());
 	ObjectVBOInfo info;
 	dropObject (obj);
 	compileSubObject (obj, obj, &info);
@@ -340,8 +340,6 @@
 //
 void GLCompiler::compileSubObject (LDObject* obj, LDObject* topobj, ObjectVBOInfo* objinfo)
 {
-	CLOCK_INIT
-
 	switch (obj->getType())
 	{
 		// Note: We cannot split quads into triangles here, it would mess up the
@@ -362,6 +360,7 @@
 		{
 			LDSubfile* ref = static_cast<LDSubfile*> (obj);
 			auto data = ref->inlinePolygons();
+			log ("inlinePolygons yielded %1 polys\n", data.size());
 
 			for (LDPolygon& poly : data)
 			{
--- a/src/GLRenderer.cc	Mon Feb 24 00:59:57 2014 +0200
+++ b/src/GLRenderer.cc	Sun Mar 09 14:04:06 2014 +0200
@@ -120,7 +120,7 @@
 GLRenderer::GLRenderer (QWidget* parent) : QGLWidget (parent)
 {
 	m_Picking = m_rangepick = false;
-	m_camera = (GL::EFixedCamera) gl_camera;
+	m_camera = (EFixedCamera) gl_camera;
 	m_drawToolTip = false;
 	m_EditMode = ESelectMode;
 	m_rectdraw = false;
@@ -372,7 +372,7 @@
 	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 	glEnable (GL_DEPTH_TEST);
 
-	if (m_camera != EFreeCamera)
+	if (camera() != EFreeCamera)
 	{
 		glMatrixMode (GL_PROJECTION);
 		glPushMatrix();
@@ -381,7 +381,7 @@
 		glOrtho (-m_virtWidth, m_virtWidth, -m_virtHeight, m_virtHeight, -100.0f, 100.0f);
 		glTranslatef (pan (X), pan (Y), 0.0f);
 
-		if (m_camera != EFrontCamera && m_camera != EBackCamera)
+		if (camera() != EFrontCamera && camera() != EBackCamera)
 		{
 			glRotatef (90.0f, g_FixedCameras[camera()].glrotate[0],
 				g_FixedCameras[camera()].glrotate[1],
@@ -389,7 +389,7 @@
 		}
 
 		// Back camera needs to be handled differently
-		if (m_camera == GLRenderer::EBackCamera)
+		if (camera() == EBackCamera)
 		{
 			glRotatef (180.0f, 1.0f, 0.0f, 0.0f);
 			glRotatef (180.0f, 0.0f, 0.0f, 1.0f);
@@ -496,7 +496,7 @@
 	assert (camera() != EFreeCamera);
 
 	Vertex pos3d;
-	const LDFixedCameraInfo* cam = &g_FixedCameras[m_camera];
+	const LDFixedCameraInfo* cam = &g_FixedCameras[camera()];
 	const Axis axisX = cam->axisX;
 	const Axis axisY = cam->axisY;
 	const int negXFac = cam->negX ? -1 : 1,
@@ -533,7 +533,7 @@
 QPoint GLRenderer::coordconv3_2 (const Vertex& pos3d) const
 {
 	GLfloat m[16];
-	const LDFixedCameraInfo* cam = &g_FixedCameras[m_camera];
+	const LDFixedCameraInfo* cam = &g_FixedCameras[camera()];
 	const Axis axisX = cam->axisX;
 	const Axis axisY = cam->axisY;
 	const int negXFac = cam->negX ? -1 : 1,
@@ -579,15 +579,15 @@
 	if (isDrawOnly())
 		return;
 
-	if (m_camera != EFreeCamera && !isPicking())
+	if (camera() != EFreeCamera && !isPicking())
 	{
 		// Paint the overlay image if we have one
-		const LDGLOverlay& overlay = currentDocumentData().overlays[m_camera];
+		const LDGLOverlay& overlay = currentDocumentData().overlays[camera()];
 
 		if (overlay.img != null)
 		{
-			QPoint v0 = coordconv3_2 (currentDocumentData().overlays[m_camera].v0),
-					   v1 = coordconv3_2 (currentDocumentData().overlays[m_camera].v1);
+			QPoint v0 = coordconv3_2 (currentDocumentData().overlays[camera()].v0),
+					   v1 = coordconv3_2 (currentDocumentData().overlays[camera()].v1);
 
 			QRect targRect (v0.x(), v0.y(), abs (v1.x() - v0.x()), abs (v1.y() - v0.y())),
 				  srcRect (0, 0, overlay.img->width(), overlay.img->height());
@@ -1307,7 +1307,7 @@
 		case ECircleMode:
 		{
 			// Cannot draw into the free camera - use top instead.
-			if (m_camera == EFreeCamera)
+			if (camera() == EFreeCamera)
 				setCamera (ETopCamera);
 
 			// Disable the context menu - we need the right mouse button
@@ -1578,7 +1578,7 @@
 //
 void GLRenderer::getRelativeAxes (Axis& relX, Axis& relY) const
 {
-	const LDFixedCameraInfo* cam = &g_FixedCameras[m_camera];
+	const LDFixedCameraInfo* cam = &g_FixedCameras[camera()];
 	relX = cam->axisX;
 	relY = cam->axisY;
 }
@@ -1674,7 +1674,7 @@
 Axis GLRenderer::getCameraAxis (bool y, GLRenderer::EFixedCamera camid)
 {
 	if (camid == (GL::EFixedCamera) - 1)
-		camid = m_camera;
+		camid = camera();
 
 	const LDFixedCameraInfo* cam = &g_FixedCameras[camid];
 	return (y) ? cam->axisY : cam->axisX;

mercurial