Merged changes in the trunk up to revision 55357.
[blender.git] / source / blender / render / intern / source / render_result.c
index 62919297e73e7c778e9ee8c5969e6c5bb17f30b9..21e7b6986100826b7679b7c8a38ecfb725ee8124 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_utildefines.h"
 #include "BLI_fileops.h"
 #include "BLI_listbase.h"
 #include "BLI_path_util.h"
 #include "BLI_rect.h"
 #include "BLI_string.h"
 #include "BLI_threads.h"
-#include "BLI_utildefines.h"
 
 #include "BKE_image.h"
 #include "BKE_global.h"
@@ -569,7 +569,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
                rl->layflag = 0x7FFF;    /* solid ztra halo strand */
                rl->passflag = SCE_PASS_COMBINED;
 #ifdef WITH_FREESTYLE
-               FRS_add_freestyle_config( srl );
+               FRS_init_freestyle_config(&srl->freestyleConfig);
 #endif
                
                re->r.actlay = 0;
@@ -990,11 +990,9 @@ void render_result_exr_file_merge(RenderResult *rr, RenderResult *rrpart)
 /* path to temporary exr file */
 void render_result_exr_file_path(Scene *scene, const char *layname, int sample, char *filepath)
 {
-       char di[FILE_MAX], name[FILE_MAXFILE + MAX_ID_NAME + MAX_ID_NAME + 100], fi[FILE_MAXFILE];
-       
-       BLI_strncpy(di, G.main->name, FILE_MAX);
-       BLI_splitdirstring(di, fi);
+       char name[FILE_MAXFILE + MAX_ID_NAME + MAX_ID_NAME + 100], fi[FILE_MAXFILE];
        
+       BLI_split_file_part(G.main->name, fi, sizeof(fi));
        if (sample == 0)
                BLI_snprintf(name, sizeof(name), "%s_%s_%s.exr", fi, scene->id.name + 2, layname);
        else
@@ -1101,6 +1099,10 @@ ImBuf *render_result_rect_to_ibuf(RenderResult *rr, RenderData *rd)
                if (BKE_imtype_valid_depths(rd->im_format.imtype) & (R_IMF_CHAN_DEPTH_12 | R_IMF_CHAN_DEPTH_16 | R_IMF_CHAN_DEPTH_24 | R_IMF_CHAN_DEPTH_32)) {
                        IMB_float_from_rect(ibuf);
                }
+               else  {
+                       /* ensure no float buffer remained from previous frame */
+                       ibuf->rect_float = NULL;
+               }
        }
 
        /* color -> grayscale */