Merging r48470 through r48489 from trunk into soc-2011-tomato

This commit is contained in:
Sergey Sharybin
2012-07-02 11:29:55 +00:00
8 changed files with 71 additions and 14 deletions

View File

@@ -211,6 +211,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
short verts_fixed = FALSE;
short vert_weights_fixed = FALSE;
int msel_fixed = FALSE;
int do_edge_recalc = FALSE;
@@ -754,8 +755,6 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
}
PRINT("BKE_mesh_validate: finished\n\n");
# undef REMOVE_EDGE_TAG
# undef IS_REMOVED_EDGE
# undef REMOVE_LOOP_TAG
@@ -779,7 +778,51 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
}
return (verts_fixed || vert_weights_fixed || do_polyloop_free || do_edge_free || do_edge_recalc);
if (mesh && mesh->mselect) {
MSelect *msel;
int free_msel = FALSE;
for (i = 0, msel = mesh->mselect; i < mesh->totselect; i++, msel++) {
int tot_elem;
if (msel->index < 0) {
PRINT("Mesh select element %d type %d index is negative, "
"resetting selection stack.\n", i, msel->type);
free_msel = TRUE;
break;
}
switch (msel->type) {
case ME_VSEL:
tot_elem = mesh->totvert;
break;
case ME_ESEL:
tot_elem = mesh->totedge;
break;
case ME_FSEL:
tot_elem = mesh->totface;
break;
}
if (msel->index > tot_elem) {
PRINT("Mesh select element %d type %d index %d is larger than data array size %d, "
"resetting selection stack.\n", i, msel->type, msel->index, tot_elem);
free_msel = TRUE;
break;
}
}
if (free_msel) {
MEM_freeN(mesh->mselect);
mesh->mselect = NULL;
mesh->totselect = 0;
}
}
PRINT("BKE_mesh_validate: finished\n\n");
return (verts_fixed || vert_weights_fixed || do_polyloop_free || do_edge_free || do_edge_recalc || msel_fixed);
}
static int mesh_validate_customdata(CustomData *data, short do_verbose, const short do_fixes)

View File

@@ -65,7 +65,7 @@ int BLI_is_dir(const char *path);
int BLI_is_file(const char *path);
void BLI_dir_create_recursive(const char *dir);
double BLI_dir_free_space(const char *dir);
char *BLI_current_working_dir(char *dir, const int maxlen);
char *BLI_current_working_dir(char *dir, const size_t maxlen);
unsigned int BLI_dir_contents(const char *dir, struct direntry **filelist);

View File

@@ -102,7 +102,7 @@ static struct ListBase dirbase_ = {NULL, NULL};
static struct ListBase *dirbase = &dirbase_;
/* can return NULL when the size is not big enough */
char *BLI_current_working_dir(char *dir, const int maxncpy)
char *BLI_current_working_dir(char *dir, const size_t maxncpy)
{
const char *pwd = getenv("PWD");
if (pwd) {

View File

@@ -5909,11 +5909,20 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
}
}
else if (sl->spacetype == SPACE_SEQ) {
/* grease pencil data is not a direct data and can't be linked from direct_link*
* functions, it should be linked from lib_link* funcrions instead
*
* otherwise it'll lead to lost grease data on open because it'll likely be
* read from file after all other users of grease pencil and newdataadr would
* simple return NULL here (sergey)
*/
#if 0
SpaceSeq *sseq = (SpaceSeq *)sl;
if (sseq->gpd) {
sseq->gpd = newdataadr(fd, sseq->gpd);
direct_link_gpencil(fd, sseq->gpd);
}
#endif
}
else if (sl->spacetype == SPACE_BUTS) {
SpaceButs *sbuts = (SpaceButs *)sl;

View File

@@ -616,13 +616,15 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
CLAMP(ss_lvl, 0, 6);
smd.levels = smd.renderLevels = ss_lvl;
smd.flags |= eSubsurfModifierFlag_SubsurfUv;
if (ss_lvl > 0) {
smd.levels = smd.renderLevels = ss_lvl;
smd.flags |= eSubsurfModifierFlag_SubsurfUv;
if (bkr->simple)
smd.subdivType = ME_SIMPLE_SUBSURF;
if (bkr->simple)
smd.subdivType = ME_SIMPLE_SUBSURF;
height_data->ssdm = subsurf_make_derived_from_derived(bkr->lores_dm, &smd, NULL, 0);
height_data->ssdm = subsurf_make_derived_from_derived(bkr->lores_dm, &smd, NULL, 0);
}
}
height_data->origindex = lodm->getTessFaceDataArray(lodm, CD_ORIGINDEX);

View File

@@ -2694,8 +2694,11 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
sound_remove_scene_sound(scene, seq_act->scene_sound);
sound_remove_scene_sound(scene, seq_other->scene_sound);
if (seq_act->scene_sound)
sound_remove_scene_sound(scene, seq_act->scene_sound);
if (seq_other->scene_sound)
sound_remove_scene_sound(scene, seq_other->scene_sound);
seq_act->scene_sound = NULL;
seq_other->scene_sound = NULL;

View File

@@ -64,7 +64,7 @@
#include <io.h>
#endif
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
#include "BLI_blenlib.h" /* BLI_remlink BLI_file_descriptor_size BLI_addtail
* BLI_countlist BLI_stringdec */
#include "BLI_utildefines.h"
#include "BLI_math_base.h"

View File

@@ -56,7 +56,7 @@ void wm_window_raise (wmWindow *win);
void wm_window_lower (wmWindow *win);
void wm_window_set_size (wmWindow *win, int width, int height);
void wm_window_get_size (wmWindow *win, int *width_r, int *height_r);
void wm_window_get_size_ghost (wmWindow *win, int *width_r, int *height_r);
void wm_window_get_size_ghost(wmWindow *win, int *width_r, int *height_r);
void wm_window_get_position (wmWindow *win, int *posx_r, int *posy_r);
void wm_window_swap_buffers (wmWindow *win);