The zblur plugin (aka as DoF) integrated in render. Compared to patch
[blender.git] / source / blender / src / renderwin.c
index 07d95d2c1b31b3a89c9c47b5fffe9f5ac863bec5..ffa917530b0f898875fc36778eda15ac1956e8d7 100644 (file)
@@ -365,15 +365,15 @@ static void renderwin_mouse_moved(RenderWin *rw)
        if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) {
                int imgco[2];
                char buf[64];
        if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) {
                int imgco[2];
                char buf[64];
-               unsigned int *pxl2;
-               unsigned char *pxl;
+               int *pxlz;      // zbuffer is signed 
+               char *pxl;
 
                if (R.rectot && renderwin_win_to_image_co(rw, rw->lmouse, imgco)) {
                        pxl= (char*) &R.rectot[R.rectx*imgco[1] + imgco[0]];
                        
                        if (R.rectz) {
 
                if (R.rectot && renderwin_win_to_image_co(rw, rw->lmouse, imgco)) {
                        pxl= (char*) &R.rectot[R.rectx*imgco[1] + imgco[0]];
                        
                        if (R.rectz) {
-                               pxl2= &R.rectz[R.rectx*imgco[1] + imgco[0]];                    
-                               sprintf(buf, "R: %d, G: %d, B: %d, A: %d, Z: %f", pxl[0], pxl[1], pxl[2], pxl[3], (float)(((float)*pxl2-(float)INT_MIN)/(float)UINT_MAX));
+                               pxlz= &R.rectz[R.rectx*imgco[1] + imgco[0]];                    
+                               sprintf(buf, "R: %d, G: %d, B: %d, A: %d, Z: %f", pxl[0], pxl[1], pxl[2], pxl[3], 0.5+0.5*( ((float)*pxlz)/(float)INT_MAX) );
                        }
                        else {
                                sprintf(buf, "R: %d, G: %d, B: %d, A: %d", pxl[0], pxl[1], pxl[2], pxl[3]);                     
                        }
                        else {
                                sprintf(buf, "R: %d, G: %d, B: %d, A: %d", pxl[0], pxl[1], pxl[2], pxl[3]);