From 2f9b7410dc712961f5684e4892660167c693cda8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Apr 2013 00:43:49 +0000 Subject: code cleanup: warnings + style --- source/blender/blenkernel/BKE_paint.h | 2 +- source/blender/blenkernel/intern/paint.c | 20 ++++++------ source/blender/editors/screen/glutil.c | 4 +-- source/blender/editors/sculpt_paint/paint_cursor.c | 10 +++--- source/blender/editors/sculpt_paint/paint_utils.c | 8 ++--- source/blender/gpu/intern/gpu_extensions.c | 2 +- source/blender/makesdna/DNA_scene_types.h | 36 +++++++++++----------- source/blender/makesrna/intern/rna_texture.c | 3 +- 8 files changed, 43 insertions(+), 42 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 810ff2faabc..d4239e3e6fd 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -72,7 +72,7 @@ typedef enum PaintMode { #define PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY 2 #define PAINT_INVALID_OVERLAY_CURVE 4 -void BKE_paint_invalidate_overlay_tex (struct Scene *scene,const struct Tex *tex); +void BKE_paint_invalidate_overlay_tex (struct Scene *scene, const struct Tex *tex); void BKE_paint_invalidate_cursor_overlay (struct Scene *scene, struct CurveMapping *curve); void BKE_paint_invalidate_overlay_all(void); int BKE_paint_get_overlay_flags (void); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index e232e339603..ad7ac2a046b 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -29,7 +29,8 @@ * \ingroup bke */ - +#include +#include #include "DNA_object_types.h" #include "DNA_mesh_types.h" @@ -51,9 +52,6 @@ #include "bmesh.h" -#include -#include - const char PAINT_CURSOR_SCULPT[3] = {255, 100, 100}; const char PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255}; const char PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255}; @@ -81,18 +79,20 @@ void BKE_paint_invalidate_cursor_overlay (Scene *scene, CurveMapping *curve) overlay_flags |= PAINT_INVALID_OVERLAY_CURVE; } -void BKE_paint_invalidate_overlay_all() +void BKE_paint_invalidate_overlay_all(void) { - overlay_flags |= PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY; - overlay_flags |= PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY; - overlay_flags |= PAINT_INVALID_OVERLAY_CURVE; + overlay_flags |= (PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY | + PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY | + PAINT_INVALID_OVERLAY_CURVE); } -int BKE_paint_get_overlay_flags () { +int BKE_paint_get_overlay_flags(void) +{ return overlay_flags; } -void BKE_paint_reset_overlay_invalid (void) { +void BKE_paint_reset_overlay_invalid(void) +{ overlay_flags &= ~(PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY | PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY | PAINT_INVALID_OVERLAY_CURVE); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index dd8c5fab0c6..932ff9b4887 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -1043,10 +1043,10 @@ void glaDrawImBuf_glsl(ImBuf *ibuf, float x, float y, int zoomfilter, return; /* Dithering is not supported on GLSL yet */ - force_fallback = ibuf->dither != 0.0f; + // force_fallback = ibuf->dither != 0.0f; /* Single channel images could not be transformed using GLSL yet */ - force_fallback = ibuf->channels == 1; + // force_fallback = ibuf->channels == 1; /* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */ force_fallback = !ELEM(U.image_draw_method, diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index c104a5fac94..0422c2f82de 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -88,7 +88,7 @@ static int same_tex_snap(TexSnapshot *snap, Brush *brush, ViewContext *vc) //(mtex->brush_map_mode != MTEX_MAP_MODE_VIEW || //(BKE_brush_size_get(vc->scene, brush) <= snap->BKE_brush_size_get)) && - (mtex->brush_map_mode != MTEX_MAP_MODE_TILED || + (mtex->brush_map_mode != MTEX_MAP_MODE_TILED || (vc->ar->winx == snap->winx && vc->ar->winy == snap->winy)) ); @@ -230,8 +230,8 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col) paint_get_tex_pixel_col(&br->mtex, x, y, rgba, pool); if (br->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) { - float curve_str = BKE_brush_curve_strength(br, len, 1); - CLAMP(curve_str, 0.0, 1.0); + float curve_str = BKE_brush_curve_strength(br, len, 1.0f); + CLAMP(curve_str, 0.0f, 1.0f); mul_v4_fl(rgba, curve_str); /* Falloff curve */ } buffer[index * 4] = rgba[0] * 255; @@ -245,10 +245,10 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col) avg += br->texture_sample_bias; if (br->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) - avg *= BKE_brush_curve_strength(br, len, 1); /* Falloff curve */ + avg *= BKE_brush_curve_strength(br, len, 1.0f); /* Falloff curve */ /* clamp to avoid precision overflow */ - CLAMP(avg, 0.0, 1.0); + CLAMP(avg, 0.0f, 1.0f); buffer[index] = 255 - (GLubyte)(255 * avg); } } diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 0bf27267c89..18ecd0cec84 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -206,10 +206,10 @@ void paint_get_tex_pixel_col(MTex *mtex, float u, float v, float rgba[4], struct rgba[2] = intensity; rgba[3] = 1.0f; } - CLAMP(rgba[0], 0.0, 1.0); - CLAMP(rgba[1], 0.0, 1.0); - CLAMP(rgba[2], 0.0, 1.0); - CLAMP(rgba[3], 0.0, 1.0); + CLAMP(rgba[0], 0.0f, 1.0f); + CLAMP(rgba[1], 0.0f, 1.0f); + CLAMP(rgba[2], 0.0f, 1.0f); + CLAMP(rgba[3], 0.0f, 1.0f); } /* 3D Paint */ diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index dfd4b5f2b83..5d645a5545b 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -108,7 +108,7 @@ void GPU_extensions_disable(void) GG.extdisabled = 1; } -int GPU_max_texture_size () +int GPU_max_texture_size(void) { return GG.maxtexsize; } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index dc3022e3b03..b306bc9a64f 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -920,18 +920,18 @@ typedef struct UnifiedPaintSettings { } UnifiedPaintSettings; typedef enum { - UNIFIED_PAINT_SIZE = (1<<0), - UNIFIED_PAINT_ALPHA = (1<<1), - UNIFIED_PAINT_WEIGHT = (1<<5), + UNIFIED_PAINT_SIZE = (1 << 0), + UNIFIED_PAINT_ALPHA = (1 << 1), + UNIFIED_PAINT_WEIGHT = (1 << 5), /* only used if unified size is enabled, mirros the brush flags * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */ - UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2), - UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1<<3), + UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2), + UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1 << 3), /* only used if unified alpha is enabled, mirrors the brush flag * BRUSH_ALPHA_PRESSURE */ - UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1<<4) + UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1 << 4) } UnifiedPaintSettingsFlags; /* *************************************************************** */ @@ -1508,24 +1508,24 @@ typedef enum { /* Sculpt.flags */ /* These can eventually be moved to paint flags? */ typedef enum SculptFlags { - SCULPT_SYMM_X = (1<<0), - SCULPT_SYMM_Y = (1<<1), - SCULPT_SYMM_Z = (1<<2), - SCULPT_LOCK_X = (1<<3), - SCULPT_LOCK_Y = (1<<4), - SCULPT_LOCK_Z = (1<<5), - SCULPT_SYMMETRY_FEATHER = (1<<6), - SCULPT_USE_OPENMP = (1<<7), - SCULPT_ONLY_DEFORM = (1<<8), - SCULPT_SHOW_DIFFUSE = (1<<9), + SCULPT_SYMM_X = (1 << 0), + SCULPT_SYMM_Y = (1 << 1), + SCULPT_SYMM_Z = (1 << 2), + SCULPT_LOCK_X = (1 << 3), + SCULPT_LOCK_Y = (1 << 4), + SCULPT_LOCK_Z = (1 << 5), + SCULPT_SYMMETRY_FEATHER = (1 << 6), + SCULPT_USE_OPENMP = (1 << 7), + SCULPT_ONLY_DEFORM = (1 << 8), + SCULPT_SHOW_DIFFUSE = (1 << 9), /* If set, the mesh will be drawn with smooth-shading in * dynamic-topology mode */ - SCULPT_DYNTOPO_SMOOTH_SHADING = (1<<10), + SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10), /* If set, dynamic-topology brushes will collapse short edges in * addition to subdividing long ones */ - SCULPT_DYNTOPO_COLLAPSE = (1<<11) + SCULPT_DYNTOPO_COLLAPSE = (1 << 11) } SculptFlags; /* ImagePaintSettings.flag */ diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index ad8115e52ac..e57d9586a32 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -258,7 +258,8 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN } } -void rna_TextureSlot_brush_update(Main *bmain, Scene *scene, PointerRNA *ptr) { +void rna_TextureSlot_brush_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ ID *id = ptr->id.data; DAG_id_tag_update(id, 0); -- cgit v1.2.3