diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-22 02:58:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-22 02:58:08 +0400 |
commit | 9b515033071b40e982ef647ee225e8afc377e0c9 (patch) | |
tree | b8906cf9d21d2441c6dd0db1b518561def3f8f1a /source/blender | |
parent | 049dd8a0ffa94b0d02033877ec99172659b89d8c (diff) |
style cleanup
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 7 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/GeometryExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.h | 81 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_OpenCLDevice.h | 4 | ||||
-rw-r--r-- | source/blender/compositor/operations/COM_BokehBlurOperation.cpp | 2 |
7 files changed, 58 insertions, 52 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 516de35fab3..af9bb971d05 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -414,8 +414,9 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->bp2 = face2->v2; collpair->bp3 = face2->v3; } - else + else { i++; + } } if ( i == 2 ) { if ( face2->v4 ) { @@ -429,8 +430,9 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->bp2 = face2->v4; collpair->bp3 = face2->v3; } - else + else { break; + } } else if ( i == 3 ) { if ( face1->v4 && face2->v4 ) { @@ -444,8 +446,9 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->bp2 = face2->v3; collpair->bp3 = face2->v4; } - else + else { break; + } } #ifdef USE_BULLET @@ -464,8 +467,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->flag = 0; collpair++; }/* - else - { + else { float w1, w2, w3, u1, u2, u3; float v1[3], v2[3], relativeVelocity[3]; diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index f13c27cb436..6fe838666c5 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -110,7 +110,7 @@ static BezTriple *mask_spline_point_prev_bezt(MaskSpline *spline, MaskSplinePoin if (spline->flag & MASK_SPLINE_CYCLIC) { return &(points_array[0].bezt); } - else { + else { return NULL; } } @@ -2610,7 +2610,7 @@ void BKE_mask_rasterize_layers(ListBase *masklayers, int width, int height, floa } } - if(do_mask_aa){ + if (do_mask_aa) { //PLX_antialias_buffer(buffer,width,height); } /* clamp at the end */ @@ -2620,7 +2620,8 @@ void BKE_mask_rasterize_layers(ListBase *masklayers, int width, int height, floa } #ifdef __PLX_RASKTER_MT__ -void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int width, int height, const short do_aspect_correct){ +void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int width, int height, const short do_aspect_correct) +{ MaskLayer *masklay; int numLayers=0; int currLayer=0; diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 4182a9c4c93..9c11358ce7f 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -916,7 +916,7 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node, } } - if ( (animType->camera) != 0) { + if (animType->camera != 0) { Camera *camera = (Camera *) ob->data; if (!camera->adt || !camera->adt->action) act = verify_adt_action((ID *)&camera->id, 1); diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index c3d1106b288..d30f9b86a5a 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -135,7 +135,7 @@ void GeometryExporter::operator()(Object *ob) // XXX slow if (ob->totcol) { - for (int a = 0; a < ob->totcol; a++) { + for (int a = 0; a < ob->totcol; a++) { createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind); } } diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 5077a9e3228..9abbfb163e2 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -122,11 +122,13 @@ public: /** * @brief after execution the state will be set to available by calling this method */ - void setCreatedState() { + void setCreatedState() + { this->m_state = COM_MB_AVAILABLE; } - inline void read(float result[4], int x, int y) { + inline void read(float result[4], int x, int y) + { if (x >= this->m_rect.xmin && x < this->m_rect.xmax && y >= this->m_rect.ymin && y < this->m_rect.ymax) { @@ -140,7 +142,8 @@ public: } } - inline void readNoCheck(float result[4], int x, int y) { + inline void readNoCheck(float result[4], int x, int y) + { const int dx = x - this->m_rect.xmin; const int dy = y - this->m_rect.ymin; const int offset = (this->m_chunkWidth * dy + dx) * COM_NUMBER_OF_CHANNELS; @@ -150,42 +153,42 @@ public: void writePixel(int x, int y, const float color[4]); void addPixel(int x, int y, const float color[4]); inline void readCubic(float result[4], float x, float y) - { - int x1 = floor(x); - int x2 = x1 + 1; - int y1 = floor(y); - int y2 = y1 + 1; - - float valuex = x - x1; - float valuey = y - y1; - float mvaluex = 1.0f - valuex; - float mvaluey = 1.0f - valuey; - - float color1[4]; - float color2[4]; - float color3[4]; - float color4[4]; - - read(color1, x1, y1); - read(color2, x1, y2); - read(color3, x2, y1); - read(color4, x2, y2); - - color1[0] = color1[0] * mvaluey + color2[0] * valuey; - color1[1] = color1[1] * mvaluey + color2[1] * valuey; - color1[2] = color1[2] * mvaluey + color2[2] * valuey; - color1[3] = color1[3] * mvaluey + color2[3] * valuey; - - color3[0] = color3[0] * mvaluey + color4[0] * valuey; - color3[1] = color3[1] * mvaluey + color4[1] * valuey; - color3[2] = color3[2] * mvaluey + color4[2] * valuey; - color3[3] = color3[3] * mvaluey + color4[3] * valuey; - - result[0] = color1[0] * mvaluex + color3[0] * valuex; - result[1] = color1[1] * mvaluex + color3[1] * valuex; - result[2] = color1[2] * mvaluex + color3[2] * valuex; - result[3] = color1[3] * mvaluex + color3[3] * valuex; - } + { + int x1 = floor(x); + int x2 = x1 + 1; + int y1 = floor(y); + int y2 = y1 + 1; + + float valuex = x - x1; + float valuey = y - y1; + float mvaluex = 1.0f - valuex; + float mvaluey = 1.0f - valuey; + + float color1[4]; + float color2[4]; + float color3[4]; + float color4[4]; + + read(color1, x1, y1); + read(color2, x1, y2); + read(color3, x2, y1); + read(color4, x2, y2); + + color1[0] = color1[0] * mvaluey + color2[0] * valuey; + color1[1] = color1[1] * mvaluey + color2[1] * valuey; + color1[2] = color1[2] * mvaluey + color2[2] * valuey; + color1[3] = color1[3] * mvaluey + color2[3] * valuey; + + color3[0] = color3[0] * mvaluey + color4[0] * valuey; + color3[1] = color3[1] * mvaluey + color4[1] * valuey; + color3[2] = color3[2] * mvaluey + color4[2] * valuey; + color3[3] = color3[3] * mvaluey + color4[3] * valuey; + + result[0] = color1[0] * mvaluex + color3[0] * valuex; + result[1] = color1[1] * mvaluex + color3[1] * valuex; + result[2] = color1[2] * mvaluex + color3[2] * valuex; + result[3] = color1[3] * mvaluex + color3[3] * valuex; + } diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h index 577df5caf77..f1a1e31c930 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.h +++ b/source/blender/compositor/intern/COM_OpenCLDevice.h @@ -92,9 +92,9 @@ public: */ void execute(WorkPackage *work); - cl_context getContext(){ return this->m_context; } + cl_context getContext() { return this->m_context; } - cl_command_queue getQueue(){ return this->m_queue; } + cl_command_queue getQueue() { return this->m_queue; } cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader); cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, ReadBufferOperation *reader); diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index ff9bfb73396..ef28d55dbc8 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -94,7 +94,7 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, void *data) int bufferstartx = inputBuffer->getRect()->xmin; int bufferstarty = inputBuffer->getRect()->ymin; int pixelSize = this->m_size * this->getWidth() / 100.0f; - if (pixelSize==0){ + if (pixelSize==0) { this->m_inputProgram->read(color, x, y, COM_PS_NEAREST); return; } |