fix for missing NULL check in init_render_texture() (possibly own fault), also remove some redundant code.

This commit is contained in:
Campbell Barton 2012-09-19 08:09:22 +00:00
parent 123a25c52b
commit f5d3e361ce
3 changed files with 6 additions and 8 deletions

@ -152,7 +152,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
/* don't consider two-edged faces */
if (efa->len < 3) {
if (UNLIKELY(efa->len < 3)) {
/* do nothing */
}

@ -380,7 +380,7 @@ BMFace *BM_face_create_ngon_vcloud(BMesh *bm, BMVert **vert_arr, int totv, int n
}
sub_v3_v3v3(far_vec, far, cent);
far_dist = len_v3(far_vec); /* real dist */
// far_dist = len_v3(far_vec); /* real dist */ /* UNUSED */
/* --- */

@ -98,7 +98,7 @@ static void init_render_texture(Render *re, Tex *tex)
{
/* imap test */
if (tex->ima && ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
BKE_image_user_frame_calc(&tex->iuser, re->r.cfra, re?re->flag & R_SEC_FIELD:0);
BKE_image_user_frame_calc(&tex->iuser, re ? re->r.cfra : 0, re ? re->flag & R_SEC_FIELD:0);
}
else if (tex->type==TEX_ENVMAP) {
@ -2760,11 +2760,9 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float col_
/* stencil maps on the texture control slider, not texture intensity value */
/* convert RGB to intensity if intensity info isn't provided */
if (!(rgbnor & TEX_INT)) {
if (rgbnor & TEX_RGB) {
if (texres.talpha) texres.tin = texres.ta;
else texres.tin = rgb_to_grayscale(&texres.tr);
}
if (rgbnor & TEX_RGB) {
if (texres.talpha) texres.tin = texres.ta;
else texres.tin = rgb_to_grayscale(&texres.tr);
}
if ((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) {