forked from bartvdbraak/blender
fix for 2 errors where the 2d arrays were used as 3d. (out of bounds read).
also minor code cleanup.
This commit is contained in:
parent
5ff0daf1ac
commit
962865d19f
@ -532,7 +532,7 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
|
||||
/* Get strength by feeding the vertex
|
||||
* location directly into a texture */
|
||||
hasrgb = externtex(mtex, point, &intensity,
|
||||
rgba, rgba + 1, rgba + 2, rgba + 3, 0, pool);
|
||||
rgba, rgba + 1, rgba + 2, rgba + 3, 0, pool);
|
||||
}
|
||||
else {
|
||||
float rotation = -mtex->rot;
|
||||
@ -587,7 +587,7 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
|
||||
co[2] = 0.0f;
|
||||
|
||||
hasrgb = externtex(mtex, co, &intensity,
|
||||
rgba, rgba + 1, rgba + 2, rgba + 3, 0, pool);
|
||||
rgba, rgba + 1, rgba + 2, rgba + 3, 0, pool);
|
||||
}
|
||||
|
||||
intensity += br->texture_sample_bias;
|
||||
|
@ -3902,10 +3902,13 @@ static void *do_projectpaint_thread(void *ph_v)
|
||||
sub_v2_v2v2(samplecos, projPixel->projCoSS, pos);
|
||||
}
|
||||
/* taking 3d copy to account for 3D mapping too. It gets concatenated during sampling */
|
||||
else if (mtex->brush_map_mode == MTEX_MAP_MODE_3D)
|
||||
else if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
|
||||
copy_v3_v3(samplecos, projPixel->worldCoSS);
|
||||
else
|
||||
copy_v3_v3(samplecos, projPixel->projCoSS);
|
||||
}
|
||||
else {
|
||||
copy_v2_v2(samplecos, projPixel->projCoSS);
|
||||
samplecos[2] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (falloff > 0.0f) {
|
||||
|
@ -973,7 +973,8 @@ static float tex_strength(SculptSession *ss, Brush *br,
|
||||
avg += br->texture_sample_bias;
|
||||
}
|
||||
else {
|
||||
avg = BKE_brush_sample_tex_3D(scene, br, point_2d, rgba, ss->tex_pool);
|
||||
const float point_3d[3] = {point_2d[0], point_2d[1], 0.0f};
|
||||
avg = BKE_brush_sample_tex_3D(scene, br, point_3d, rgba, ss->tex_pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ static void restrictbutton_recursive_ebone(bContext *C, EditBone *ebone_parent,
|
||||
ebone->flag |= flag;
|
||||
}
|
||||
else {
|
||||
ebone->flag &= ~flag;
|
||||
ebone->flag &= ~flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -160,7 +160,7 @@ static void restrictbutton_recursive_bone(bContext *C, bArmature *arm, Bone *bon
|
||||
bone->flag |= flag;
|
||||
}
|
||||
else {
|
||||
bone->flag &= ~flag;
|
||||
bone->flag &= ~flag;
|
||||
}
|
||||
restrictbutton_recursive_bone(C, arm, bone, flag, set_flag);
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera
|
||||
}
|
||||
|
||||
/* only meant for timer usage */
|
||||
static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const const wmEvent *event)
|
||||
static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D *rv3d = CTX_wm_region_view3d(C);
|
||||
|
@ -1128,7 +1128,7 @@ static void shader_print_errors(const char *task, char *log, const char *code)
|
||||
fprintf(stderr, "%s\n", log);
|
||||
}
|
||||
|
||||
static const char *gpu_shader_standard_defines()
|
||||
static const char *gpu_shader_standard_defines(void)
|
||||
{
|
||||
/* some useful defines to detect GPU type */
|
||||
if(GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY))
|
||||
|
Loading…
Reference in New Issue
Block a user