Added some temporary error prints for get_depth in sculpt
authorNicholas Bishop <nicholasbishop@gmail.com>
Fri, 16 Jan 2009 00:44:46 +0000 (00:44 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Fri, 16 Jan 2009 00:44:46 +0000 (00:44 +0000)
source/blender/editors/sculpt/sculpt.c

index 3a3807ab3cd26a954d943524cb69de1b29b46f79..bb95c4e006cc21c340c2d2519494aab6c07f7922 100644 (file)
@@ -248,9 +248,15 @@ static float get_depth(bContext *C, short x, short y)
 
                if(vd && vd->depths && x > 0 && y > 0 && x < vd->w && y < vd->h)
                        return vd->depths[y * vd->w + x];
+
+               if(!vd)
+                       fprintf(stderr, "Error: Bad view3d!\n");
+               else if(!vd->depths)
+                       fprintf(stderr, "Error: Bad depths copy!\n");
+               else
+                       fprintf(stderr, "Error: Out of range: (%d,%d)\n", x, y);
        }
 
-       fprintf(stderr, "Error: Bad depth store!\n");
        return 1;
 }