correct indentation and some whitespace edits (no functional changes)

This commit is contained in:
2011-11-11 13:09:14 +00:00
parent 094c9799f9
commit e84c0980a3
142 changed files with 722 additions and 688 deletions

View File

@@ -181,17 +181,19 @@ void BOP_Face2Face(BOP_Mesh *mesh, BOP_Faces *facesA, BOP_Faces *facesB)
if ((faceB->getTAG() != BROKEN) && (faceB->getTAG() != PHANTOM)) {
/* get (or create) bounding box for face B */
if( faceB->getBBox() == NULL )
if( faceB->getBBox() == NULL ) {
faceB->setBBox(mesh->getVertex(faceB->getVertex(0))->getPoint(),
mesh->getVertex(faceB->getVertex(1))->getPoint(),
mesh->getVertex(faceB->getVertex(2))->getPoint());
}
BOP_BBox *boxB = faceB->getBBox();
if (boxA->intersect(*boxB)) {
MT_Plane3 planeB = faceB->getPlane();
if (BOP_containsPoint(planeB,p1) &&
BOP_containsPoint(planeB,p2) &&
BOP_containsPoint(planeB,p3)) {
BOP_containsPoint(planeB,p3))
{
if (BOP_orientation(planeB,planeA)>0) {
BOP_intersectCoplanarFaces(mesh,facesB,faceA,faceB,false);
}
@@ -1180,12 +1182,14 @@ void BOP_removeOverlappedFaces(BOP_Mesh *mesh, BOP_Faces *facesA, BOP_Faces *f
if (faceJ->getTAG()!=BROKEN) {
MT_Plane3 planeJ = faceJ->getPlane();
if (BOP_containsPoint(planeJ,p1) && BOP_containsPoint(planeJ,p2)
&& BOP_containsPoint(planeJ,p3)) {
&& BOP_containsPoint(planeJ,p3))
{
MT_Point3 q1 = mesh->getVertex(faceJ->getVertex(0))->getPoint();
MT_Point3 q2 = mesh->getVertex(faceJ->getVertex(1))->getPoint();
MT_Point3 q3 = mesh->getVertex(faceJ->getVertex(2))->getPoint();
if (BOP_overlap(MT_Vector3(planeJ.x(),planeJ.y(),planeJ.z()),
p1,p2,p3,q1,q2,q3)) {
p1,p2,p3,q1,q2,q3))
{
facesB->erase(facesB->begin()+j,facesB->begin()+(j+1));
faceJ->setTAG(BROKEN);
overlapped = true;

View File

@@ -252,7 +252,7 @@ public:
* @return Indication of success.
*/
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0) = 0;
const bool stereoVisual) = 0;
/**
* Ends full screen mode.

View File

@@ -141,7 +141,7 @@ public:
* @return Indication of success.
*/
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0);
const bool stereoVisual);
/**
* Ends full screen mode.
@@ -305,7 +305,7 @@ protected:
* @return Indication of success.
*/
virtual GHOST_TSuccess createFullScreenWindow(GHOST_Window** window,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0);
const bool stereoVisual);
/** The display manager (platform dependant). */
GHOST_DisplayManager* m_displayManager;

View File

@@ -892,7 +892,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
if (timerMgr->fireTimers(getMilliSeconds())) {
anyProcessed = true;
}*/
}
*/
do {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

View File

@@ -305,7 +305,8 @@ static void SleepTillEvent(Display *display, GHOST_TInt64 maxSleep) {
if (maxSleep == -1) {
select(fd + 1, &fds, NULL, NULL, NULL);
} else {
}
else {
timeval tv;
tv.tv_sec = maxSleep/1000;

View File

@@ -160,7 +160,8 @@ public:
}
for (iterator it = queue.begin();
it != queue.end() && mem_in_use > max;) {
it != queue.end() && mem_in_use > max;)
{
iterator jt = it;
++it;

View File

@@ -1231,8 +1231,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
give_stripelem(seq, cfra)->name);
frameno = 1;
} else {
frameno = (int) give_stripelem_index(seq, cfra)
+ seq->anim_startofs;
frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs;
BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
context.preview_render_size);
}

View File

@@ -62,8 +62,10 @@ struct Heap {
#define HEAP_COMPARE(a, b) (a->value < b->value)
#define HEAP_EQUALS(a, b) (a->value == b->value)
#define HEAP_SWAP(heap, i, j) \
{ SWAP(int, heap->tree[i]->index, heap->tree[j]->index); \
SWAP(HeapNode*, heap->tree[i], heap->tree[j]); }
{ \
SWAP(int, heap->tree[i]->index, heap->tree[j]->index); \
SWAP(HeapNode*, heap->tree[i], heap->tree[j]); \
}
/***/

View File

@@ -1555,13 +1555,13 @@ static void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData
break;
case IDP_DOUBLE:
/* erg, stupid doubles. since I'm storing them
in the same field as int val; val2 in the
IDPropertyData struct, they have to deal with
endianness specifically
* in the same field as int val; val2 in the
* IDPropertyData struct, they have to deal with
* endianness specifically
in theory, val and val2 would've already been swapped
if switch_endian is true, so we have to first unswap
them then reswap them as a single 64-bit entity.
* in theory, val and val2 would've already been swapped
* if switch_endian is true, so we have to first unswap
* them then reswap them as a single 64-bit entity.
*/
if (switch_endian) {
@@ -3567,8 +3567,8 @@ static void lib_link_mtface(FileData *fd, Mesh *me, MTFace *mtface, int totface)
int i;
/* Add pseudo-references (not fake users!) to images used by texface. A
little bogus; it would be better if each mesh consistently added one ref
to each image it used. - z0r */
* little bogus; it would be better if each mesh consistently added one ref
* to each image it used. - z0r */
for (i=0; i<totface; i++, tf++) {
tf->tpage= newlibadr(fd, me->id.lib, tf->tpage);
if(tf->tpage && tf->tpage->id.us==0)
@@ -3769,7 +3769,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
}
/* if multires is present but has no valid vertex data,
there's no way to recover it; silently remove multires */
* there's no way to recover it; silently remove multires */
if(mesh->mr && !mesh->mr->verts) {
multires_free(mesh->mr);
mesh->mr = NULL;

View File

@@ -113,7 +113,6 @@ void ArmatureImporter::create_unskinned_bone( COLLADAFW::Node *node, EditBone *p
// set head
copy_v3_v3(bone->head, mat[3]);
// set tail, don't set it to head because 0-length bones are not allowed
float vec[3] = {0.0f, 0.5f, 0.0f};
add_v3_v3v3(bone->tail, bone->head, vec);
@@ -596,7 +595,6 @@ void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node
float invObmat[4][4];
invert_m4_m4(invObmat, ob_arm->obmat);
mul_m4_m4m4(pchan->pose_mat, mat, invObmat);
}
mat4_to_axis_angle(ax,&angle,mat);

View File

@@ -363,7 +363,7 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_
oldheight= oldheight > 0 ? oldheight : MAX2(1, height);
/* offset block based on mouse position, user offset is scaled
along in case we resized the block in ui_text_bounds_block */
* along in case we resized the block in ui_text_bounds_block */
startx= window->eventstate->x + block->minx + (block->mx*width)/oldwidth;
starty= window->eventstate->y + block->miny + (block->my*height)/oldheight;
@@ -633,7 +633,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
}
/* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
when scrolling without moving mouse (see [#28432]) */
* when scrolling without moving mouse (see [#28432]) */
if(ELEM(oldbut->type, ROW, LISTROW))
oldbut->hardmax= but->hardmax;
@@ -659,7 +659,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
}
/* needed for temporarily rename buttons, such as in outliner or fileselect,
they should keep calling uiDefButs to keep them alive */
* they should keep calling uiDefButs to keep them alive */
/* returns 0 when button removed */
int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but)
{
@@ -1890,8 +1890,8 @@ static void ui_free_but(const bContext *C, uiBut *but)
if(but->func_argN) MEM_freeN(but->func_argN);
if(but->active) {
/* XXX solve later, buttons should be free-able without context ideally,
however they may have open tooltips or popup windows, which need to
be closed using a context pointer */
* however they may have open tooltips or popup windows, which need to
* be closed using a context pointer */
if(C)
ui_button_active_free(C, but);
else
@@ -2424,13 +2424,12 @@ void ui_block_do_align(uiBlock *block)
}
/*
ui_def_but is the function that draws many button types
for float buttons:
"a1" Click Step (how much to change the value each click)
"a2" Number of decimal point values to display. 0 defaults to 3 (0.000) 1,2,3, and a maximum of 4,
all greater values will be clamped to 4.
* ui_def_but is the function that draws many button types
* for float buttons:
* "a1" Click Step (how much to change the value each click)
* "a2" Number of decimal point values to display. 0 defaults to 3 (0.000)
* 1,2,3, and a maximum of 4, all greater values will be clamped to 4.
*/
static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{

View File

@@ -340,7 +340,8 @@ static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA *
uiBut *bt;
bt= uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "",
(short)butr->xmin, (short)butr->xmin, butr->xmax-butr->xmin, butr->xmax-butr->xmin,
(short)butr->xmin, (short)butr->xmin,
butr->xmax-butr->xmin, butr->xmax-butr->xmin,
nor, 0.0f, 1.0f, 0, 0, "");
uiButSetFunc(bt, node_normal_cb, ntree, node);
}

View File

@@ -1267,11 +1267,24 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
BLI_assert(ar->regiontype == RGN_TYPE_WINDOW);
if(base && (base->object->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT) ||
paint_facesel_test(base->object)));
paint_facesel_test(base->object)))
{
/* do nothing */
}
else if((base && (base->object->mode & OB_MODE_TEXTURE_PAINT)) &&
scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE));
else if((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
else if(scene->obedit && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE))
{
/* do nothing */
}
else if((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) &&
v3d->drawtype > OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT))
{
/* do nothing */
}
else if(scene->obedit && v3d->drawtype>OB_WIRE &&
(v3d->flag & V3D_ZBUF_SELECT)) {
/* do nothing */
}
else {
v3d->flag &= ~V3D_INVALID_BACKBUF;
return;

View File

@@ -546,8 +546,8 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
while(uploaded == GL_FALSE) {
(*copy_f)(dm, varray, cur_index_per_mat, mat_orig_to_new, user);
/* glUnmapBuffer returns GL_FALSE if
the data store is corrupted; retry
in that case */
* the data store is corrupted; retry
* in that case */
uploaded = glUnmapBufferARB(target);
}
}

View File

@@ -85,12 +85,14 @@ typedef struct anim_index_builder {
} anim_index_builder;
anim_index_builder * IMB_index_builder_create(const char * name);
void IMB_index_builder_add_entry(anim_index_builder * fp,
void IMB_index_builder_add_entry(
anim_index_builder * fp,
int frameno, unsigned long long seek_pos,
unsigned long long seek_pos_dts,
unsigned long long pts);
void IMB_index_builder_proc_frame(anim_index_builder * fp,
void IMB_index_builder_proc_frame(
anim_index_builder * fp,
unsigned char * buffer,
int data_size,
int frameno, unsigned long long seek_pos,

View File

@@ -533,8 +533,9 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg(
rv->orig_height = st->codec->height;
if (st->codec->width != width || st->codec->height != height
|| st->codec->pix_fmt != rv->c->pix_fmt) {
if (st->codec->width != width || st->codec->height != height ||
st->codec->pix_fmt != rv->c->pix_fmt)
{
rv->frame = avcodec_alloc_frame();
avpicture_fill((AVPicture*) rv->frame,
MEM_mallocN(avpicture_get_size(
@@ -569,7 +570,8 @@ static int add_to_proxy_output_ffmpeg(
if ( ctx->sws_ctx && frame &&
(frame->data[0] || frame->data[1] ||
frame->data[2] || frame->data[3])) {
frame->data[2] || frame->data[3]))
{
sws_scale(ctx->sws_ctx, (const uint8_t * const*) frame->data,
frame->linesize, 0, ctx->orig_height,
ctx->frame->data, ctx->frame->linesize);

View File

@@ -227,7 +227,6 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
}
/* Read a byte into variable V.
* If must suspend, take the specified action (typically "return FALSE").
*/

View File

@@ -193,7 +193,8 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
(png_voidp) ibuf,
WriteData,
Flush);
} else {
}
else {
fp = fopen(name, "wb");
if (!fp) {
png_destroy_write_struct(&png_ptr, &info_ptr);

View File

@@ -59,7 +59,7 @@ typedef struct IDProperty {
int len; /* array length, also (this is important!) string length + 1.
the idea is to be able to reuse array realloc functions on strings.*/
/* totallen is total length of allocated array/string, including a buffer.
Note that the buffering is mild; the code comes from python's list implementation.*/
* Note that the buffering is mild; the code comes from python's list implementation.*/
int totallen; /*strings and arrays are both buffered, though the buffer isn't
saved.*/
} IDProperty;

View File

@@ -1398,7 +1398,8 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");*/
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
*/
prop= RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);

View File

@@ -1949,7 +1949,8 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
*/
/* materials */
prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);

View File

@@ -321,7 +321,8 @@ static void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");*/
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
*/
/* materials */
prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);

View File

@@ -659,7 +659,10 @@ static void check_renderbutton_framerate(RenderData *rd, ReportList *reports)
if( (rd->frs_sec == 24 || rd->frs_sec == 30 || rd->frs_sec == 60) &&
(qtdata->gTemporalSettings.frameRate == 1571553 ||
qtdata->gTemporalSettings.frameRate == 1964113 ||
qtdata->gTemporalSettings.frameRate == 3928227)) {;}
qtdata->gTemporalSettings.frameRate == 3928227))
{
/* do nothing */
}
else {
if (rd->frs_sec_base > 0)
qtdata->gTemporalSettings.frameRate =

View File

@@ -381,9 +381,10 @@ ImBuf * qtime_fetchibuf (struct anim *anim, int position)
//add alpha to ibuf
boxsize = anim->x * anim->y * 4;
crect = (unsigned char *) rect;
for( index = 0; index < boxsize; index+=4, crect+=4 )
for( index = 0; index < boxsize; index+=4, crect+=4 ) {
crect[3] = 0xFF;
}
}
#endif
ibuf->profile = IB_PROFILE_SRGB;

View File

@@ -178,7 +178,8 @@ void BL_ShapeActionActuator::BlendShape(Key* key, float srcweight)
for (it=m_blendshape.begin(), kb = (KeyBlock*)key->block.first;
kb && it != m_blendshape.end();
kb = (KeyBlock*)kb->next, it++) {
kb = (KeyBlock*)kb->next, it++)
{
kb->curval = kb->curval * dstweight + (*it) * srcweight;
}
}

View File

@@ -310,7 +310,8 @@ void BL_Action::BlendShape(Key* key, float srcweight, std::vector<float>& blends
//printf("Dst: %f\tSrc: %f\n", srcweight, dstweight);
for (it=blendshape.begin(), kb = (KeyBlock*)key->block.first;
kb && it != blendshape.end();
kb = (KeyBlock*)kb->next, it++) {
kb = (KeyBlock*)kb->next, it++)
{
//printf("OirgKeys: %f\t%f\n", kb->curval, (*it));
kb->curval = kb->curval * dstweight + (*it) * srcweight;
//printf("NewKey: %f\n", kb->curval);

View File

@@ -1248,7 +1248,8 @@ KX_Camera* KX_Scene::FindCamera(KX_Camera* cam)
list<KX_Camera*>::iterator it = m_cameras.begin();
while ( (it != m_cameras.end())
&& ((*it) != cam) ) {
&& ((*it) != cam) )
{
it++;
}
@@ -1261,7 +1262,8 @@ KX_Camera* KX_Scene::FindCamera(STR_String& name)
list<KX_Camera*>::iterator it = m_cameras.begin();
while ( (it != m_cameras.end())
&& ((*it)->GetName() != name) ) {
&& ((*it)->GetName() != name) )
{
it++;
}