diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 9826481284d..b496d57cf8b 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -1490,21 +1490,21 @@ void drawimagespace(ScrArea *sa, void *spacedata) /* detect if we need to redo the curve map. ibuf->rect is zero for compositor and render results after change - also: if no curves are active, we only keep the float rect + convert to 32 bits always... drawing float rects isnt supported well (atis) */ if(ibuf->rect_float) { - if(image_curves_active(sa)) { - if(ibuf->rect==NULL) + if(ibuf->rect==NULL) { + if(image_curves_active(sa)) curvemapping_do_image(G.sima->cumap, G.sima->image); + else + IMB_rect_from_float(ibuf); } - else if(ibuf->rect) - imb_freerectImBuf(ibuf); } if(ibuf->rect) glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - else - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float); +// else +// glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float); if(sima->flag & SI_USE_ALPHA) glDisable(GL_BLEND); diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c index bea32212779..2562111e59f 100644 --- a/source/blender/src/renderwin.c +++ b/source/blender/src/renderwin.c @@ -743,6 +743,34 @@ static void renderwin_clear_display_cb(RenderResult *rr) } } +#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val)) +static void glaDrawPixelsSafe_to32(float fx, float fy, int img_w, int img_h, int row_w, int format, int type, float *rectf) +{ + float *rf; + int x, y; + char *rect32, *rc; + + /* copy imgw-imgh to a temporal 32 bits rect */ + if(img_w<1 || img_h<1) return; + + rc= rect32= MEM_mallocN(img_w*img_h*sizeof(int), "temp 32 bits"); + + for(y=0; yzoom, rw->zoom); - glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rr->rectx-2*rr->crop, ymax, rr->rectx, + glaDrawPixelsSafe_to32(fullrect[0][0], fullrect[0][1], rr->rectx-2*rr->crop, ymax, rr->rectx, GL_RGBA, GL_FLOAT, rectf); glPixelZoom(1.0, 1.0); @@ -969,7 +997,7 @@ static void init_test_break_callback() tmevalue.it_interval.tv_sec = 0; tmevalue.it_interval.tv_usec = 250000; - /* wanneer de eerste ? */ + /* when the first ? */ tmevalue.it_value.tv_sec = 0; tmevalue.it_value.tv_usec = 10000;