- remove redundant NULL checks on old code where it would crash if the result was NULL later on.
- add some missing NULL checks.
ysize= block->maxy - block->miny+4;
/*aspect/= (float)xsize;*/ /*UNUSED*/
- if(but) {
+ {
int left=0, right=0, top=0, down=0;
int winx, winy;
// int offscreen;
Scene *scene= CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
- int mode_orig = ob->mode;
+ int mode_orig = ob ? ob->mode : 0;
if(!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md))
return OPERATOR_CANCELLED;
static int project_paint_occlude_ptv_clip(
const ProjPaintState *ps, const MFace *mf,
- float pt[3], float v1[3], float v2[3], float v3[3],
+ float pt[3], float v1[4], float v2[4], float v3[4],
const int side )
{
float w[3], wco[3];
/* TODO: as sculpt and other paint modes are unified, this
separation will go away */
if(stroke->vc.obact->sculpt) {
- float delta[3];
+ float delta[2];
brush_jitter_pos(brush, mouse_in, mouse);
brush_jitter_pos isn't written in the best way to
be reused here */
if(brush->flag & BRUSH_JITTER_PRESSURE) {
- sub_v3_v3v3(delta, mouse, mouse_in);
- mul_v3_fl(delta, pressure);
- add_v3_v3v3(mouse, mouse_in, delta);
+ sub_v2_v2v2(delta, mouse, mouse_in);
+ mul_v2_fl(delta, pressure);
+ add_v2_v2v2(mouse, mouse_in, delta);
}
}
- else
- copy_v3_v3(mouse, mouse_in);
+ else {
+ copy_v2_v2(mouse, mouse_in);
+ }
/* TODO: can remove the if statement once all modes have this */
if(stroke->get_location)
copy_v3_v3(cache->true_location, cache->orig_grab_location);
sd->draw_anchored = 1;
- copy_v3_v3(sd->anchored_initial_mouse, cache->initial_mouse);
+ copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse);
sd->anchored_size = cache->pixel_radius;
}
}
SpaceFile *sfile= CTX_wm_space_file(C);
FileSelectParams *params = ED_fileselect_get_params(sfile);
int numfiles = filelist_numfiles(sfile->files);
+ struct direntry* file;
/* make the selected file active */
- if ( (selected_idx >= 0) && (selected_idx < numfiles)) {
- struct direntry* file = filelist_file(sfile->files, selected_idx);
+ if ( (selected_idx >= 0) &&
+ (selected_idx < numfiles) &&
+ (file= filelist_file(sfile->files, selected_idx)))
+ {
params->active_file = selected_idx;
- if(file && S_ISDIR(file->type)) {
+ if(S_ISDIR(file->type)) {
/* the path is too long and we are not going up! */
- if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX )
- {
+ if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) {
// XXX error("Path too long, cannot enter this directory");
- } else {
- if (strcmp(file->relname, "..")==0) {
- /* avoids /../../ */
- BLI_parent_dir(params->dir);
- } else {
+ }
+ else {
+ if (strcmp(file->relname, "..")==0) {
+ /* avoids /../../ */
+ BLI_parent_dir(params->dir);
+ }
+ else {
BLI_cleanup_dir(G.main->name, params->dir);
strcat(params->dir, file->relname);
BLI_add_slash(params->dir);
retval = FILE_SELECT_DIR;
}
}
- else if (file)
- {
+ else {
if (file->relname) {
BLI_strncpy(params->file, file->relname, FILE_MAXFILE);
}
if (pixels)
MEM_freeN(pixels);
- if (tex)
- GPU_texture_unbind(tex);
+ GPU_texture_unbind(tex);
return tex;
}
hbuf= ibuf->mipmap[curmap];
hbuf->miplevel= curmap+1;
- if(!hbuf || (hbuf->x <= 2 && hbuf->y <= 2))
+ if(hbuf->x <= 2 && hbuf->y <= 2)
break;
curmap++;
}
- ibuf->ftype = IMAGIC;
- ibuf->profile = IB_PROFILE_SRGB;
-
- test_endian_zbuf(ibuf);
-
if (ibuf) {
- if (ibuf->rect)
+ ibuf->ftype = IMAGIC;
+ ibuf->profile = IB_PROFILE_SRGB;
+
+ test_endian_zbuf(ibuf);
+
+ if (ibuf->rect) {
IMB_convert_rgba_to_abgr(ibuf);
+ }
}
return(ibuf);
}
}
-void texture_evaluate(struct Tex *tex, float value[3], float color_r[3])
+void texture_evaluate(struct Tex *tex, float value[3], float color_r[4])
{
TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
multitex_ext(tex, value, NULL, NULL, 1, &texres);
shi->vcol[2]= 1.0f;
shi->vcol[3]= 1.0f;
}
- if(tface && tface->tpage)
+ if(tface->tpage) {
render_realtime_texture(shi, tface->tpage);
+ }
}
return 1;
}
-int testclip(const float v[3])
+int testclip(const float v[4])
{
float abs4; /* WATCH IT: this function should do the same as cliptestf, otherwise troubles in zbufclip()*/
short c=0;