[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30139] branches/soc-2010-jwilkins/source/ blender: * quieted some warnings in sculpt.c and paint_stroke.c
Jason Wilkins
Jason.A.Wilkins at gmail.com
Fri Jul 9 08:23:01 CEST 2010
Revision: 30139
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30139
Author: jwilkins
Date: 2010-07-09 08:23:01 +0200 (Fri, 09 Jul 2010)
Log Message:
-----------
* quieted some warnings in sculpt.c and paint_stroke.c
Modified Paths:
--------------
branches/soc-2010-jwilkins/source/blender/blenlib/BLI_pbvh.h
branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
Modified: branches/soc-2010-jwilkins/source/blender/blenlib/BLI_pbvh.h
===================================================================
--- branches/soc-2010-jwilkins/source/blender/blenlib/BLI_pbvh.h 2010-07-09 05:04:52 UTC (rev 30138)
+++ branches/soc-2010-jwilkins/source/blender/blenlib/BLI_pbvh.h 2010-07-09 06:23:01 UTC (rev 30139)
@@ -166,6 +166,7 @@
float *fno;
} PBVHVertexIter;
+#pragma warning (disable:4127) // conditional expression is constant
#define BLI_pbvh_vertex_iter_begin(bvh, node, vi, mode) \
{ \
struct DMGridData **grids; \
@@ -176,6 +177,7 @@
vi.no= 0; \
vi.fno= 0; \
vi.mvert= 0; \
+ vi.skip= 0; \
\
BLI_pbvh_node_get_grids(bvh, node, &grid_indices, &totgrid, NULL, &gridsize, &grids, NULL); \
BLI_pbvh_node_num_verts(bvh, node, &uniq_verts, &totvert); \
Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c 2010-07-09 05:04:52 UTC (rev 30138)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c 2010-07-09 06:23:01 UTC (rev 30139)
@@ -100,7 +100,9 @@
glDisable(GL_LINE_SMOOTH);
}
+#if 0
+// grid texture for testing
#define GRID_WIDTH 8
#define GRID_LENGTH 8
@@ -170,9 +172,9 @@
#undef O
#undef Q
-static void load_grid(Brush* brush)
+static void load_grid()
{
- static GLint overlay_texture;
+ static GLuint overlay_texture;
if (!overlay_texture) {
//GLfloat largest_supported_anisotropy;
@@ -197,6 +199,8 @@
}
}
+#endif
+
extern float get_tex_pixel(Brush* br, float u, float v);
typedef struct Snapshot {
@@ -241,7 +245,7 @@
static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
{
- static GLint overlay_texture = 0;
+ static GLuint overlay_texture = 0;
static int init = 0;
static int tex_changed_timestamp = -1;
static int curve_changed_timestamp = -1;
@@ -286,7 +290,7 @@
size = old_size;
}
else
- size = size = 512;
+ size = 512;
if (old_size != size) {
if (overlay_texture) {
@@ -369,6 +373,9 @@
if (!overlay_texture)
glGenTextures(1, &overlay_texture);
}
+ else {
+ size= old_size;
+ }
glBindTexture(GL_TEXTURE_2D, overlay_texture);
@@ -511,10 +518,12 @@
// Functions should be refactored so that they can be used between sculpt.c and
// paint_stroke.c clearly and optimally and the lines of communication between the
// two modules should be more clearly defined.
-static void paint_draw_cursor(bContext *C, int x, int y, void *customdata)
+static void paint_draw_cursor(bContext *C, int x, int y, void *unused)
{
ViewContext vc;
+ (void)unused;
+
view3d_set_viewcontext(C, &vc);
if (vc.obact->sculpt) {
@@ -728,8 +737,6 @@
}
if (ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_FIXED, MTEX_MAP_MODE_TILED) && brush->flag & BRUSH_TEXTURE_OVERLAY) {
- const float diameter = 2*sculpt_get_brush_size(brush);
-
glPushAttrib(
GL_COLOR_BUFFER_BIT|
GL_CURRENT_BIT|
@@ -863,7 +870,7 @@
if(event->custom == EVT_DATA_TABLET) {
wmTabletData *wmtab= event->customdata;
- pressure = (wmtab->Active != EVT_TABLET_NONE) ? pressure= wmtab->Pressure : 1;
+ pressure = (wmtab->Active != EVT_TABLET_NONE) ? wmtab->Pressure : 1;
pen_flip = (wmtab->Active == EVT_TABLET_ERASER);
}
else {
Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c 2010-07-09 05:04:52 UTC (rev 30138)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c 2010-07-09 06:23:01 UTC (rev 30139)
@@ -355,34 +355,36 @@
//test->mirror_symmetry_pass = ss->cache->mirror_symmetry_pass;
}
-//static int sculpt_brush_test_clip(SculptBrushTest* test, float co[3])
-//{
-// if (test->symmetry) {
-// int i;
-//
-// for (i = 0; i < 3; i++) {
-// if (test->mirror_symmetry_pass & (1<<i)) {
-// if (test->true_location[i] >= 0) {
-// if (co[i] >= 0) return 0;
-// }
-// else if (test->true_location[i] < 0) {
-// if (co[i] < 0) return 0;
-// }
-// }
-// else {
-// if (test->true_location[i] >= 0) {
-// if (co[i] < 0) return 0;
-// }
-// else if (test->true_location[i] < 0) {
-// if (co[i] >= 0) return 0;
-// }
-// }
-// }
-// }
-//
-// return 1;
-//}
+#if 0
+static int sculpt_brush_test_clip(SculptBrushTest* test, float co[3])
+{
+ if (test->symmetry) {
+ int i;
+
+ for (i = 0; i < 3; i++) {
+ if (test->mirror_symmetry_pass & (1<<i)) {
+ if (test->true_location[i] >= 0) {
+ if (co[i] >= 0) return 0;
+ }
+ else if (test->true_location[i] < 0) {
+ if (co[i] < 0) return 0;
+ }
+ }
+ else {
+ if (test->true_location[i] >= 0) {
+ if (co[i] < 0) return 0;
+ }
+ else if (test->true_location[i] < 0) {
+ if (co[i] >= 0) return 0;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
static int sculpt_brush_test_cyl(SculptBrushTest *test, float x0[3], float x1[3], float x2[3])
{
float t0[3], t1[3], t2[3], t3[3], dist;
@@ -404,6 +406,8 @@
}
}
+#endif
+
static int sculpt_brush_test(SculptBrushTest *test, float co[3])
{
//if (sculpt_brush_test_clip(test, co)) {
@@ -456,6 +460,8 @@
*/
+#if 0
+
/* area of overlap of two circles of radius 1 seperated by d units from their centers */
static float circle_overlap(float d)
{
@@ -468,6 +474,8 @@
return circle_overlap(d) / M_PI;
}
+#endif
+
static float overlapped_curve(Brush* br, float x)
{
int i;
@@ -631,6 +639,8 @@
return texres.tin;
}
+#if 0
+
/* Get a pixel from the texcache at (px, py) */
static unsigned char get_texcache_pixel(const SculptSession *ss, int px, int py)
{
@@ -668,6 +678,8 @@
get_texcache_pixel(ss, x2, y2) * urat) * vrat) / 255.0;
}
+#endif
+
/* Return a multiplier for brush strength on a particular vertex. */
static float tex_strength(SculptSession *ss, Brush *br, float *point, const float len)
{
@@ -892,8 +904,6 @@
SculptUndoNode *unode;
float private_an[3] = {0.0f, 0.0f, 0.0f};
float private_out_flip[3] = {0.0f, 0.0f, 0.0f};
- float private_fc[3] = {0.0f, 0.0f, 0.0f};
- int private_count = 0;
unode = sculpt_undo_push_node(ss, nodes[n]);
sculpt_brush_test_init(ss, &test);
@@ -1646,8 +1656,6 @@
PBVHVertexIter vd;
SculptBrushTest test;
SculptUndoNode *unode;
- float private_an[3] = {0.0f, 0.0f, 0.0f};
- float private_out_flip[3] = {0.0f, 0.0f, 0.0f};
float private_fc[3] = {0.0f, 0.0f, 0.0f};
int private_count = 0;
@@ -2321,10 +2329,12 @@
}
if (brush->sculpt_tool != SCULPT_TOOL_SMOOTH && brush->autosmooth_factor > 0)
- if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE)
+ if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) {
smooth(sd, ss, nodes, totnode, brush->autosmooth_factor*(1-ss->cache->pressure)*brush->autosmooth_overlap);
- else
+ }
+ else {
smooth(sd, ss, nodes, totnode, brush->autosmooth_factor*brush->autosmooth_overlap);
+ }
/* copy the modified vertices from mesh to the active key */
if(ss->kb)
@@ -2460,7 +2470,6 @@
static void do_symmetrical_brush_actions(Sculpt *sd, SculptSession *ss)
{
- Brush *brush = paint_brush(&sd->paint);
StrokeCache *cache = ss->cache;
const char symm = sd->flags & 7;
int i;
More information about the Bf-blender-cvs
mailing list