Cleanup: style

This commit is contained in:
2018-11-30 14:20:41 +11:00
parent dd8469608b
commit 0b044a4ab2
10 changed files with 809 additions and 799 deletions

View File

@@ -106,7 +106,7 @@ BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize)
void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
{
FileData *fd = (FileData *) bh;
FileData *fd = (FileData *)bh;
BHead *bhead;
fprintf(fp, "[\n");
@@ -144,7 +144,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
*/
LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, int *tot_names)
{
FileData *fd = (FileData *) bh;
FileData *fd = (FileData *)bh;
LinkNode *names = NULL;
BHead *bhead;
int tot = 0;
@@ -174,7 +174,7 @@ LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype,
*/
LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *tot_prev)
{
FileData *fd = (FileData *) bh;
FileData *fd = (FileData *)bh;
LinkNode *previews = NULL;
BHead *bhead;
int looking = 0;
@@ -210,11 +210,11 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
if (prv) {
memcpy(new_prv, prv, sizeof(PreviewImage));
if (prv->rect[0] && prv->w[0] && prv->h[0]) {
unsigned int *rect = NULL;
size_t len = new_prv->w[0] * new_prv->h[0] * sizeof(unsigned int);
uint *rect = NULL;
size_t len = new_prv->w[0] * new_prv->h[0] * sizeof(uint);
new_prv->rect[0] = MEM_callocN(len, __func__);
bhead = blo_nextbhead(fd, bhead);
rect = (unsigned int *)(bhead + 1);
rect = (uint *)(bhead + 1);
BLI_assert(len == bhead->len);
memcpy(new_prv->rect[0], rect, len);
}
@@ -227,11 +227,11 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
}
if (prv->rect[1] && prv->w[1] && prv->h[1]) {
unsigned int *rect = NULL;
size_t len = new_prv->w[1] * new_prv->h[1] * sizeof(unsigned int);
uint *rect = NULL;
size_t len = new_prv->w[1] * new_prv->h[1] * sizeof(uint);
new_prv->rect[1] = MEM_callocN(len, __func__);
bhead = blo_nextbhead(fd, bhead);
rect = (unsigned int *)(bhead + 1);
rect = (uint *)(bhead + 1);
BLI_assert(len == bhead->len);
memcpy(new_prv->rect[1], rect, len);
}
@@ -270,7 +270,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
*/
LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
{
FileData *fd = (FileData *) bh;
FileData *fd = (FileData *)bh;
GSet *gathered = BLI_gset_ptr_new("linkable_groups gh");
LinkNode *names = NULL;
BHead *bhead;
@@ -302,7 +302,7 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
*/
void BLO_blendhandle_close(BlendHandle *bh)
{
FileData *fd = (FileData *) bh;
FileData *fd = (FileData *)bh;
blo_freefiledata(fd);
}

File diff suppressed because it is too large Load Diff

View File

@@ -57,7 +57,7 @@
static int handle_read_msb_int(int handle)
{
unsigned char buf[4];
uchar buf[4];
if (read(handle, buf, 4) != 4)
return -1;

View File

@@ -97,7 +97,7 @@ void BLO_memfile_merge(MemFile *first, MemFile *second)
}
void memfile_chunk_add(
MemFile *memfile, const char *buf, unsigned int size,
MemFile *memfile, const char *buf, uint size,
MemFileChunk **compchunk_step)
{
MemFileChunk *curchunk = MEM_mallocN(sizeof(MemFileChunk), "MemFileChunk");

View File

@@ -108,11 +108,11 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
/* initialize view2d data for header region, to allow panning */
/* is copy from ui_view2d.c */
ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
ar->v2d.keepofs = V2D_LOCKOFS_Y;
ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
ar->v2d.flag = (V2D_PIXELOFS_X|V2D_PIXELOFS_Y);
ar->v2d.align = V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y;
ar->v2d.flag = (V2D_PIXELOFS_X | V2D_PIXELOFS_Y);
}
static void sequencer_init_preview_region(ARegion *ar)
@@ -151,7 +151,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
BLI_addtail(lb, ar);
ar->regiontype = RGN_TYPE_CHANNELS;
ar->alignment = RGN_ALIGN_LEFT;
ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
/* for some reason, this doesn't seem to go auto like for NLA... */
ar = MEM_callocN(sizeof(ARegion), "area region from do_versions");
@@ -193,7 +193,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
BLI_addtail(lb, ar);
ar->regiontype = RGN_TYPE_UI;
ar->alignment = RGN_ALIGN_LEFT;
ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
/* temporarily hide it */
ar->flag = RGN_FLAG_HIDDEN;
@@ -210,7 +210,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->alignment = RGN_ALIGN_TOP;
break;
case SPACE_SEQ:
ar_main = (ARegion*) lb->first;
ar_main = (ARegion *)lb->first;
for (; ar_main; ar_main = ar_main->next) {
if (ar_main->regiontype == RGN_TYPE_WINDOW)
break;
@@ -233,7 +233,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
BLI_addtail(lb, ar);
ar->regiontype = RGN_TYPE_TOOL_PROPS;
ar->alignment = RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
ar->flag = RGN_FLAG_HIDDEN;
/* buttons/list view */
@@ -273,145 +273,145 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
break;
case SPACE_OUTLINER:
{
SpaceOops *soops = (SpaceOops *)sl;
{
SpaceOops *soops = (SpaceOops *)sl;
memcpy(&ar->v2d, &soops->v2d, sizeof(View2D));
memcpy(&ar->v2d, &soops->v2d, sizeof(View2D));
ar->v2d.scroll &= ~V2D_SCROLL_LEFT;
ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
ar->v2d.keepzoom |= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT);
ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
//ar->v2d.flag |= V2D_IS_INITIALISED;
}
ar->v2d.scroll &= ~V2D_SCROLL_LEFT;
ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
ar->v2d.keepzoom |= (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_KEEPASPECT);
ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
//ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
case SPACE_TIME:
{
SpaceTime *stime = (SpaceTime *)sl;
memcpy(&ar->v2d, &stime->v2d, sizeof(View2D));
{
SpaceTime *stime = (SpaceTime *)sl;
memcpy(&ar->v2d, &stime->v2d, sizeof(View2D));
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
ar->v2d.keepofs |= V2D_LOCKOFS_Y;
ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
ar->v2d.tot.ymin = ar->v2d.cur.ymin = -10.0;
ar->v2d.min[1] = ar->v2d.max[1] = 20.0;
}
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
ar->v2d.keepofs |= V2D_LOCKOFS_Y;
ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
ar->v2d.tot.ymin = ar->v2d.cur.ymin = -10.0;
ar->v2d.min[1] = ar->v2d.max[1] = 20.0;
break;
}
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)sl;
memcpy(&ar->v2d, &sipo->v2d, sizeof(View2D));
{
SpaceIpo *sipo = (SpaceIpo *)sl;
memcpy(&ar->v2d, &sipo->v2d, sizeof(View2D));
/* init mainarea view2d */
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL);
/* init mainarea view2d */
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_SCALE_VERTICAL);
ar->v2d.min[0] = FLT_MIN;
ar->v2d.min[1] = FLT_MIN;
ar->v2d.min[0] = FLT_MIN;
ar->v2d.min[1] = FLT_MIN;
ar->v2d.max[0] = MAXFRAMEF;
ar->v2d.max[1] = FLT_MAX;
ar->v2d.max[0] = MAXFRAMEF;
ar->v2d.max[1] = FLT_MAX;
//ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
//ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
case SPACE_NLA:
{
SpaceNla *snla = (SpaceNla *)sl;
memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
{
SpaceNla *snla = (SpaceNla *)sl;
memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
ar->v2d.tot.ymax = 0.0f;
ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
ar->v2d.tot.ymax = 0.0f;
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
ar->v2d.align = V2D_ALIGN_NO_POS_Y;
ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
break;
}
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
ar->v2d.align = V2D_ALIGN_NO_POS_Y;
ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
break;
}
case SPACE_ACTION:
{
SpaceAction *saction = (SpaceAction *) sl;
{
SpaceAction *saction = (SpaceAction *)sl;
/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
ar->v2d.tot.xmin = -20.0f;
ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
ar->v2d.tot.xmax = (float)((sa->winx > 120) ? (sa->winx) : 120);
ar->v2d.tot.ymax = 0.0f;
/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
ar->v2d.tot.xmin = -20.0f;
ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
ar->v2d.tot.xmax = (float)((sa->winx > 120) ? (sa->winx) : 120);
ar->v2d.tot.ymax = 0.0f;
ar->v2d.cur = ar->v2d.tot;
ar->v2d.cur = ar->v2d.tot;
ar->v2d.min[0] = 0.0f;
ar->v2d.min[1] = 0.0f;
ar->v2d.min[0] = 0.0f;
ar->v2d.min[1] = 0.0f;
ar->v2d.max[0] = MAXFRAMEF;
ar->v2d.max[1] = FLT_MAX;
ar->v2d.max[0] = MAXFRAMEF;
ar->v2d.max[1] = FLT_MAX;
ar->v2d.minzoom = 0.01f;
ar->v2d.maxzoom = 50;
ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
ar->v2d.keepzoom = V2D_LOCKZOOM_Y;
ar->v2d.align = V2D_ALIGN_NO_POS_Y;
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
ar->v2d.minzoom = 0.01f;
ar->v2d.maxzoom = 50;
ar->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
ar->v2d.keepzoom = V2D_LOCKZOOM_Y;
ar->v2d.align = V2D_ALIGN_NO_POS_Y;
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
/* for old files with ShapeKey editors open + an action set, clear the action as
* it doesn't make sense in the new system (i.e. violates concept that ShapeKey edit
* only shows ShapeKey-rooted actions only)
*/
if (saction->mode == SACTCONT_SHAPEKEY)
saction->action = NULL;
break;
}
/* for old files with ShapeKey editors open + an action set, clear the action as
* it doesn't make sense in the new system (i.e. violates concept that ShapeKey edit
* only shows ShapeKey-rooted actions only)
*/
if (saction->mode == SACTCONT_SHAPEKEY)
saction->action = NULL;
break;
}
case SPACE_SEQ:
{
SpaceSeq *sseq = (SpaceSeq *)sl;
memcpy(&ar->v2d, &sseq->v2d, sizeof(View2D));
{
SpaceSeq *sseq = (SpaceSeq *)sl;
memcpy(&ar->v2d, &sseq->v2d, sizeof(View2D));
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL);
ar->v2d.align = V2D_ALIGN_NO_NEG_Y;
ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_SCALE_VERTICAL);
ar->v2d.align = V2D_ALIGN_NO_NEG_Y;
ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
case SPACE_NODE:
{
SpaceNode *snode = (SpaceNode *)sl;
memcpy(&ar->v2d, &snode->v2d, sizeof(View2D));
{
SpaceNode *snode = (SpaceNode *)sl;
memcpy(&ar->v2d, &snode->v2d, sizeof(View2D));
ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
ar->v2d.keepzoom = V2D_LIMITZOOM|V2D_KEEPASPECT;
break;
}
ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
ar->v2d.keepzoom = V2D_LIMITZOOM | V2D_KEEPASPECT;
break;
}
case SPACE_BUTS:
{
SpaceButs *sbuts = (SpaceButs *)sl;
memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
{
SpaceButs *sbuts = (SpaceButs *)sl;
memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
break;
}
ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
break;
}
case SPACE_FILE:
{
// SpaceFile *sfile = (SpaceFile *)sl;
ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0;
ar->v2d.tot.xmax = ar->winx;
ar->v2d.tot.ymax = ar->winy;
ar->v2d.cur = ar->v2d.tot;
ar->regiontype = RGN_TYPE_WINDOW;
ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
break;
}
{
// SpaceFile *sfile = (SpaceFile *)sl;
ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0;
ar->v2d.tot.xmax = ar->winx;
ar->v2d.tot.ymax = ar->winy;
ar->v2d.cur = ar->v2d.tot;
ar->regiontype = RGN_TYPE_WINDOW;
ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
break;
}
case SPACE_TEXT:
{
SpaceText *st = (SpaceText *)sl;
st->flags |= ST_FIND_WRAP;
}
{
SpaceText *st = (SpaceText *)sl;
st->flags |= ST_FIND_WRAP;
}
//case SPACE_XXX: // FIXME... add other ones
// memcpy(&ar->v2d, &((SpaceXxx *)sl)->v2d, sizeof(View2D));
// break;
@@ -435,13 +435,13 @@ static void do_versions_windowmanager_2_50(bScreen *screen)
/* space imageselect is deprecated */
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_IMASEL)
sl->spacetype = SPACE_EMPTY; /* spacedata then matches */
sl->spacetype = SPACE_EMPTY; /* spacedata then matches */
}
/* space sound is deprecated */
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_SOUND)
sl->spacetype = SPACE_EMPTY; /* spacedata then matches */
sl->spacetype = SPACE_EMPTY; /* spacedata then matches */
}
/* it seems to be possible in 2.5 to have this saved, filewindow probably */
@@ -464,7 +464,7 @@ static void versions_gpencil_add_main(ListBase *lb, ID *id, const char *name)
BLI_addtail(lb, id);
id->us = 1;
id->flag = LIB_FAKEUSER;
*( (short *)id->name )= ID_GD;
*( (short *)id->name) = ID_GD;
new_id(lb, id, name);
/* alphabetic insertion: is in new_id */
@@ -482,29 +482,29 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen)
for (sa = screen->areabase.first; sa; sa = sa->next) {
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D*) sl;
View3D *v3d = (View3D *)sl;
if (v3d->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)v3d->gpd, "GPencil View3D");
v3d->gpd = NULL;
}
}
else if (sl->spacetype == SPACE_NODE) {
SpaceNode *snode = (SpaceNode *) sl;
SpaceNode *snode = (SpaceNode *)sl;
if (snode->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)snode->gpd, "GPencil Node");
snode->gpd = NULL;
}
}
else if (sl->spacetype == SPACE_SEQ) {
SpaceSeq *sseq = (SpaceSeq *) sl;
SpaceSeq *sseq = (SpaceSeq *)sl;
if (sseq->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)sseq->gpd, "GPencil Node");
sseq->gpd = NULL;
}
}
else if (sl->spacetype == SPACE_IMAGE) {
SpaceImage *sima = (SpaceImage *) sl;
#if 0 /* see comment on r28002 */
SpaceImage *sima = (SpaceImage *)sl;
#if 0 /* see comment on r28002 */
if (sima->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)sima->gpd, "GPencil Image");
sima->gpd = NULL;
@@ -538,45 +538,45 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype)
if (neg & MAP_NORM) mtex->norfac = -mtex->norfac;
if (neg & MAP_WARP) mtex->warpfac = -mtex->warpfac;
mtex->colspecfac = (neg & MAP_COLSPEC)? -colfac: colfac;
mtex->mirrfac = (neg & MAP_COLMIR)? -colfac: colfac;
mtex->alphafac = (neg & MAP_ALPHA)? -varfac: varfac;
mtex->difffac = (neg & MAP_REF)? -varfac: varfac;
mtex->specfac = (neg & MAP_SPEC)? -varfac: varfac;
mtex->emitfac = (neg & MAP_EMIT)? -varfac: varfac;
mtex->hardfac = (neg & MAP_HAR)? -varfac: varfac;
mtex->raymirrfac = (neg & MAP_RAYMIRR)? -varfac: varfac;
mtex->translfac = (neg & MAP_TRANSLU)? -varfac: varfac;
mtex->ambfac = (neg & MAP_AMB)? -varfac: varfac;
mtex->colemitfac = (neg & MAP_EMISSION_COL)? -colfac: colfac;
mtex->colreflfac = (neg & MAP_REFLECTION_COL)? -colfac: colfac;
mtex->coltransfac = (neg & MAP_TRANSMISSION_COL)? -colfac: colfac;
mtex->densfac = (neg & MAP_DENSITY)? -varfac: varfac;
mtex->scatterfac = (neg & MAP_SCATTERING)? -varfac: varfac;
mtex->reflfac = (neg & MAP_REFLECTION)? -varfac: varfac;
mtex->colspecfac = (neg & MAP_COLSPEC) ? -colfac : colfac;
mtex->mirrfac = (neg & MAP_COLMIR) ? -colfac : colfac;
mtex->alphafac = (neg & MAP_ALPHA) ? -varfac : varfac;
mtex->difffac = (neg & MAP_REF) ? -varfac : varfac;
mtex->specfac = (neg & MAP_SPEC) ? -varfac : varfac;
mtex->emitfac = (neg & MAP_EMIT) ? -varfac : varfac;
mtex->hardfac = (neg & MAP_HAR) ? -varfac : varfac;
mtex->raymirrfac = (neg & MAP_RAYMIRR) ? -varfac : varfac;
mtex->translfac = (neg & MAP_TRANSLU) ? -varfac : varfac;
mtex->ambfac = (neg & MAP_AMB) ? -varfac : varfac;
mtex->colemitfac = (neg & MAP_EMISSION_COL) ? -colfac : colfac;
mtex->colreflfac = (neg & MAP_REFLECTION_COL) ? -colfac : colfac;
mtex->coltransfac = (neg & MAP_TRANSMISSION_COL) ? -colfac : colfac;
mtex->densfac = (neg & MAP_DENSITY) ? -varfac : varfac;
mtex->scatterfac = (neg & MAP_SCATTERING) ? -varfac : varfac;
mtex->reflfac = (neg & MAP_REFLECTION) ? -varfac : varfac;
mtex->timefac = (neg & MAP_PA_TIME)? -varfac: varfac;
mtex->lengthfac = (neg & MAP_PA_LENGTH)? -varfac: varfac;
mtex->clumpfac = (neg & MAP_PA_CLUMP)? -varfac: varfac;
mtex->kinkfac = (neg & MAP_PA_KINK)? -varfac: varfac;
mtex->roughfac = (neg & MAP_PA_ROUGH)? -varfac: varfac;
mtex->padensfac = (neg & MAP_PA_DENS)? -varfac: varfac;
mtex->lifefac = (neg & MAP_PA_LIFE)? -varfac: varfac;
mtex->sizefac = (neg & MAP_PA_SIZE)? -varfac: varfac;
mtex->ivelfac = (neg & MAP_PA_IVEL)? -varfac: varfac;
mtex->timefac = (neg & MAP_PA_TIME) ? -varfac : varfac;
mtex->lengthfac = (neg & MAP_PA_LENGTH) ? -varfac : varfac;
mtex->clumpfac = (neg & MAP_PA_CLUMP) ? -varfac : varfac;
mtex->kinkfac = (neg & MAP_PA_KINK) ? -varfac : varfac;
mtex->roughfac = (neg & MAP_PA_ROUGH) ? -varfac : varfac;
mtex->padensfac = (neg & MAP_PA_DENS) ? -varfac : varfac;
mtex->lifefac = (neg & MAP_PA_LIFE) ? -varfac : varfac;
mtex->sizefac = (neg & MAP_PA_SIZE) ? -varfac : varfac;
mtex->ivelfac = (neg & MAP_PA_IVEL) ? -varfac : varfac;
mtex->shadowfac = (neg & LAMAP_SHAD)? -colfac: colfac;
mtex->shadowfac = (neg & LAMAP_SHAD) ? -colfac : colfac;
mtex->zenupfac = (neg & WOMAP_ZENUP)? -colfac: colfac;
mtex->zendownfac = (neg & WOMAP_ZENDOWN)? -colfac: colfac;
mtex->blendfac = (neg & WOMAP_BLEND)? -varfac: varfac;
mtex->zenupfac = (neg & WOMAP_ZENUP) ? -colfac : colfac;
mtex->zendownfac = (neg & WOMAP_ZENDOWN) ? -colfac : colfac;
mtex->blendfac = (neg & WOMAP_BLEND) ? -varfac : varfac;
if (idtype == ID_MA)
mtex->colfac = (neg & MAP_COL)? -colfac: colfac;
mtex->colfac = (neg & MAP_COL) ? -colfac : colfac;
else if (idtype == ID_LA)
mtex->colfac = (neg & LAMAP_COL)? -colfac: colfac;
mtex->colfac = (neg & LAMAP_COL) ? -colfac : colfac;
else if (idtype == ID_WO)
mtex->colfac = (neg & WOMAP_HORIZ)? -colfac: colfac;
mtex->colfac = (neg & WOMAP_HORIZ) ? -colfac : colfac;
}
}
}
@@ -590,7 +590,7 @@ static void do_version_mdef_250(Main *main)
for (ob = main->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_MeshDeform) {
mmd = (MeshDeformModifierData*) md;
mmd = (MeshDeformModifierData *)md;
if (mmd->bindcos) {
/* make bindcos NULL in order to trick older versions
@@ -665,14 +665,14 @@ static bNodeSocket *do_versions_node_group_add_socket_2_56_2(bNodeTree *ngroup,
gsock->link = NULL;
/* assign new unique index */
gsock->own_index = ngroup->cur_index++;
gsock->limit = (in_out==SOCK_IN ? 0xFFF : 1);
gsock->limit = (in_out == SOCK_IN ? 0xFFF : 1);
// if (stype->value_structsize > 0)
// gsock->default_value = MEM_callocN(stype->value_structsize, "default socket value");
BLI_addtail(in_out==SOCK_IN ? &ngroup->inputs : &ngroup->outputs, gsock);
BLI_addtail(in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs, gsock);
ngroup->update |= (in_out==SOCK_IN ? NTREE_UPDATE_GROUP_IN : NTREE_UPDATE_GROUP_OUT);
ngroup->update |= (in_out == SOCK_IN ? NTREE_UPDATE_GROUP_IN : NTREE_UPDATE_GROUP_OUT);
return gsock;
}
@@ -749,7 +749,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_SOUND) {
bSoundActuator *sAct = (bSoundActuator*) act->data;
bSoundActuator *sAct = (bSoundActuator *)act->data;
if (sAct->sound) {
sound = blo_do_versions_newlibadr(fd, lib, sAct->sound);
sAct->flag = (sound->flags & SOUND_FLAGS_3D) ? ACT_SND_3D_SOUND : 0;
@@ -775,7 +775,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->ed && scene->ed->seqbasep) {
SEQ_BEGIN (scene->ed, seq)
SEQ_BEGIN(scene->ed, seq)
{
if (seq->type == SEQ_TYPE_SOUND_HD) {
char str[FILE_MAX];
@@ -787,7 +787,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
#define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21)
/* don't know, if anybody used that this way, but just in case, upgrade to new way... */
if ((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) &&
!(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR))
!(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR))
{
BLI_snprintf(seq->strip->proxy->dir, FILE_MAXDIR, "%s/BL_proxy", seq->strip->dir);
}
@@ -857,7 +857,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
/* copy standard draw flag to meshes(used to be global, is not available here) */
for (me = bmain->mesh.first; me; me = me->id.next) {
me->drawflag = ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES;
me->drawflag = ME_DRAWEDGES | ME_DRAWFACES | ME_DRAWCREASES;
}
/* particle draw and render types */
@@ -939,7 +939,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
ob->matbits = MEM_calloc_arrayN(ob->totcol, sizeof(char), "ob->matbits");
for (a = 0; a < ob->totcol; a++)
ob->matbits[a] = (ob->colbits & (1<<a)) != 0;
ob->matbits[a] = (ob->colbits & (1 << a)) != 0;
}
}
@@ -962,7 +962,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
ma->mode &= ~MA_HALO;
}
if (ma->mode & (MA_ZTRANSP|MA_RAYTRANSP)) {
if (ma->mode & (MA_ZTRANSP | MA_RAYTRANSP)) {
ma->mode |= MA_TRANSP;
}
else {
@@ -979,7 +979,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
ma->mtex[a]->texflag |= MTEX_BUMP_OBJECTSPACE;
}
else {
tex = (Tex*) blo_do_versions_newlibadr(fd, ma->id.lib, tex);
tex = (Tex *)blo_do_versions_newlibadr(fd, ma->id.lib, tex);
if (tex && tex->type == 0) { /* invalid type */
ma->mtex[a]->texflag |= MTEX_3TAP_BUMP;
ma->mtex[a]->texflag |= MTEX_BUMP_OBJECTSPACE;
@@ -1060,9 +1060,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
sce->gm.depth = sce->r.depth;
/* Physic (previously stored in world) */
sce->gm.gravity =9.8f;
sce->gm.gravity = 9.8f;
sce->gm.physicsEngine = WOPHY_BULLET; /* Bullet by default */
sce->gm.mode = WO_DBVT_CULLING; /* DBVT culling by default */
sce->gm.mode = WO_DBVT_CULLING; /* DBVT culling by default */
sce->gm.occlusionRes = 128;
sce->gm.ticrate = 60;
sce->gm.maxlogicstep = 5;
@@ -1131,7 +1131,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (ob = bmain->object.first; ob; ob = ob->id.next) {
/* fluid-sim stuff */
FluidsimModifierData *fluidmd = (FluidsimModifierData *) modifiers_findByType(ob, eModifierType_Fluidsim);
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
if (fluidmd)
fluidmd->fss->fmd = fluidmd;
@@ -1186,7 +1186,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
/* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */
if (do_gravity) {
for (part = bmain->particle.first; part; part = part->id.next)
part->effector_weights->global_gravity = part->acc[2]/-9.81f;
part->effector_weights->global_gravity = part->acc[2] / -9.81f;
}
for (ob = bmain->object.first; ob; ob = ob->id.next) {
@@ -1194,13 +1194,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
if (do_gravity) {
for (md = ob->modifiers.first; md; md = md->next) {
ClothModifierData *clmd = (ClothModifierData *) modifiers_findByType(ob, eModifierType_Cloth);
ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
if (clmd)
clmd->sim_parms->effector_weights->global_gravity = clmd->sim_parms->gravity[2]/-9.81f;
clmd->sim_parms->effector_weights->global_gravity = clmd->sim_parms->gravity[2] / -9.81f;
}
if (ob->soft)
ob->soft->effector_weights->global_gravity = ob->soft->grav/9.81f;
ob->soft->effector_weights->global_gravity = ob->soft->grav / 9.81f;
}
/* Normal wind shape is plane */
@@ -1268,7 +1268,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (lt = bmain->latt.first; lt; lt = lt->id.next) {
if ((key = blo_do_versions_newlibadr(fd, lib, lt->key)) && key->refkey) {
data = key->refkey->data;
tot = MIN2(lt->pntsu*lt->pntsv*lt->pntsw, key->refkey->totelem);
tot = MIN2(lt->pntsu * lt->pntsv * lt->pntsw, key->refkey->totelem);
for (a = 0; a < tot; a++, data += 3)
copy_v3_v3(lt->def[a].vec, data);
@@ -1284,16 +1284,16 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
BezTriple *bezt = nu->bezt;
for (a = 0; a < nu->pntsu; a++, bezt++) {
copy_v3_v3(bezt->vec[0], data); data+=3;
copy_v3_v3(bezt->vec[1], data); data+=3;
copy_v3_v3(bezt->vec[2], data); data+=3;
copy_v3_v3(bezt->vec[0], data); data += 3;
copy_v3_v3(bezt->vec[1], data); data += 3;
copy_v3_v3(bezt->vec[2], data); data += 3;
bezt->alfa = *data; data++;
}
}
else if (nu->bp) {
BPoint *bp = nu->bp;
for (a = 0; a < nu->pntsu*nu->pntsv; a++, bp++) {
for (a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) {
copy_v3_v3(bp->vec, data); data += 3;
bp->alfa = *data; data++;
}
@@ -1350,7 +1350,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (sa = screen->areabase.first; sa; sa = sa->next) {
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *) sl;
View3D *v3d = (View3D *)sl;
if (v3d->drawtype == OB_MATERIAL)
v3d->drawtype = OB_SOLID;
}
@@ -1439,7 +1439,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
multires_load_old_250(me);
for (ob = bmain->object.first; ob; ob = ob->id.next) {
MultiresModifierData *mmd = (MultiresModifierData *) modifiers_findByType(ob, eModifierType_Multires);
MultiresModifierData *mmd = (MultiresModifierData *)modifiers_findByType(ob, eModifierType_Multires);
if (mmd) {
mmd->totlvl--;
@@ -1533,7 +1533,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
if (sseq->mainb == 0)
sseq->mainb = SEQ_DRAW_IMG_IMBUF;
ar_main = (ARegion*)regionbase->first;
ar_main = (ARegion *)regionbase->first;
for (; ar_main; ar_main = ar_main->next) {
if (ar_main->regiontype == RGN_TYPE_WINDOW)
break;
@@ -1693,7 +1693,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
regionbase = &sl->regionbase;
if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) {
for (ar = (ARegion*) regionbase->first; ar; ar = ar->next) {
for (ar = (ARegion *)regionbase->first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_WINDOW) {
ar->v2d.cur.ymax = ar->v2d.tot.ymax = 0.0f;
ar->v2d.cur.ymin = ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
@@ -1795,7 +1795,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
regionbase = &sl->regionbase;
}
ar_preview = (ARegion*) regionbase->first;
ar_preview = (ARegion *)regionbase->first;
for (; ar_preview; ar_preview = ar_preview->next) {
if (ar_preview->regiontype == RGN_TYPE_PREVIEW)
break;
@@ -1810,7 +1810,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
} /* sequencer changes */
}
if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */
if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */
bScreen *sc;
/* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_RENDER_OVERRIDE.
@@ -1847,7 +1847,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
ModifierData *md;
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Fluidsim) {
FluidsimModifierData *fmd = (FluidsimModifierData *) md;
FluidsimModifierData *fmd = (FluidsimModifierData *)md;
fmd->fss->flag |= OB_FLUIDSIM_ACTIVE;
fmd->fss->flag |= OB_FLUIDSIM_OVERRIDE_TIME;
}
@@ -1861,7 +1861,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
while (node) {
if (node->type == CMP_NODE_COLORBALANCE) {
NodeColorBalance *n = (NodeColorBalance *) node->storage;
NodeColorBalance *n = (NodeColorBalance *)node->storage;
n->lift[0] += 1.f;
n->lift[1] += 1.f;
n->lift[2] += 1.f;
@@ -1876,7 +1876,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
while (node) {
if (node->type == CMP_NODE_COLORBALANCE) {
NodeColorBalance *n = (NodeColorBalance *) node->storage;
NodeColorBalance *n = (NodeColorBalance *)node->storage;
n->lift[0] += 1.f;
n->lift[1] += 1.f;
n->lift[2] += 1.f;
@@ -1907,7 +1907,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_IMAGE) {
SpaceImage *sima = (SpaceImage *) sl;
SpaceImage *sima = (SpaceImage *)sl;
scopes_new(&sima->scopes);
}
}
@@ -1929,7 +1929,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_NODE) {
SpaceNode *snode = (SpaceNode *) sl;
SpaceNode *snode = (SpaceNode *)sl;
ListBase *regionbase;
ARegion *ar;
@@ -1953,12 +1953,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
}
}
else if (sl->spacetype == SPACE_TIME) {
SpaceTime *stime = (SpaceTime *) sl;
SpaceTime *stime = (SpaceTime *)sl;
/* enable all cache display */
stime->cache_display |= TIME_CACHE_DISPLAY;
stime->cache_display |= (TIME_CACHE_SOFTBODY|TIME_CACHE_PARTICLES);
stime->cache_display |= (TIME_CACHE_CLOTH|TIME_CACHE_SMOKE|TIME_CACHE_DYNAMICPAINT);
stime->cache_display |= (TIME_CACHE_SOFTBODY | TIME_CACHE_PARTICLES);
stime->cache_display |= (TIME_CACHE_CLOTH | TIME_CACHE_SMOKE | TIME_CACHE_DYNAMICPAINT);
}
}
}
@@ -1969,32 +1969,32 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
/* parent type to modifier */
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->parent) {
Object *parent = (Object *) blo_do_versions_newlibadr(fd, lib, ob->parent);
Object *parent = (Object *)blo_do_versions_newlibadr(fd, lib, ob->parent);
if (parent) { /* parent may not be in group */
if (parent->type == OB_ARMATURE && ob->partype == PARSKEL) {
ArmatureModifierData *amd;
bArmature *arm = (bArmature *) blo_do_versions_newlibadr(fd, lib, parent->data);
bArmature *arm = (bArmature *)blo_do_versions_newlibadr(fd, lib, parent->data);
amd = (ArmatureModifierData*) modifier_new(eModifierType_Armature);
amd = (ArmatureModifierData *)modifier_new(eModifierType_Armature);
amd->object = ob->parent;
BLI_addtail((ListBase*)&ob->modifiers, amd);
BLI_addtail((ListBase *)&ob->modifiers, amd);
amd->deformflag = arm->deformflag;
ob->partype = PAROBJECT;
}
else if (parent->type == OB_LATTICE && ob->partype == PARSKEL) {
LatticeModifierData *lmd;
lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice);
lmd = (LatticeModifierData *)modifier_new(eModifierType_Lattice);
lmd->object = ob->parent;
BLI_addtail((ListBase*)&ob->modifiers, lmd);
BLI_addtail((ListBase *)&ob->modifiers, lmd);
ob->partype = PAROBJECT;
}
else if (parent->type == OB_CURVE && ob->partype == PARCURVE) {
CurveModifierData *cmd;
cmd = (CurveModifierData*) modifier_new(eModifierType_Curve);
cmd = (CurveModifierData *)modifier_new(eModifierType_Curve);
cmd->object = ob->parent;
BLI_addtail((ListBase*)&ob->modifiers, cmd);
BLI_addtail((ListBase *)&ob->modifiers, cmd);
ob->partype = PAROBJECT;
}
}
@@ -2005,8 +2005,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
int i;
for (i = 0; i < 20; i++) {
if (scene->lay & (1<<i)) {
scene->layact = 1<<i;
if (scene->lay & (1 << i)) {
scene->layact = 1 << i;
break;
}
}
@@ -2029,7 +2029,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene) {
Sequence *seq;
SEQ_BEGIN (scene->ed, seq)
SEQ_BEGIN(scene->ed, seq)
{
if (seq->sat == 0.0f) {
seq->sat = 1.0f;
@@ -2091,11 +2091,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
/* spacing was originally in pixels, convert it to percentage for new version
* size should not be zero due to sanity check above
*/
brush->spacing = (int)(100 * ((float)brush->spacing) / ((float) brush->size));
brush->spacing = (int)(100 * ((float)brush->spacing) / ((float)brush->size));
if (brush->add_col[0] == 0 &&
brush->add_col[1] == 0 &&
brush->add_col[2] == 0)
brush->add_col[1] == 0 &&
brush->add_col[2] == 0)
{
brush->add_col[0] = 1.00f;
brush->add_col[1] = 0.39f;
@@ -2103,8 +2103,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
}
if (brush->sub_col[0] == 0 &&
brush->sub_col[1] == 0 &&
brush->sub_col[2] == 0)
brush->sub_col[1] == 0 &&
brush->sub_col[2] == 0)
{
brush->sub_col[0] = 0.39f;
brush->sub_col[1] = 0.39f;
@@ -2143,11 +2143,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
smd->domain->vorticity = 2.0f;
smd->domain->time_scale = 1.0f;
if (!(smd->domain->flags & (1<<4)))
if (!(smd->domain->flags & (1 << 4)))
continue;
/* delete old MOD_SMOKE_INITVELOCITY flag */
smd->domain->flags &= ~(1<<4);
smd->domain->flags &= ~(1 << 4);
/* for now just add it to all flow objects in the scene */
{
@@ -2200,7 +2200,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl;
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_INFO) {
SpaceInfo *sinfo = (SpaceInfo *) sl;
SpaceInfo *sinfo = (SpaceInfo *)sl;
ARegion *ar;
sinfo->rpt_mask = INFO_RPT_OP;
@@ -2208,9 +2208,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_WINDOW) {
ar->v2d.scroll = (V2D_SCROLL_RIGHT);
ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; /* align bottom left */
ar->v2d.align = V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; /* align bottom left */
ar->v2d.keepofs = V2D_LOCKOFS_X;
ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
ar->v2d.keeptot = V2D_KEEPTOT_BOUNDS;
ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
}
@@ -2284,7 +2284,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl;
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_IMAGE) {
SpaceImage *sima = (SpaceImage *) sl;
SpaceImage *sima = (SpaceImage *)sl;
if (sima->sample_line_hist.height == 0)
sima->sample_line_hist.height = 100;
}
@@ -2338,21 +2338,21 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
/* node sockets are not exposed automatically any more,
* this mimics the old behavior by adding all unlinked sockets to groups.
*/
for (ntree=bmain->nodetree.first; ntree; ntree=ntree->id.next) {
for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) {
/* this adds copies and links from all unlinked internal sockets to group inputs/outputs. */
/* first make sure the own_index for new sockets is valid */
for (node=ntree->nodes.first; node; node=node->next) {
for (node = ntree->nodes.first; node; node = node->next) {
for (sock = node->inputs.first; sock; sock = sock->next)
if (sock->own_index >= ntree->cur_index)
ntree->cur_index = sock->own_index+1;
ntree->cur_index = sock->own_index + 1;
for (sock = node->outputs.first; sock; sock = sock->next)
if (sock->own_index >= ntree->cur_index)
ntree->cur_index = sock->own_index+1;
ntree->cur_index = sock->own_index + 1;
}
/* add ntree->inputs/ntree->outputs sockets for all unlinked sockets in the group tree. */
for (node=ntree->nodes.first; node; node=node->next) {
for (node = ntree->nodes.first; node; node = node->next) {
for (sock = node->inputs.first; sock; sock = sock->next) {
if (!sock->link && !nodeSocketIsHidden(sock)) {
@@ -2376,7 +2376,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
}
}
for (sock = node->outputs.first; sock; sock = sock->next) {
if (nodeCountSocketLinks(ntree, sock)==0 && !nodeSocketIsHidden(sock)) {
if (nodeCountSocketLinks(ntree, sock) == 0 && !nodeSocketIsHidden(sock)) {
gsock = do_versions_node_group_add_socket_2_56_2(ntree, sock->name, sock->type, SOCK_OUT);
/* initialize the default socket value */
@@ -2429,7 +2429,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
/* weak! material alpha could be animated */
if (mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex) {
mat->mode |= MA_TRANSP;
mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP);
mat->mode &= ~(MA_ZTRANSP | MA_RAYTRANSP);
}
}
}
@@ -2439,7 +2439,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
if (sc->redraws_flag == 0) {
/* just initialize to default? */
/* XXX: we could also have iterated through areas, and taken them from the first timeline available... */
sc->redraws_flag = TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
sc->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN;
}
}
@@ -2453,7 +2453,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
ModifierData *md;
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Solidify) {
SolidifyModifierData *smd = (SolidifyModifierData *) md;
SolidifyModifierData *smd = (SolidifyModifierData *)md;
if (smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) {
smd->mat_ofs_rim = 1;
smd->flag &= ~MOD_SOLIDIFY_RIM_MATERIAL;
@@ -2554,7 +2554,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
if (act->type == ACT_CAMERA) {
bCameraActuator *ba = act->data;
ba->damping = 1.0/32.0;
ba->damping = 1.0 / 32.0;
}
}
}
@@ -2577,7 +2577,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->r.ffcodecdata.audio_channels = 2;
scene->audio.volume = 1.0f;
SEQ_BEGIN (scene->ed, seq)
SEQ_BEGIN(scene->ed, seq)
{
seq->pitch = 1.0f;
}
@@ -2631,7 +2631,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
for (act = bmain->action.first; act; act = act->id.next) {
for (fcu = act->curves.first; fcu; fcu = fcu->next) {
BezTriple *bezt;
unsigned int i = 0;
uint i = 0;
/* only need to touch curves that had this flag set */
if ((fcu->flag & FCURVE_AUTO_HANDLES) == 0)
@@ -2704,7 +2704,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
bNode *node;
bNodeSocket *sock;
for (node=ntree->nodes.first; node; node=node->next) {
for (node = ntree->nodes.first; node; node = node->next) {
for (sock = node->inputs.first; sock; sock = sock->next)
do_versions_socket_default_value_259(sock);
for (sock = node->outputs.first; sock; sock = sock->next)
@@ -2755,7 +2755,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
if (sce->gm.recastData.cellheight == 0.0f)
sce->gm.recastData.cellheight = 0.2f;
if (sce->gm.recastData.agentmaxslope == 0.0f)
sce->gm.recastData.agentmaxslope = (float)M_PI/4;
sce->gm.recastData.agentmaxslope = (float)M_PI / 4;
if (sce->gm.recastData.agentmaxclimb == 0.0f)
sce->gm.recastData.agentmaxclimb = 0.9f;
if (sce->gm.recastData.agentheight == 0.0f)
@@ -2770,7 +2770,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
sce->gm.recastData.regionminsize = 8.f;
if (sce->gm.recastData.regionmergesize == 0.0f)
sce->gm.recastData.regionmergesize = 20.f;
if (sce->gm.recastData.vertsperpoly<3)
if (sce->gm.recastData.vertsperpoly < 3)
sce->gm.recastData.vertsperpoly = 6;
if (sce->gm.recastData.detailsampledist == 0.0f)
sce->gm.recastData.detailsampledist = 6.0f;

View File

@@ -344,7 +344,7 @@ static void do_versions_mesh_mloopcol_swap_2_62_1(Mesh *me)
if (layer->type == CD_MLOOPCOL) {
mloopcol = (MLoopCol *)layer->data;
for (i = 0; i < me->totloop; i++, mloopcol++) {
SWAP(unsigned char, mloopcol->r, mloopcol->b);
SWAP(uchar, mloopcol->r, mloopcol->b);
}
}
}
@@ -428,7 +428,7 @@ static void do_versions_nodetree_frame_2_64_6(bNodeTree *ntree)
}
/* initialize custom node color */
node->color[0] = node->color[1] = node->color[2] = 0.608f; /* default theme color */
node->color[0] = node->color[1] = node->color[2] = 0.608f; /* default theme color */
}
}
@@ -972,7 +972,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (act->type == ACT_CAMERA) {
bCameraActuator *ba = act->data;
if (ba->axis == (float) 'x') ba->axis = OB_POSX;
if (ba->axis == (float)'x') ba->axis = OB_POSX;
else if (ba->axis == (float)'y') ba->axis = OB_POSY;
/* don't do an if/else to avoid imediate subversion bump*/
// ba->axis=((ba->axis == (float)'x') ? OB_POSX_X : OB_POSY);
@@ -1045,7 +1045,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData *) md;
ClothModifierData *clmd = (ClothModifierData *)md;
if (clmd->sim_parms)
clmd->sim_parms->vel_damping = 1.0f;
}
@@ -1506,7 +1506,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
ColorBalanceModifierData *cbmd;
smd = BKE_sequence_modifier_new(seq, NULL, seqModifierType_ColorBalance);
cbmd = (ColorBalanceModifierData *) smd;
cbmd = (ColorBalanceModifierData *)smd;
cbmd->color_balance = *strip->color_balance;
@@ -1745,7 +1745,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
ScrArea *sa;
for (sa = sc->areabase.first; sa; sa = sa->next) {
SpaceLink *sl;
if ( sa->spacetype == SPACE_LOGIC)
if (sa->spacetype == SPACE_LOGIC)
do_version_logic_264(&sa->regionbase);
for (sl = sa->spacedata.first; sl; sl = sl->next) {
@@ -1954,7 +1954,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (cu = bmain->curve.first; cu; cu = cu->id.next) {
if (cu->flag & (CU_FRONT | CU_BACK)) {
if ( cu->ext1 != 0.0f || cu->ext2 != 0.0f) {
if (cu->ext1 != 0.0f || cu->ext2 != 0.0f) {
Nurb *nu;
for (nu = cu->nurb.first; nu; nu = nu->next) {
@@ -2085,7 +2085,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
bNode *node;
FOREACH_NODETREE(bmain, ntree, id) {
if (id == &ntree->id)
continue; /* already fixed for node groups */
continue; /* already fixed for node groups */
for (node = ntree->nodes.first; node; node = node->next)
nodeUniqueName(ntree, node);
@@ -2454,8 +2454,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
SpaceOops *so = (SpaceOops *)sl;
if (!ELEM(so->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_SELECTED, SO_ACTIVE,
SO_SAME_TYPE, SO_GROUPS, SO_LIBRARIES, SO_SEQUENCE, SO_DATABLOCKS,
SO_USERDEF))
SO_SAME_TYPE, SO_GROUPS, SO_LIBRARIES, SO_SEQUENCE, SO_DATABLOCKS,
SO_USERDEF))
{
so->outlinevis = SO_ALL_SCENES;
}

View File

@@ -399,7 +399,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
SpaceLink *space_link;
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
if (space_link->spacetype == SPACE_CLIP) {
SpaceClip *space_clip = (SpaceClip *) space_link;
SpaceClip *space_clip = (SpaceClip *)space_link;
if (space_clip->mode != SC_MODE_MASKEDIT) {
space_clip->mode = SC_MODE_TRACKING;
}
@@ -671,7 +671,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 273, 1)) {
#define BRUSH_RAKE (1 << 7)
#define BRUSH_RAKE (1 << 7)
#define BRUSH_RANDOM_ROTATION (1 << 25)
Brush *br;
@@ -962,7 +962,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
case SPACE_IMAGE:
{
SpaceImage *sima = (SpaceImage *) sl;
SpaceImage *sima = (SpaceImage *)sl;
sima->iuser.flag |= IMA_SHOW_STEREO;
break;
}
@@ -1067,7 +1067,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
bScreen *screen;
#define RV3D_VIEW_PERSPORTHO 7
#define RV3D_VIEW_PERSPORTHO 7
for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
for (sa = screen->areabase.first; sa; sa = sa->next) {
@@ -1096,7 +1096,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
Lamp *lamp;
#define LA_YF_PHOTON 5
#define LA_YF_PHOTON 5
for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
if (lamp->type == LA_YF_PHOTON) {
lamp->type = LA_LOCAL;

View File

@@ -199,7 +199,7 @@ void BLO_update_defaults_startup_blend(Main *bmain)
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
if (space_link->spacetype == SPACE_CLIP) {
SpaceClip *space_clip = (SpaceClip *) space_link;
SpaceClip *space_clip = (SpaceClip *)space_link;
space_clip->flag &= ~SC_MANUAL_CALIBRATION;
}
}

View File

@@ -107,14 +107,14 @@
static void vcol_to_fcol(Mesh *me)
{
MFace *mface;
unsigned int *mcol, *mcoln, *mcolmain;
uint *mcol, *mcoln, *mcolmain;
int a;
if (me->totface == 0 || me->mcol == NULL)
return;
mcoln = mcolmain = MEM_malloc_arrayN(me->totface, 4 * sizeof(int), "mcoln");
mcol = (unsigned int *)me->mcol;
mcol = (uint *)me->mcol;
mface = me->mface;
for (a = me->totface; a > 0; a--, mface++) {
mcoln[0] = mcol[mface->v1];
@@ -183,11 +183,11 @@ static void bone_version_238(ListBase *lb)
for (bone = lb->first; bone; bone = bone->next) {
if (bone->rad_tail == 0.0f && bone->rad_head == 0.0f) {
bone->rad_head = 0.25f*bone->length;
bone->rad_tail = 0.1f*bone->length;
bone->rad_head = 0.25f * bone->length;
bone->rad_tail = 0.1f * bone->length;
bone->dist-= bone->rad_head;
if (bone->dist<=0.0f)
bone->dist -= bone->rad_head;
if (bone->dist <= 0.0f)
bone->dist = 0.0f;
}
bone_version_238(&bone->childbase);
@@ -278,7 +278,7 @@ static void ntree_version_245(FileData *fd, Library *lib, bNodeTree *ntree)
/* fix for temporary flag changes during 245 cycle */
nodeid = blo_do_versions_newlibadr(fd, lib, node->id);
if (node->storage && nodeid && GS(nodeid->name) == ID_IM) {
image = (Image*)nodeid;
image = (Image *)nodeid;
iuser = node->storage;
if (iuser->flag & IMA_OLD_PREMUL) {
iuser->flag &= ~IMA_OLD_PREMUL;
@@ -357,7 +357,7 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
for (b = 0; b < me->fdata.totlayer; b++) {
if (me->fdata.layers[b].type == CD_MTFACE) {
tf = ((MTFace*)me->fdata.layers[b].data) + a;
tf = ((MTFace *)me->fdata.layers[b].data) + a;
tf->mode &= ~TF_ALPHASORT;
if (ma && (ma->mode & MA_ZTRANSP))
@@ -476,7 +476,7 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
iuser->frames = nia->frames;
iuser->sfra = nia->sfra;
iuser->offset = nia->nr-1;
iuser->offset = nia->nr - 1;
iuser->cycl = nia->cyclic;
iuser->fie_ima = 2;
iuser->ok = 1;
@@ -635,7 +635,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (ob->totcol) {
for (a = 0; a < ob->totcol; a++) {
if (ob->mat[a])
ob->colbits |= (1<<a);
ob->colbits |= (1 << a);
}
}
ob = ob->id.next;
@@ -700,7 +700,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl = sa->spacedata.first;
while (sl) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D*) sl;
View3D *v3d = (View3D *)sl;
if (v3d->gridlines == 0)
v3d->gridlines = 20;
@@ -728,8 +728,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Tex *tex = bmain->tex.first;
while (tex) {
if ((tex->rfac == 0.0f) &&
(tex->gfac == 0.0f) &&
(tex->bfac == 0.0f))
(tex->gfac == 0.0f) &&
(tex->bfac == 0.0f))
{
tex->rfac = 1.0f;
tex->gfac = 1.0f;
@@ -745,8 +745,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Tex *tex = bmain->tex.first;
while (tex) {
if ((tex->rfac == 0.0f) &&
(tex->gfac == 0.0f) &&
(tex->bfac == 0.0f))
(tex->gfac == 0.0f) &&
(tex->bfac == 0.0f))
{
tex->rfac = 1.0f;
tex->gfac = 1.0f;
@@ -827,7 +827,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl = sa->spacedata.first;
while (sl) {
if (sl->spacetype == SPACE_IPO) {
SpaceIpo *sipo = (SpaceIpo*) sl;
SpaceIpo *sipo = (SpaceIpo *)sl;
sipo->v2d.max[0] = 15000.0;
}
sl = sl->next;
@@ -860,7 +860,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl = sa->spacedata.first;
while (sl) {
if (sl->spacetype == SPACE_TEXT) {
SpaceText *st = (SpaceText*) sl;
SpaceText *st = (SpaceText *)sl;
st->lheight = 12;
}
sl = sl->next;
@@ -936,9 +936,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (bmain->versionfile <= 200) {
Object *ob = bmain->object.first;
while (ob) {
ob->scaflag = ob->gameflag & (OB_DO_FH|OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
/* 64 is do_fh */
ob->gameflag &= ~(OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
ob->scaflag = ob->gameflag & (OB_DO_FH | OB_ROT_FH | OB_ANISOTROPIC_FRICTION | OB_GHOST | OB_RIGID_BODY | OB_BOUNDS);
/* 64 is do_fh */
ob->gameflag &= ~(OB_ROT_FH | OB_ANISOTROPIC_FRICTION | OB_GHOST | OB_RIGID_BODY | OB_BOUNDS);
ob = ob->id.next;
}
}
@@ -994,7 +994,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
while (act) {
if (act->type == ACT_OBJECT) {
oa = act->data;
oa->flag &= ~(ACT_TORQUE_LOCAL|ACT_DROT_LOCAL); /* this actuator didn't do local/glob rot before */
oa->flag &= ~(ACT_TORQUE_LOCAL | ACT_DROT_LOCAL); /* this actuator didn't do local/glob rot before */
}
act = act->next;
}
@@ -1094,11 +1094,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
* on property. The material field can
* remain empty. */
if (sens->type == SENS_COLLISION) {
cs = (bCollisionSensor*) sens->data;
cs = (bCollisionSensor *)sens->data;
cs->mode = 0;
}
if (sens->type == SENS_RAY) {
rs = (bRaySensor*) sens->data;
rs = (bRaySensor *)sens->data;
rs->mode = 0;
}
sens = sens->next;
@@ -1177,7 +1177,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
while (prop) {
if (prop->type == GPROP_TIME) {
// convert old GPROP_TIME values from int to float
*((float *)&prop->data) = (float) prop->data;
*((float *)&prop->data) = (float)prop->data;
}
prop = prop->next;
@@ -1247,10 +1247,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
int i, j;
for (i = 0; i < me->totface; i++) {
TFace *tf = &((TFace*) me->tface)[i];
TFace *tf = &((TFace *)me->tface)[i];
for (j = 0; j < 4; j++) {
char *col = (char *) &tf->col[j];
char *col = (char *)&tf->col[j];
col[0] = 255;
}
@@ -1349,7 +1349,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_IPO) {
SpaceSeq *sseq = (SpaceSeq*) sl;
SpaceSeq *sseq = (SpaceSeq *)sl;
sseq->v2d.keeptot = 0;
}
}
@@ -1442,11 +1442,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_ACTION) {
SpaceAction *sac = (SpaceAction *) sl;
SpaceAction *sac = (SpaceAction *)sl;
sac->v2d.max[0] = 32000;
}
else if (sl->spacetype == SPACE_NLA) {
SpaceNla *sla = (SpaceNla *) sl;
SpaceNla *sla = (SpaceNla *)sl;
sla->v2d.max[0] = 32000;
}
}
@@ -1514,10 +1514,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_BUTS) {
SpaceButs *sbuts = (SpaceButs *) sl;
SpaceButs *sbuts = (SpaceButs *)sl;
sbuts->v2d.maxzoom = 1.2f;
sbuts->align = 1; /* horizontal default */
sbuts->align = 1; /* horizontal default */
if (sbuts->mainb == BUTS_LAMP) {
sbuts->mainb = CONTEXT_SHADING;
@@ -1658,7 +1658,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl = sa->spacedata.first;
while (sl) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D*) sl;
View3D *v3d = (View3D *)sl;
if (v3d->gridflag == 0) {
v3d->gridflag |= V3D_SHOW_X;
@@ -1682,7 +1682,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Scene *sce;
while (tex) {
if ((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) {
if ((tex->flag & (TEX_CHECKER_ODD + TEX_CHECKER_EVEN)) == 0) {
tex->flag |= TEX_CHECKER_ODD;
}
/* copied from kernel texture.c */
@@ -1725,7 +1725,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
/* added: 5x better zoom in for nla */
if (sl->spacetype == SPACE_NLA) {
SpaceNla *snla = (SpaceNla *) sl;
SpaceNla *snla = (SpaceNla *)sl;
snla->v2d.maxzoom = 50;
}
}
@@ -1761,7 +1761,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl;
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *) sl;
View3D *v3d = (View3D *)sl;
v3d->flag |= V3D_SELECT_OUTLINE;
}
}
@@ -1785,7 +1785,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl;
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *) sl;
View3D *v3d = (View3D *)sl;
v3d->flag |= V3D_ZBUF_SELECT;
}
else if (sl->spacetype == SPACE_TEXT) {
@@ -1812,7 +1812,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
while (sce) {
ed = sce->ed;
if (ed) {
SEQ_BEGIN (sce->ed, seq)
SEQ_BEGIN(sce->ed, seq)
{
if (seq->type == SEQ_TYPE_IMAGE || seq->type == SEQ_TYPE_MOVIE)
seq->alpha_mode = SEQ_ALPHA_STRAIGHT;
@@ -1847,7 +1847,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SpaceLink *sl;
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *) sl;
View3D *v3d = (View3D *)sl;
if (v3d->twtype == 0)
v3d->twtype = V3D_MANIP_TRANSLATE;
}
@@ -1912,7 +1912,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
BKE_pose_tag_recalc(bmain, ob->pose);
/* cannot call stuff now (pointers!), done in setup_app_data */
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
/* new generic xray option */
arm = blo_do_versions_newlibadr(fd, lib, ob->data);
@@ -1923,8 +1923,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
else if (ob->type == OB_MESH) {
Mesh *me = blo_do_versions_newlibadr(fd, lib, ob->data);
if ((me->flag&ME_SUBSURF)) {
SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf);
if ((me->flag & ME_SUBSURF)) {
SubsurfModifierData *smd = (SubsurfModifierData *)modifier_new(eModifierType_Subsurf);
smd->levels = MAX2(1, me->subdiv);
smd->renderLevels = MAX2(1, me->subdivr);
@@ -1940,7 +1940,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
BLI_addtail(&ob->modifiers, smd);
modifier_unique_name(&ob->modifiers, (ModifierData*)smd);
modifier_unique_name(&ob->modifiers, (ModifierData *)smd);
}
}
@@ -1990,9 +1990,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Subsurf) {
SubsurfModifierData *smd = (SubsurfModifierData*) md;
SubsurfModifierData *smd = (SubsurfModifierData *)md;
smd->flags &= ~(eSubsurfModifierFlag_Incremental|eSubsurfModifierFlag_DebugIncr);
smd->flags &= ~(eSubsurfModifierFlag_Incremental | eSubsurfModifierFlag_DebugIncr);
}
}
@@ -2024,7 +2024,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (con = pchan->constraints.first; con; con = con->next) {
if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
bKinematicConstraint *data = (bKinematicConstraint*)con->data;
bKinematicConstraint *data = (bKinematicConstraint *)con->data;
data->weight = 1.0f;
data->orientweight = 1.0f;
data->flag &= ~CONSTRAINT_IK_ROT;
@@ -2098,7 +2098,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Armature) {
ArmatureModifierData *amd = (ArmatureModifierData*) md;
ArmatureModifierData *amd = (ArmatureModifierData *)md;
if (amd->object && amd->deformflag == 0) {
Object *oba = blo_do_versions_newlibadr(fd, lib, amd->object);
arm = blo_do_versions_newlibadr(fd, lib, oba->data);
@@ -2181,7 +2181,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (sce->audio.mixrate == 0)
sce->audio.mixrate = 48000;
if (sce->r.xparts <2 )
if (sce->r.xparts < 2)
sce->r.xparts = 4;
if (sce->r.yparts < 2)
sce->r.yparts = 4;
@@ -2196,7 +2196,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (srl = sce->r.layers.first; srl; srl = srl->next) {
if (srl->layflag & SCE_LAY_SOLID)
srl->layflag |= SCE_LAY_SKY;
srl->passflag &= (SCE_PASS_COMBINED|SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR);
srl->passflag &= (SCE_PASS_COMBINED | SCE_PASS_Z | SCE_PASS_NORMAL | SCE_PASS_VECTOR);
}
}
@@ -2253,7 +2253,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (ma->mtex[a] && ma->mtex[a]->tex) {
tex = blo_do_versions_newlibadr(fd, lib, ma->mtex[a]->tex);
if (tex && tex->type == TEX_STUCCI)
ma->mtex[a]->mapto &= ~(MAP_COL|MAP_SPEC|MAP_REF);
ma->mtex[a]->mapto &= ~(MAP_COL | MAP_SPEC | MAP_REF);
}
}
/* transmissivity defaults */
@@ -2295,7 +2295,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D*) sl;
View3D *v3d = (View3D *)sl;
if (v3d->gridsubdiv == 0)
v3d->gridsubdiv = 10;
}
@@ -2369,7 +2369,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* version patch from buttons_object.c */
if (data->flag == 0)
data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z;
data->flag = ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z;
break;
}
@@ -2385,32 +2385,32 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (curcon = pchan->constraints.first; curcon; curcon = curcon->next) {
switch (curcon->type) {
case CONSTRAINT_TYPE_MINMAX:
{
bMinMaxConstraint *data = curcon->data;
if (data->sticky == 1)
data->flag |= MINMAX_STICKY;
else
data->flag &= ~MINMAX_STICKY;
}
{
bMinMaxConstraint *data = curcon->data;
if (data->sticky == 1)
data->flag |= MINMAX_STICKY;
else
data->flag &= ~MINMAX_STICKY;
break;
}
case CONSTRAINT_TYPE_KINEMATIC:
{
bKinematicConstraint *data = curcon->data;
if (!(data->flag & CONSTRAINT_IK_POS)) {
data->flag |= CONSTRAINT_IK_POS;
data->flag |= CONSTRAINT_IK_STRETCH;
}
{
bKinematicConstraint *data = curcon->data;
if (!(data->flag & CONSTRAINT_IK_POS)) {
data->flag |= CONSTRAINT_IK_POS;
data->flag |= CONSTRAINT_IK_STRETCH;
}
break;
}
case CONSTRAINT_TYPE_ROTLIKE:
{
bRotateLikeConstraint *data = curcon->data;
{
bRotateLikeConstraint *data = curcon->data;
/* version patch from buttons_object.c */
if (data->flag == 0)
data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z;
}
/* version patch from buttons_object.c */
if (data->flag == 0)
data->flag = ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z;
break;
}
}
}
}
@@ -2420,10 +2420,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* copy old object level track settings to curve modifers */
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Curve) {
CurveModifierData *cmd = (CurveModifierData*) md;
CurveModifierData *cmd = (CurveModifierData *)md;
if (cmd->defaxis == 0)
cmd->defaxis = ob->trackflag+1;
cmd->defaxis = ob->trackflag + 1;
}
}
@@ -2480,7 +2480,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
tex->iuser.fie_ima = (char)tex->fie_ima;
tex->iuser.offset = tex->offset;
tex->iuser.sfra = tex->sfra;
tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC_)!=0;
tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC_) != 0;
}
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree)
@@ -2512,7 +2512,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (bmain->subversionfile < 4) {
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.bake_mode = 1; /* prevent to include render stuff here */
sce->r.bake_mode = 1; /* prevent to include render stuff here */
sce->r.bake_filter = 16;
sce->r.bake_osa = 5;
sce->r.bake_flag = R_BAKE_CLEAR;
@@ -2565,7 +2565,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* translate old mirror modifier axis values to new flags */
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Mirror) {
MirrorModifierData *mmd = (MirrorModifierData*) md;
MirrorModifierData *mmd = (MirrorModifierData *)md;
switch (mmd->axis) {
case 0:
@@ -2613,7 +2613,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_ACTION) {
SpaceAction *saction = (SpaceAction*) sl;
SpaceAction *saction = (SpaceAction *)sl;
saction->v2d.tot.ymin = -1000.0;
saction->v2d.tot.ymax = 0.0;
@@ -2666,7 +2666,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* unless the file was created 2.44.3 but not 2.45, update the constraints */
if (!(bmain->versionfile == 244 && bmain->subversionfile == 3) &&
((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0)) )
((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0)) )
{
for (ob = bmain->object.first; ob; ob = ob->id.next) {
ListBase *list;
@@ -2685,13 +2685,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
switch (curcon->type) {
case CONSTRAINT_TYPE_LOCLIMIT:
{
bLocLimitConstraint *data = (bLocLimitConstraint *) curcon->data;
bLocLimitConstraint *data = (bLocLimitConstraint *)curcon->data;
/* old limit without parent option for objects */
if (data->flag2)
curcon->ownspace = CONSTRAINT_SPACE_LOCAL;
break;
}
break;
}
}
}
@@ -2716,13 +2716,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
switch (curcon->type) {
case CONSTRAINT_TYPE_ACTION:
{
bActionConstraint *data = (bActionConstraint *) curcon->data;
bActionConstraint *data = (bActionConstraint *)curcon->data;
/* 'data->local' used to mean that target was in local-space */
if (data->local)
curcon->tarspace = CONSTRAINT_SPACE_LOCAL;
break;
}
break;
}
}
@@ -2761,7 +2761,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData*) md;
ClothModifierData *clmd = (ClothModifierData *)md;
if (!clmd->point_cache) {
clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches);
clmd->point_cache->step = 1;
@@ -2910,7 +2910,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Armature)
((ArmatureModifierData*) md)->deformflag |= ARM_DEF_B_BONE_REST;
((ArmatureModifierData *)md)->deformflag |= ARM_DEF_B_BONE_REST;
}
}
}
@@ -3013,7 +3013,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
md = modifier_new(eModifierType_ParticleSystem);
BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", BLI_listbase_count(&ob->particlesystem));
psmd = (ParticleSystemModifierData*) md;
psmd = (ParticleSystemModifierData *)md;
psmd->psys = psys;
BLI_addtail(&ob->modifiers, md);
@@ -3110,7 +3110,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
int a;
if (pset->brush[0].size == 0) {
pset->flag = PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER;
pset->flag = PE_KEEP_LENGTHS | PE_LOCK_FIRST | PE_DEFLECT_EMITTER;
pset->emitterdist = 0.25f;
pset->totrekey = 5;
pset->totaddkey = 5;
@@ -3159,10 +3159,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
else
repeat = strip->repeat;
length = strip->end-strip->start;
length = strip->end - strip->start;
if (length == 0.0f)
length = 1.0f;
actlength = strip->actend-strip->actstart;
actlength = strip->actend - strip->actstart;
strip->scale = length / (repeat * actlength);
if (strip->scale == 0.0f)
@@ -3288,7 +3288,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* Starting from subversion 3, ACTOR is a separate feature.
* Before it was conditioning all the other dynamic flags */
if (!(ob->gameflag & OB_ACTOR))
ob->gameflag &= ~(OB_GHOST|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION_RESPONSE);
ob->gameflag &= ~(OB_GHOST | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION_RESPONSE);
/* suitable default for older files */
}
}
@@ -3316,8 +3316,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
* use it for the number of divisions per segment
*/
if (nu->pntsv > 1) {
nu->resolu = MAX2( 1, (int)(((float)nu->resolu / (float)nu->pntsu)+0.5f) );
nu->resolv = MAX2( 1, (int)(((float)nu->resolv / (float)nu->pntsv)+0.5f) );
nu->resolu = MAX2(1, (int)(((float)nu->resolu / (float)nu->pntsu) + 0.5f) );
nu->resolv = MAX2(1, (int)(((float)nu->resolv / (float)nu->pntsv) + 0.5f) );
}
}
}
@@ -3356,7 +3356,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_MESSAGE) {
bMessageActuator *msgAct = (bMessageActuator *) act->data;
bMessageActuator *msgAct = (bMessageActuator *)act->data;
if (BLI_strnlen(msgAct->toPropName, 3) > 2) {
/* strip first 2 chars, would have only worked if these were OB anyway */
@@ -3400,16 +3400,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* initialize skeleton generation toolsettings */
sce->toolsettings->skgen_resolution = 250;
sce->toolsettings->skgen_threshold_internal = 0.1f;
sce->toolsettings->skgen_threshold_external = 0.1f;
sce->toolsettings->skgen_angle_limit = 30.0f;
sce->toolsettings->skgen_length_ratio = 1.3f;
sce->toolsettings->skgen_length_limit = 1.5f;
sce->toolsettings->skgen_correlation_limit = 0.98f;
sce->toolsettings->skgen_symmetry_limit = 0.1f;
sce->toolsettings->skgen_threshold_internal = 0.1f;
sce->toolsettings->skgen_threshold_external = 0.1f;
sce->toolsettings->skgen_angle_limit = 30.0f;
sce->toolsettings->skgen_length_ratio = 1.3f;
sce->toolsettings->skgen_length_limit = 1.5f;
sce->toolsettings->skgen_correlation_limit = 0.98f;
sce->toolsettings->skgen_symmetry_limit = 0.1f;
sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
sce->toolsettings->skgen_postpro_passes = 3;
sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL|SKGEN_FILTER_EXTERNAL|SKGEN_FILTER_SMART|SKGEN_SUB_CORRELATION|SKGEN_HARMONIC;
sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL | SKGEN_FILTER_EXTERNAL | SKGEN_FILTER_SMART | SKGEN_SUB_CORRELATION | SKGEN_HARMONIC;
sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
@@ -3438,25 +3438,25 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (sl = sa->spacedata.first; sl; sl = sl->next) {
switch (sl->spacetype) {
case SPACE_ACTION:
{
SpaceAction *sact = (SpaceAction *)sl;
{
SpaceAction *sact = (SpaceAction *)sl;
sact->mode = SACTCONT_DOPESHEET;
sact->autosnap = SACTSNAP_FRAME;
}
sact->mode = SACTCONT_DOPESHEET;
sact->autosnap = SACTSNAP_FRAME;
break;
}
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)sl;
sipo->autosnap = SACTSNAP_FRAME;
}
{
SpaceIpo *sipo = (SpaceIpo *)sl;
sipo->autosnap = SACTSNAP_FRAME;
break;
}
case SPACE_NLA:
{
SpaceNla *snla = (SpaceNla *)sl;
snla->autosnap = SACTSNAP_FRAME;
}
{
SpaceNla *snla = (SpaceNla *)sl;
snla->autosnap = SACTSNAP_FRAME;
break;
}
}
}
}
@@ -3522,7 +3522,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Object *ob;
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->pd)
ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer())) + 1) % 128;
ob->pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128;
}
}
@@ -3538,7 +3538,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
SEQP_BEGIN (ed, seq)
{
if (seq->strip && seq->strip->proxy) {
seq->strip->proxy->quality =90;
seq->strip->proxy->quality = 90;
}
}
SEQ_END

View File

@@ -727,10 +727,10 @@ static void write_previews(WriteData *wd, const PreviewImage *prv_orig)
}
writestruct_at_address(wd, DATA, PreviewImage, 1, prv_orig, &prv);
if (prv.rect[0]) {
writedata(wd, DATA, prv.w[0] * prv.h[0] * sizeof(unsigned int), prv.rect[0]);
writedata(wd, DATA, prv.w[0] * prv.h[0] * sizeof(uint), prv.rect[0]);
}
if (prv.rect[1]) {
writedata(wd, DATA, prv.w[1] * prv.h[1] * sizeof(unsigned int), prv.rect[1]);
writedata(wd, DATA, prv.w[1] * prv.h[1] * sizeof(uint), prv.rect[1]);
}
}
}
@@ -3737,7 +3737,7 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
}
/* preview image, first 2 values are width and height
* second are an RGBA image (unsigned char)
* second are an RGBA image (uchar)
* note, this uses 'TEST' since new types will segfault on file load for older blender versions.
*/
static void write_thumb(WriteData *wd, const BlendThumbnail *thumb)