# HG changeset patch # User Santeri Piippo # Date 1368910053 -10800 # Node ID c8882ff62d61bb44cfd4dad8f6bf5fae493156cd # Parent eab46019911466d32cd743984b0c24509faa1cbd Hopefully fixed the problem regarding objects not getting drawn at first diff -r eab460199114 -r c8882ff62d61 src/gldraw.cpp --- a/src/gldraw.cpp Sat May 18 21:36:01 2013 +0300 +++ b/src/gldraw.cpp Sat May 18 23:47:33 2013 +0300 @@ -1240,6 +1240,8 @@ glEndList (); } + + obj->m_glinit = true; } // ============================================================================= @@ -1278,8 +1280,14 @@ // ============================================================================= void GLRenderer::deleteLists (LDObject* obj) { + // Delete the lists but only if they have been initialized + if (!obj->m_glinit) + return; + for (const GL::ListType listType : g_glListTypes) glDeleteLists (obj->glLists[listType], 1); + + obj->m_glinit = false; } // ============================================================================= diff -r eab460199114 -r c8882ff62d61 src/ldtypes.cpp --- a/src/ldtypes.cpp Sat May 18 21:36:01 2013 +0300 +++ b/src/ldtypes.cpp Sat May 18 23:47:33 2013 +0300 @@ -64,6 +64,7 @@ parent = null; m_hidden = false; m_selected = false; + m_glinit = false; } LDGibberish::LDGibberish (str _zContent, str _zReason) { diff -r eab460199114 -r c8882ff62d61 src/ldtypes.h --- a/src/ldtypes.h Sat May 18 21:36:01 2013 +0300 +++ b/src/ldtypes.h Sat May 18 23:47:33 2013 +0300 @@ -169,9 +169,12 @@ bool selected () const { return m_selected; } void setSelected (bool selected) { m_selected = selected; } +protected: + bool m_glinit; + friend class GLRenderer; + private: - bool m_hidden; - bool m_selected; + bool m_hidden, m_selected; }; // =============================================================================