diff options
Diffstat (limited to 'source')
12 files changed, 46 insertions, 44 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 348efaf40a9..00b2d3bee74 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -472,9 +472,11 @@ void *BLI_rfindstring_ptr(const ListBase *listbase, const char *id, const int of return NULL; } +/** + * Finds the first element of listbase which contains the specified pointer value + * at the specified offset, returning NULL if not found. + */ void *BLI_findptr(const ListBase *listbase, const void *ptr, const int offset) -/* finds the first element of listbase which contains the specified pointer value -at the specified offset, returning NULL if not found. */ { Link *link = NULL; const void *ptr_iter; @@ -493,9 +495,11 @@ at the specified offset, returning NULL if not found. */ return NULL; } /* same as above but find reverse */ +/** + * Finds the last element of listbase which contains the specified pointer value + * at the specified offset, returning NULL if not found. + */ void *BLI_rfindptr(const ListBase *listbase, const void *ptr, const int offset) -/* finds the last element of listbase which contains the specified pointer value -at the specified offset, returning NULL if not found. */ { Link *link = NULL; const void *ptr_iter; @@ -514,9 +518,11 @@ at the specified offset, returning NULL if not found. */ return NULL; } +/** + * Returns the 1-based index of the first element of listbase which contains the specified + * null-terminated string at the specified offset, or -1 if not found. + */ int BLI_findstringindex(const ListBase *listbase, const char *id, const int offset) -/* returns the 1-based index of the first element of listbase which contains the specified -null-terminated string at the specified offset, or -1 if not found. */ { Link *link = NULL; const char *id_iter; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 40e73892308..bd2fbfe7eda 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6764,7 +6764,7 @@ static void lib_link_linestyle(FileData *fd, Main *main) break; } } - for (m = linestyle->alpha_modifiers.first; m; m = m->next){ + for (m = linestyle->alpha_modifiers.first; m; m = m->next) { switch (m->type) { case LS_MODIFIER_DISTANCE_FROM_OBJECT: { @@ -6774,7 +6774,7 @@ static void lib_link_linestyle(FileData *fd, Main *main) break; } } - for (m = linestyle->thickness_modifiers.first; m; m = m->next){ + for (m = linestyle->thickness_modifiers.first; m; m = m->next) { switch (m->type) { case LS_MODIFIER_DISTANCE_FROM_OBJECT: { @@ -10461,11 +10461,11 @@ static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *li if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) expand_doit(fd, mainvar, ((LineStyleColorModifier_DistanceFromObject *)m)->target); } - for (m = linestyle->alpha_modifiers.first; m; m = m->next){ + for (m = linestyle->alpha_modifiers.first; m; m = m->next) { if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) expand_doit(fd, mainvar, ((LineStyleAlphaModifier_DistanceFromObject *)m)->target); } - for (m = linestyle->thickness_modifiers.first; m; m = m->next){ + for (m = linestyle->thickness_modifiers.first; m; m = m->next) { if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) expand_doit(fd, mainvar, ((LineStyleThicknessModifier_DistanceFromObject *)m)->target); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index f01b2bcc5a7..b91518174d7 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2326,10 +2326,10 @@ static void write_scenes(WriteData *wd, ListBase *scebase) for (srl = sce->r.layers.first; srl; srl = srl->next) { writestruct(wd, DATA, "SceneRenderLayer", 1, srl); - for(fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { + for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { writestruct(wd, DATA, "FreestyleModuleConfig", 1, fmc); } - for(fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) { + for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) { writestruct(wd, DATA, "FreestyleLineSet", 1, fls); } } diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cpp b/source/blender/compositor/operations/COM_ZCombineOperation.cpp index 97a4aefbfac..4368ba4f9a0 100644 --- a/source/blender/compositor/operations/COM_ZCombineOperation.cpp +++ b/source/blender/compositor/operations/COM_ZCombineOperation.cpp @@ -125,10 +125,10 @@ void ZCombineMaskOperation::executePixel(float output[4], float x, float y, Pixe float fac = mask[0]; // multiply mask with alpha, if mask == 0 color1, else color2 make sure - float mfac = 1.0f-fac; - output[0] = color1[0]*mfac + color2[0]*fac; - output[1] = color1[1]*mfac + color2[1]*fac; - output[2] = color1[2]*mfac + color2[2]*fac; + float mfac = 1.0f - fac; + output[0] = color1[0] * mfac + color2[0] * fac; + output[1] = color1[1] * mfac + color2[1] * fac; + output[2] = color1[2] * mfac + color2[2] * fac; output[3] = max(color1[3], color2[3]); } @@ -144,13 +144,13 @@ void ZCombineMaskAlphaOperation::executePixel(float output[4], float x, float y, float fac = mask[0]; // multiply mask with alpha, if mask == 0 color1, else color2 make sure - float mfac = 1.0f-fac; - float alpha = color1[3]*mfac + color2[3]*fac; + float mfac = 1.0f - fac; + float alpha = color1[3] * mfac + color2[3] * fac; float facalpha = fac * alpha; - mfac = 1.0f-facalpha; - output[0] = color1[0]*mfac + color2[0]*facalpha; - output[1] = color1[1]*mfac + color2[1]*facalpha; - output[2] = color1[2]*mfac + color2[2]*facalpha; + mfac = 1.0f - facalpha; + output[0] = color1[0] * mfac + color2[0] * facalpha; + output[1] = color1[1] * mfac + color2[1] * facalpha; + output[2] = color1[2] * mfac + color2[2] * facalpha; output[3] = max(color1[3], color2[3]); } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 634f686c9e6..f21d91f4aa6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -547,7 +547,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } /* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack. - Only for images, sound and fonts */ + * Only for images, sound and fonts */ if (id && BKE_pack_check(id)) { but = uiDefIconButO(block, BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0, UI_UNIT_X, UI_UNIT_Y, TIP_("Packed File, click to unpack")); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index c3b8cc0b275..62a559903d8 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -640,13 +640,13 @@ static int stencil_fit_image_aspect_exec(bContext *C, wmOperator *UNUSED(op)) float orig_area, stencil_area, factor; ED_image_get_uv_aspect(ima, NULL, &aspx, &aspy); - orig_area = aspx*aspy; - stencil_area = br->stencil_dimension[0]*br->stencil_dimension[1]; + orig_area = aspx * aspy; + stencil_area = br->stencil_dimension[0] * br->stencil_dimension[1]; factor = sqrt(stencil_area / orig_area); - br->stencil_dimension[0] = factor*aspx; - br->stencil_dimension[1] = factor*aspy; + br->stencil_dimension[0] = factor * aspx; + br->stencil_dimension[1] = factor * aspy; } return OPERATOR_FINISHED; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 5edd14cd8e3..682e3c7ced2 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -381,11 +381,11 @@ static void sculpt_orig_vert_data_update(SculptOrigVertData *orig_data, /**********************************************************************/ /* Returns true if the stroke will use dynamic topology, false - otherwise. - - Factors: some brushes like grab cannot do dynamic topology. - Others, like smooth, are better without. Same goes for alt- - key smoothing. */ + * otherwise. + * + * Factors: some brushes like grab cannot do dynamic topology. + * Others, like smooth, are better without. Same goes for alt- + * key smoothing. */ static int sculpt_stroke_dynamic_topology(const SculptSession *ss, const Brush *brush) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 3d3b8009c99..fa976b2a0f8 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -962,10 +962,6 @@ void recalcData(TransInfo *t) else if (t->spacetype == SPACE_CLIP) { recalcData_spaceclip(t); } - - if (t->options & CTX_MASK) { - - } } void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options) diff --git a/source/blender/freestyle/intern/application/AppCanvas.cpp b/source/blender/freestyle/intern/application/AppCanvas.cpp index bca1044e770..2def2f269dd 100644 --- a/source/blender/freestyle/intern/application/AppCanvas.cpp +++ b/source/blender/freestyle/intern/application/AppCanvas.cpp @@ -98,7 +98,7 @@ void AppCanvas::init() static bool firsttime = true; if (firsttime) { _Renderer = new BlenderStrokeRenderer; - if(!StrokeRenderer::loadTextures()) { + if (!StrokeRenderer::loadTextures()) { cerr << "unable to load stroke textures" << endl; return; } diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp index d5163e2e76f..5b010d5ebc2 100644 --- a/source/blender/freestyle/intern/application/Controller.cpp +++ b/source/blender/freestyle/intern/application/Controller.cpp @@ -650,7 +650,7 @@ void Controller::ComputeSteerableViewMap() // FIXME !! again! img[i] = new GrayImage(_pView->width(), _pView->height()); for (unsigned int y = 0; y < img[i]->height(); ++y) { - for(unsigned int x = 0; x < img[i]->width(); ++x) { + for (unsigned int x = 0; x < img[i]->width(); ++x) { //img[i]->setPixel(x, y, (float)qGray(qimg.pixel(x, y)) / 255.0f); img[i]->setPixel(x, y, (float)qGray(qimg.pixel(x, y))); //float c = qGray(qimg.pixel(x, y)); @@ -664,7 +664,7 @@ void Controller::ComputeSteerableViewMap() #if 0 qimg = QImage(_pView->width(), _pView->height(), 32); for (unsigned int y = 0; y < img[i]->height(); ++y) { - for(unsigned int x = 0; x < img[i]->width(); ++x) { + for (unsigned int x = 0; x < img[i]->width(); ++x) { float v = img[i]->pixel(x, y); qimg.setPixel(x, y, qRgb(v, v, v)); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 44f91aaafe7..bced355c4f0 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1089,8 +1089,8 @@ static void do_render_3d(Render *re) #ifdef WITH_FREESTYLE /* Freestyle */ - if( re->r.mode & R_EDGE_FRS) - if(!re->test_break(re->tbh)) + if (re->r.mode & R_EDGE_FRS) + if (!re->test_break(re->tbh)) add_freestyle(re); #endif @@ -2361,10 +2361,10 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene) { re->result_ok= 0; - if(render_initialize_from_main(re, bmain, scene, NULL, NULL, scene->lay, 0, 0)) { + if (render_initialize_from_main(re, bmain, scene, NULL, NULL, scene->lay, 0, 0)) { do_render_fields_blur_3d(re); } - re->result_ok= 1; + re->result_ok = 1; } #endif diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index ebf788024c5..f43f8c30d57 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -308,7 +308,7 @@ void BL_MakeScreenShot(bScreen *screen, ScrArea *curarea, const char *filename) Scene *scene = (screen)? screen->scene: NULL; ImageFormatData im_format; - if(scene) + if (scene) im_format = scene->r.im_format; else BKE_imformat_defaults(&im_format); |