- now works with selection subfiling

Sat, 19 Apr 2014 02:31:24 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sat, 19 Apr 2014 02:31:24 +0300
changeset 721
4cf0f6c9082d
parent 720
c96e427b9ad1
child 722
61e2d0ca0018

- now works with selection subfiling

src/actions.cc file | annotate | diff | comparison | revisions
src/glCompiler.cc file | annotate | diff | comparison | revisions
src/glCompiler.h file | annotate | diff | comparison | revisions
--- a/src/actions.cc	Fri Apr 18 23:33:18 2014 +0300
+++ b/src/actions.cc	Sat Apr 19 02:31:24 2014 +0300
@@ -857,7 +857,6 @@
 		ref->setPosition (g_origin);
 		ref->setTransform (g_identity);
 		getCurrentDocument()->insertObj (refidx, ref);
-		R()->compileObject (ref);
 
 		// Refresh stuff
 		updateDocumentList();
--- a/src/glCompiler.cc	Fri Apr 18 23:33:18 2014 +0300
+++ b/src/glCompiler.cc	Sat Apr 19 02:31:24 2014 +0300
@@ -53,6 +53,8 @@
 static const QColor		g_BFCFrontColor (40, 192, 40);
 static const QColor		g_BFCBackColor (224, 40, 40);
 
+// static QMap<LDObject*, QString> g_objectOrigins;
+
 // =============================================================================
 //
 void checkGLError_private (const char* file, int line)
@@ -191,11 +193,23 @@
 //
 void GLCompiler::stageForCompilation (LDObject* obj)
 {
+	/*
+	g_objectOrigins[obj] = format ("%1:%2 (%3)",
+		obj->document()->getDisplayName(), obj->lineNumber(), obj->typeName());
+	*/
+
 	m_staged << obj;
 }
 
 // =============================================================================
 //
+void GLCompiler::unstage (LDObject* obj)
+{
+	m_staged.removeOne (obj);
+}
+
+// =============================================================================
+//
 void GLCompiler::compileDocument (LDDocument* doc)
 {
 	if (doc == null)
@@ -254,12 +268,16 @@
 		m_objectInfo.erase (it);
 		needMerge();
 	}
+
+	unstage (obj);
 }
 
 // =============================================================================
 //
 void GLCompiler::compileObject (LDObject* obj)
 {
+//	print ("Compile %1\n", g_objectOrigins[obj]);
+
 	if (obj->document()->isImplicit())
 		return;
 
--- a/src/glCompiler.h	Fri Apr 18 23:33:18 2014 +0300
+++ b/src/glCompiler.h	Sat Apr 19 02:31:24 2014 +0300
@@ -45,6 +45,7 @@
 	void				needMerge();
 	void				prepareVBO (int vbonum);
 	void				stageForCompilation (LDObject* obj);
+	void				unstage (LDObject* obj);
 
 	static uint32		colorToRGB (const QColor& color);
 

mercurial