simplify a bit

Tue, 02 Jul 2013 23:02:53 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 02 Jul 2013 23:02:53 +0300
changeset 318
de051d2bd80b
parent 317
e41ab239ed28
child 319
d0f41342ef51

simplify a bit

src/file.cpp file | annotate | diff | comparison | revisions
src/gldraw.cpp file | annotate | diff | comparison | revisions
src/gldraw.h file | annotate | diff | comparison | revisions
--- a/src/file.cpp	Tue Jul 02 22:53:20 2013 +0300
+++ b/src/file.cpp	Tue Jul 02 23:02:53 2013 +0300
@@ -532,7 +532,6 @@
 	g_win->updateTitle();
 	g_win->R()->setFile( file );
 	g_win->R()->resetAngles();
-	g_win->R()->overlaysFromObjects();
 	
 	// Add it to the recent files list.
 	addRecentFile( path );
--- a/src/gldraw.cpp	Tue Jul 02 22:53:20 2013 +0300
+++ b/src/gldraw.cpp	Tue Jul 02 23:02:53 2013 +0300
@@ -1195,6 +1195,19 @@
 	update ();
 }
 
+READ_ACCESSOR( LDOpenFile*, GLRenderer::file )
+{
+	return m_file;
+}
+
+SET_ACCESSOR( LDOpenFile*, GLRenderer::setFile )
+{
+	m_file = val;
+	
+	if( val != null )
+		overlaysFromObjects();
+}
+
 // =============================================================================
 void GLRenderer::endDraw (bool accept) {
 	(void) accept;
--- a/src/gldraw.h	Tue Jul 02 22:53:20 2013 +0300
+++ b/src/gldraw.h	Tue Jul 02 23:02:53 2013 +0300
@@ -57,8 +57,8 @@
 	
 	PROPERTY (bool, drawOnly, setDrawOnly)
 	PROPERTY (double, zoom, setZoom)
-	PROPERTY (LDOpenFile*, file, setFile)
 	READ_PROPERTY (bool, picking, setPicking)
+	DECLARE_PROPERTY (LDOpenFile*, file, setFile)
 	DECLARE_PROPERTY (EditMode, editMode, setEditMode)
 	
 public:

mercurial