diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-18 04:48:59 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-18 04:48:59 +0400 |
commit | c1ceab1281ccf061f03f8000bf190a082a5385d8 (patch) | |
tree | 01b9a9cfca80432d316bdad6c18c74eb025e9eb0 /source/blender/render | |
parent | 0d9c98c4bbfbc8c70c4772086dd09a51d01921ef (diff) | |
parent | 66a35e089a64d27bfc09c2225a530069eca05875 (diff) |
Merged changes in the trunk up to revision 55357.
Resolved conflicts:
release/datafiles/startup.blend
source/blender/editors/space_nla/nla_buttons.c
Also updated source/blender/blenkernel/intern/linestyle.c as a follow-up of
recent changes for the use of bool.
Diffstat (limited to 'source/blender/render')
18 files changed, 159 insertions, 66 deletions
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index 12d36ccfdd2..f284f80df96 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -165,6 +165,10 @@ if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() +if(WITH_INTERNATIONAL) + add_definitions(-DWITH_INTERNATIONAL) +endif() + if(APPLE) # SSE math is enabled by default on x86_64 if(CMAKE_OSX_ARCHITECTURES MATCHES "i386") diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index c4309577ae9..9606c2c0f9c 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -90,6 +90,9 @@ if env['WITH_BF_FREESTYLE']: if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') +if env['WITH_BF_INTERNATIONAL']: + defs.append('WITH_INTERNATIONAL') + if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index b687acae1f7..5df860750fc 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -33,12 +33,14 @@ #define __RE_ENGINE_H__ #include "DNA_listBase.h" +#include "DNA_scene_types.h" #include "RNA_types.h" struct bNode; struct bNodeTree; struct Object; struct Render; +struct RenderData; struct RenderEngine; struct RenderEngineType; struct RenderLayer; @@ -134,6 +136,7 @@ void RE_engines_exit(void); RenderEngineType *RE_engines_find(const char *idname); void RE_engine_get_current_tiles(struct Render *re, int *total_tiles_r, rcti **tiles_r); +struct RenderData *RE_engine_get_render_data(struct Render *re); #endif /* __RE_ENGINE_H__ */ diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp index b31aff82777..9e639501fdd 100644 --- a/source/blender/render/intern/raytrace/rayobject.cpp +++ b/source/blender/render/intern/raytrace/rayobject.cpp @@ -87,7 +87,7 @@ MALWAYS_INLINE void rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi, RayObject *RE_rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi, VlakRen *vlr) { - return rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : 0); + return rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : NULL); } RayObject *RE_rayface_from_coords(RayFace *rayface, void *ob, void *face, float *v1, float *v2, float *v3, float *v4) diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp index 4195b103811..1d67a8c4f44 100644 --- a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp +++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp @@ -50,15 +50,15 @@ static bool selected_node(RTBuilder::Object *node) static void rtbuild_init(RTBuilder *b) { b->split_axis = -1; - b->primitives.begin = 0; - b->primitives.end = 0; + b->primitives.begin = NULL; + b->primitives.end = NULL; b->primitives.maxsize = 0; for (int i = 0; i < RTBUILD_MAX_CHILDS; i++) b->child_offset[i] = 0; for (int i = 0; i < 3; i++) - b->sorted_begin[i] = b->sorted_end[i] = 0; + b->sorted_begin[i] = b->sorted_end[i] = NULL; INIT_MINMAX(b->bb, b->bb + 3); } @@ -178,8 +178,8 @@ RTBuilder *rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp) tmp->sorted_end[i] = b->sorted_begin[i] + b->child_offset[child + 1]; } else { - tmp->sorted_begin[i] = 0; - tmp->sorted_end[i] = 0; + tmp->sorted_begin[i] = NULL; + tmp->sorted_end[i] = NULL; } return tmp; diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c index 7c5d6038e0a..c20b0c6da16 100644 --- a/source/blender/render/intern/source/bake.c +++ b/source/blender/render/intern/source/bake.c @@ -622,7 +622,7 @@ static int get_next_bake_face(BakeShade *bs) continue; if (*origindex >= me->totpoly) { /* Small hack for Array modifier, which gives false - original indices - z0r */ + * original indices - z0r */ continue; } #if 0 diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index cbc357b3d60..2ff612e7c0f 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -46,6 +46,8 @@ # include "BLI_edgehash.h" #endif +#include "BLF_translation.h" + #include "DNA_armature_types.h" #include "DNA_camera_types.h" #include "DNA_material_types.h" @@ -3554,9 +3556,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if (need_origindex) { /* Find original index of mpoly for this tessface. Options: - - Modified mesh; two-step look up from tessface -> modified mpoly -> original mpoly - - OR Tesselated mesh; look up from tessface -> mpoly - - OR Failsafe; tessface == mpoly. Could probably assert(false) in this case? */ + * - Modified mesh; two-step look up from tessface -> modified mpoly -> original mpoly + * - OR Tesselated mesh; look up from tessface -> mpoly + * - OR Failsafe; tessface == mpoly. Could probably assert(false) in this case? */ int *origindex; origindex = RE_vlakren_get_origindex(obr, vlr, 1); if (index_mf_to_mpoly && index_mp_to_orig) @@ -5214,7 +5216,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l tothalo= re->tothalo; if (!re->test_break(re->tbh)) { if (re->wrld.mode & WO_STARS) { - re->i.infostr= "Creating Starfield"; + re->i.infostr = IFACE_("Creating Starfield"); re->stats_draw(re->sdh, &re->i); RE_make_stars(re, NULL, NULL, NULL, NULL); } @@ -5223,7 +5225,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l init_camera_inside_volumes(re); - re->i.infostr= "Creating Shadowbuffers"; + re->i.infostr = IFACE_("Creating Shadowbuffers"); re->stats_draw(re->sdh, &re->i); /* SHADOW BUFFER */ @@ -5273,7 +5275,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l else re->i.convertdone = TRUE; - re->i.infostr= NULL; + re->i.infostr = NULL; re->stats_draw(re->sdh, &re->i); } @@ -5686,7 +5688,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned ListBase strandsurface; int step; - re->i.infostr= "Calculating previous frame vectors"; + re->i.infostr = IFACE_("Calculating previous frame vectors"); re->r.mode |= R_SPEED; speedvector_project(re, NULL, NULL, NULL); /* initializes projection code */ @@ -5705,7 +5707,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned if (!re->test_break(re->tbh)) { /* creates entire dbase */ - re->i.infostr= "Calculating next frame vectors"; + re->i.infostr = IFACE_("Calculating next frame vectors"); database_fromscene_vectors(re, sce, lay, +1); } @@ -5791,7 +5793,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned } } - re->i.infostr= NULL; + re->i.infostr = NULL; re->stats_draw(re->sdh, &re->i); } diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 9adae6f49ba..c5872c52e0f 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -38,6 +38,8 @@ #include "BLI_threads.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" /* for rectcpy */ @@ -512,7 +514,7 @@ void make_envmaps(Render *re) trace = (re->r.mode & R_RAYTRACE); re->r.mode &= ~R_RAYTRACE; - re->i.infostr = "Creating Environment maps"; + re->i.infostr = IFACE_("Creating Environment maps"); re->stats_draw(re->sdh, &re->i); /* 5 = hardcoded max recursion level */ diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 22a49bcbbc3..4a48b6cc5f4 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -385,6 +385,11 @@ void RE_engine_get_current_tiles(Render *re, int *total_tiles_r, rcti **tiles_r) *tiles_r = tiles; } +RenderData *RE_engine_get_render_data(Render *re) +{ + return &re->r; +} + /* Render */ int RE_engine_render(Render *re, int do_all) diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 12286fc9999..756fb098882 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -224,7 +224,7 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul } /* keep this before interpolation [#29761] */ - if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_USEALPHA) && tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { if ((tex->imaflag & TEX_CALCALPHA) == 0) { texres->talpha = TRUE; } @@ -274,14 +274,18 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul ibuf_get_color(col, ibuf, x+1, y); val2= (col[0]+col[1]+col[2]); } - else val2= val1; + else { + val2= val1; + } if (y<ibuf->y-1) { float col[4]; ibuf_get_color(col, ibuf, x, y+1); - val3= (col[0]+col[1]+col[2]); + val3 = (col[0]+col[1]+col[2]); + } + else { + val3 = val1; } - else val3= val1; /* do not mix up x and y here! */ texres->nor[0]= (val1-val2); @@ -289,13 +293,19 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul } } - if (texres->talpha) texres->tin= texres->ta; + if (texres->talpha) { + texres->tin = texres->ta; + } else if (tex->imaflag & TEX_CALCALPHA) { texres->ta = texres->tin = max_fff(texres->tr, texres->tg, texres->tb); } - else texres->ta= texres->tin= 1.0; + else { + texres->ta = texres->tin = 1.0; + } - if (tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta; + if (tex->flag & TEX_NEGALPHA) { + texres->ta = 1.0f - texres->ta; + } /* de-premul, this is being premulled in shade_input_do_shade() */ if (texres->ta!=1.0f && texres->ta>1e-4f) { @@ -829,7 +839,7 @@ static float EWA_WTS[EWA_MAXIDX + 1] = { #endif //static int ISNAN(float x) { return (x != x); } -static void radangle2imp(float a2, float b2, float th, float* A, float* B, float* C, float* F) +static void radangle2imp(float a2, float b2, float th, float *A, float *B, float *C, float *F) { float ct2 = cosf(th); const float st2 = 1.0f - ct2 * ct2; /* <- sin(th)^2 */ @@ -841,7 +851,7 @@ static void radangle2imp(float a2, float b2, float th, float* A, float* B, float } /* all tests here are done to make sure possible overflows are hopefully minimized */ -static void imp2radangle(float A, float B, float C, float F, float* a, float* b, float* th, float* ecc) +static void imp2radangle(float A, float B, float C, float F, float *a, float *b, float *th, float *ecc) { if (F <= 1e-5f) { /* use arbitrary major radius, zero minor, infinite eccentricity */ *a = sqrtf(A > C ? A : C); @@ -1098,7 +1108,7 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex /* mipmap test */ image_mipmap_test(tex, ibuf); - if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_USEALPHA) && tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { if ((tex->imaflag & TEX_CALCALPHA) == 0) texres->talpha = 1; } @@ -1514,7 +1524,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const /* mipmap test */ image_mipmap_test(tex, ibuf); - if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_USEALPHA) && tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { if ((tex->imaflag & TEX_CALCALPHA) == 0) { texres->talpha = TRUE; } @@ -1838,7 +1848,9 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const if (tex->imaflag & TEX_CALCALPHA) { texres->ta = texres->tin = texres->ta * max_fff(texres->tr, texres->tg, texres->tb); } - else texres->tin= texres->ta; + else { + texres->tin = texres->ta; + } if (tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta; diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 1c594ef7db2..50f9d6caff6 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -44,6 +44,8 @@ #include "BLI_threads.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_global.h" #include "BKE_scene.h" @@ -1257,7 +1259,7 @@ void make_occ_tree(Render *re) /* ugly, needed for occ_face */ R = *re; - re->i.infostr = "Occlusion preprocessing"; + re->i.infostr = IFACE_("Occlusion preprocessing"); re->stats_draw(re->sdh, &re->i); re->occlusiontree = tree = occ_tree_build(re); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ce18723b8c0..753eab4c6ab 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -55,6 +55,8 @@ #include "BLI_rand.h" #include "BLI_callbacks.h" +#include "BLF_translation.h" + #include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */ #include "BKE_camera.h" #include "BKE_global.h" @@ -160,22 +162,23 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs) mmap_used_memory = (mmap_in_use) / (1024.0 * 1024.0); megs_peak_memory = (peak_memory) / (1024.0 * 1024.0); - fprintf(stdout, "Fra:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->cfra, + fprintf(stdout, IFACE_("Fra:%d Mem:%.2fM (%.2fM, Peak %.2fM) "), rs->cfra, megs_used_memory, mmap_used_memory, megs_peak_memory); if (rs->curfield) - fprintf(stdout, "Field %d ", rs->curfield); + fprintf(stdout, IFACE_("Field %d "), rs->curfield); if (rs->curblur) - fprintf(stdout, "Blur %d ", rs->curblur); + fprintf(stdout, IFACE_("Blur %d "), rs->curblur); if (rs->infostr) { fprintf(stdout, "| %s", rs->infostr); } else { if (rs->tothalo) - fprintf(stdout, "Sce: %s Ve:%d Fa:%d Ha:%d La:%d", rs->scene_name, rs->totvert, rs->totface, rs->tothalo, rs->totlamp); + fprintf(stdout, IFACE_("Sce: %s Ve:%d Fa:%d Ha:%d La:%d"), + rs->scene_name, rs->totvert, rs->totface, rs->tothalo, rs->totlamp); else - fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scene_name, rs->totvert, rs->totface, rs->totlamp); + fprintf(stdout, IFACE_("Sce: %s Ve:%d Fa:%d La:%d"), rs->scene_name, rs->totvert, rs->totface, rs->totlamp); } BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS); @@ -458,13 +461,43 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer * re->i.starttime = PIL_check_seconds_timer(); re->r = *rd; /* hardcopy */ - + + if (source) { + /* reuse border flags from source renderer */ + re->r.mode &= ~(R_BORDER | R_CROP); + re->r.mode |= source->r.mode & (R_BORDER | R_CROP); + + /* dimensions shall be shared between all renderers */ + re->r.xsch = source->r.xsch; + re->r.ysch = source->r.ysch; + re->r.size = source->r.size; + } + re->winx = winx; re->winy = winy; - if (disprect) { + if (source && (source->r.mode & R_BORDER)) { + /* eeh, doesn't seem original bordered disprect is storing anywhere + * after insertion on black happening in do_render_fields_blur_3d(), + * so for now simply re-calculate disprect using border from source + * renderer (sergey) + */ + + re->disprect.xmin = source->r.border.xmin * winx; + re->disprect.xmax = source->r.border.xmax * winx; + + re->disprect.ymin = source->r.border.ymin * winy; + re->disprect.ymax = source->r.border.ymax * winy; + + re->rectx = BLI_rcti_size_x(&re->disprect); + re->recty = BLI_rcti_size_y(&re->disprect); + + /* copy border itself, since it could be used by external engines */ + re->r.border = source->r.border; + } + else if (disprect) { re->disprect = *disprect; - re->rectx = BLI_rcti_size_x(disprect); - re->recty = BLI_rcti_size_y(disprect); + re->rectx = BLI_rcti_size_x(&re->disprect); + re->recty = BLI_rcti_size_y(&re->disprect); } else { re->disprect.xmin = re->disprect.ymin = 0; @@ -826,7 +859,7 @@ static void print_part_stats(Render *re, RenderPart *pa) { char str[64]; - BLI_snprintf(str, sizeof(str), "%s, Part %d-%d", re->scene->id.name + 2, pa->nr, re->i.totpart); + BLI_snprintf(str, sizeof(str), IFACE_("%s, Part %d-%d"), re->scene->id.name + 2, pa->nr, re->i.totpart); re->i.infostr = str; re->stats_draw(re->sdh, &re->i); re->i.infostr = NULL; @@ -972,7 +1005,20 @@ static void threaded_tile_processor(Render *re) if ((g_break=re->test_break(re->tbh))) break; } - + + if (g_break) { + /* review the done queue and handle all the render parts, + * so no unfreed render result are lurking around + */ + BLI_thread_queue_nowait(donequeue); + while ((pa = BLI_thread_queue_pop(donequeue))) { + if (pa->result) { + render_result_free_list(&pa->fullresult, pa->result); + pa->result = NULL; + } + } + } + BLI_thread_queue_free(donequeue); BLI_thread_queue_free(workqueue); @@ -2091,7 +2137,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r render_result_exr_file_path(scene, "", 0, str); - if (BLI_file_is_writable(str) == 0) { + if (!BLI_file_is_writable(str)) { BKE_report(reports, RPT_ERROR, "Cannot save render buffers, check the temp default path"); return 0; } @@ -2532,7 +2578,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri /* remove touched file */ if (BKE_imtype_is_movie(scene->r.im_format.imtype) == 0) { if (scene->r.mode & R_TOUCH && BLI_exists(name) && BLI_file_size(name) == 0) { - BLI_delete(name, 0, 0); + BLI_delete(name, false, false); } } diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 3ca4015ff7b..d740780ec30 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -40,6 +40,8 @@ #include "BLI_kdopbvh.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_lattice.h" @@ -299,7 +301,7 @@ void make_pointdensities(Render *re) if (re->scene->r.scemode & R_PREVIEWBUTS) return; - re->i.infostr= "Caching Point Densities"; + re->i.infostr = IFACE_("Caching Point Densities"); re->stats_draw(re->sdh, &re->i); for (tex= re->main->tex.first; tex; tex= tex->id.next) { @@ -308,7 +310,7 @@ void make_pointdensities(Render *re) } } - re->i.infostr= NULL; + re->i.infostr = NULL; re->stats_draw(re->sdh, &re->i); } diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index fe23f31c6d7..88c0719fa59 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -47,6 +47,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_global.h" #include "BKE_node.h" @@ -400,7 +402,7 @@ static void makeraytree_single(Render *re) } if (!test_break(re)) { - re->i.infostr= "Raytree.. building"; + re->i.infostr = IFACE_("Raytree.. building"); re->stats_draw(re->sdh, &re->i); RE_rayobject_done(raytree); @@ -412,7 +414,7 @@ void makeraytree(Render *re) float min[3], max[3], sub[3]; int i; - re->i.infostr= "Raytree.. preparing"; + re->i.infostr = IFACE_("Raytree.. preparing"); re->stats_draw(re->sdh, &re->i); /* disable options not yet supported by octree, @@ -425,7 +427,7 @@ void makeraytree(Render *re) if (test_break(re)) { freeraytree(re); - re->i.infostr= "Raytree building canceled"; + re->i.infostr = IFACE_("Raytree building canceled"); re->stats_draw(re->sdh, &re->i); } else { @@ -446,7 +448,7 @@ void makeraytree(Render *re) re->maxdist = len_v3(sub); - re->i.infostr= "Raytree finished"; + re->i.infostr = IFACE_("Raytree finished"); re->stats_draw(re->sdh, &re->i); } diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index be1a3806e43..21e7b698610 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -35,13 +35,13 @@ #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" @@ -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 diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c index 6d0e15ea46e..9d6391ccb59 100644 --- a/source/blender/render/intern/source/sss.c +++ b/source/blender/render/intern/source/sss.c @@ -55,6 +55,8 @@ #include "BLI_ghash.h" #include "BLI_memarena.h" +#include "BLF_translation.h" + #include "PIL_time.h" #include "DNA_material_types.h" @@ -994,7 +996,7 @@ void make_sss_tree(Render *re) re->sss_hash= BLI_ghash_ptr_new("make_sss_tree gh"); - re->i.infostr= "SSS preprocessing"; + re->i.infostr = IFACE_("SSS preprocessing"); re->stats_draw(re->sdh, &re->i); for (mat= re->main->mat.first; mat; mat= mat->id.next) @@ -1016,7 +1018,7 @@ void free_sss(Render *re) if (re->sss_hash) { GHashIterator *it= BLI_ghashIterator_new(re->sss_hash); - while (!BLI_ghashIterator_isDone(it)) { + while (BLI_ghashIterator_notDone(it)) { sss_free_tree(BLI_ghashIterator_getValue(it)); BLI_ghashIterator_step(it); } diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index a9db197ed48..028217b8609 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -43,6 +43,8 @@ #include "BLI_voxel.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "PIL_time.h" #include "RE_shader_ext.h" @@ -400,10 +402,11 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi /* Displays progress every second */ if (time-lasttime>1.0) { char str[64]; - BLI_snprintf(str, sizeof(str), "Simulating multiple scattering: %d%%", (int)(100.0f * (c / total))); - re->i.infostr= str; + BLI_snprintf(str, sizeof(str), IFACE_("Simulating multiple scattering: %d%%"), + (int)(100.0f * (c / total))); + re->i.infostr = str; re->stats_draw(re->sdh, &re->i); - re->i.infostr= NULL; + re->i.infostr = NULL; lasttime= time; } } @@ -742,11 +745,12 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o time= PIL_check_seconds_timer(); if (time-lasttime>1.0) { char str[64]; - BLI_snprintf(str, sizeof(str), "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts))); - re->i.infostr= str; + BLI_snprintf(str, sizeof(str), IFACE_("Precaching volume: %d%%"), + (int)(100.0f * ((float)counter / (float)totparts))); + re->i.infostr = str; re->stats_draw(re->sdh, &re->i); - re->i.infostr= NULL; - lasttime= time; + re->i.infostr = NULL; + lasttime = time; } } @@ -784,7 +788,7 @@ void volume_precache(Render *re) ObjectInstanceRen *obi; VolumeOb *vo; - re->i.infostr= "Volume preprocessing"; + re->i.infostr = IFACE_("Volume preprocessing"); re->stats_draw(re->sdh, &re->i); for (vo= re->volumes.first; vo; vo= vo->next) { @@ -803,7 +807,7 @@ void volume_precache(Render *re) } } - re->i.infostr= NULL; + re->i.infostr = NULL; re->stats_draw(re->sdh, &re->i); } diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 92099060bf5..9990ad7e900 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -34,6 +34,10 @@ #include <stdlib.h> #include <stdio.h> +#ifdef WIN32 +#include "BLI_winstuff.h" +#endif + #include "MEM_guardedalloc.h" #include "BLI_math.h" @@ -41,6 +45,8 @@ #include "BLI_voxel.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" @@ -400,7 +406,7 @@ void make_voxeldata(struct Render *re) { Tex *tex; - re->i.infostr = "Loading voxel datasets"; + re->i.infostr = IFACE_("Loading voxel datasets"); re->stats_draw(re->sdh, &re->i); /* XXX: should be doing only textures used in this render */ |