Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-05-11 00:33:55 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-05-11 00:33:55 +0400
commit4c66616f4457098f344d6660a8b011a0bbcd9bbb (patch)
treecc8f5799dc2cd5e8754a6e3e8ad83bd9414739ce /source
parent4a149bcb6685ba37a9e0cc557b0a6e6d5d99747d (diff)
Add GridPaintMask accessor to paint.c.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_paint.h5
-rw-r--r--source/blender/blenkernel/intern/paint.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index bd31a62abf9..7bee131c63b 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -35,6 +35,7 @@
struct Brush;
struct MDisps;
struct MeshElemMap;
+struct GridPaintMask;
struct MFace;
struct MultireModifierData;
struct MVert;
@@ -68,6 +69,10 @@ int paint_is_face_hidden(const struct MFace *f, const struct MVert *mvert);
int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
int gridsize, int x, int y);
+/* paint masks */
+float paint_grid_paint_mask(const struct GridPaintMask *gpm, unsigned level,
+ unsigned x, unsigned y);
+
/* Session data (mode-specific) */
typedef struct SculptSession {
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 08d8479fd93..9001605d684 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -172,3 +172,12 @@ int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
BLI_BITMAP_GET(grid_hidden, (y+1) * gridsize + x+1) ||
BLI_BITMAP_GET(grid_hidden, (y+1) * gridsize + x));
}
+
+float paint_grid_paint_mask(const GridPaintMask *gpm, unsigned level,
+ unsigned x, unsigned y)
+{
+ int factor = ccg_factor(level, gpm->level);
+ int gridsize = ccg_gridsize(gpm->level);
+
+ return gpm->data[(y*factor) * gridsize + (x*factor)];
+}