code cleanup: warnings + style

This commit is contained in:
Campbell Barton
2013-04-13 00:43:49 +00:00
parent 7cf1d86e4a
commit 2f9b7410dc
8 changed files with 43 additions and 42 deletions

View File

@@ -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);

View File

@@ -29,7 +29,8 @@
* \ingroup bke
*/
#include <stdlib.h>
#include <string.h>
#include "DNA_object_types.h"
#include "DNA_mesh_types.h"
@@ -51,9 +52,6 @@
#include "bmesh.h"
#include <stdlib.h>
#include <string.h>
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);

View File

@@ -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,

View File

@@ -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);
}
}

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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 */

View File

@@ -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);