merge runk 16887:16950
[blender.git] / source / blender / src / drawview.c
index 1f2d501f09ff85b9f86573e68e2f2f13fcb25b93..a169848aa627fff60f1caf45800fde771ca7fda7 100644 (file)
@@ -3131,13 +3131,9 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
        }
        
        if(v3d->drawtype > OB_WIRE) {
-               if(G.f & G_SIMULATION)
-                       glClearColor(0.0, 0.0, 0.0, 0.0); 
-               else {
-                       float col[3];
-                       BIF_GetThemeColor3fv(TH_BACK, col);
-                       glClearColor(col[0], col[1], col[2], 0.0); 
-               }
+               float col[3];
+               BIF_GetThemeColor3fv(TH_BACK, col);
+               glClearColor(col[0], col[1], col[2], 0.0); 
                glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
                
                glLoadIdentity();
@@ -3427,8 +3423,9 @@ void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int win
        }
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
-       /* abuse! to make sure it doesnt draw the helpstuff */
-       G.f |= G_SIMULATION;
+       G.f |= G_RENDER_OGL;
+       if(shadow)
+               G.f |= G_RENDER_SHADOW;
 
        /* first draw set */
        if(G.scene->set) {
@@ -3497,14 +3494,14 @@ void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int win
                glDisable(GL_DEPTH_TEST);
        }
        
-       if(v3d->gpd) {
-               /* draw grease-pencil overlays 
+       if((v3d->gpd) && (v3d->flag2 & V3D_DISPGP)) {
+               /* draw grease-pencil overlays (only if enabled)
                 * WARNING: view matrices are altered here!
                 */
                draw_gpencil_oglrender(v3d, winx, winy);
        }
        
-       G.f &= ~G_SIMULATION;
+       G.f &= ~(G_RENDER_OGL|G_RENDER_SHADOW);
 
        if(!shadow) {
                glFlush();