2.5 Paint:
[blender.git] / source / blender / blenkernel / intern / paint.c
index 54192afb904dddcc77f5243e43074c0437d5ae49..7c5b2b82b4b7663b83390bcc4ed787ea3209bc41 100644 (file)
 #include <stdlib.h>
 #include <string.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};
+const char PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255};
+
 Paint *paint_get_active(Scene *sce)
 {
        if(sce && sce->basact && sce->basact->object) {
 Paint *paint_get_active(Scene *sce)
 {
        if(sce && sce->basact && sce->basact->object) {
@@ -87,8 +92,10 @@ void paint_brush_set(Paint *p, Brush *br)
                        
                }
                
                        
                }
                
-               if(!found)
+               if(!found) {
                        paint_brush_slot_add(p);
                        paint_brush_slot_add(p);
+                       id_us_plus(&br->id);
+               }
                
                /* Make sure the current slot is the new brush */
                p->brushes[p->active_brush_index] = br;
                
                /* Make sure the current slot is the new brush */
                p->brushes[p->active_brush_index] = br;
@@ -152,14 +159,17 @@ int paint_facesel_test(Object *ob)
 
 }
 
 
 }
 
-void paint_init(Paint *p, const char *name)
+void paint_init(Paint *p, const char col[3])
 {
        Brush *brush;
 
        /* If there's no brush, create one */
        brush = paint_brush(p);
 {
        Brush *brush;
 
        /* If there's no brush, create one */
        brush = paint_brush(p);
-       brush_check_exists(&brush, name);
+       brush_check_exists(&brush, "Brush");
        paint_brush_set(p, brush);
        paint_brush_set(p, brush);
+
+       memcpy(p->paint_cursor_col, col, 3);
+       p->paint_cursor_col[3] = 128;
 }
 
 void free_paint(Paint *paint)
 }
 
 void free_paint(Paint *paint)