Bevel mod: cleanup flags and extra data.
[blender.git] / source / blender / editors / sculpt_paint / paint_image.c
index 04941e364555a9eac99317934dbaca8a79c693e2..44f05c39a25b21135ee49ffef2d38aad59cfc6d9 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * All rights reserved.
  *
  * The Original Code is: some of this file.
- *
- * Contributor(s): Jens Ole Wund (bjornmose), Campbell Barton (ideasman42)
- *
- * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/editors/sculpt_paint/paint_image.c
- *  \ingroup edsculpt
- *  \brief Functions to paint images in 2D and 3D.
+/** \file
+ * \ingroup edsculpt
+ * \brief Functions to paint images in 2D and 3D.
  */
 
 #include <float.h>
@@ -84,7 +78,6 @@
 #include "GPU_immediate.h"
 #include "GPU_state.h"
 
-#include "BIF_gl.h"
 
 #include "IMB_colormanagement.h"
 
@@ -391,11 +384,14 @@ void paint_brush_init_tex(Brush *brush)
        /* init mtex nodes */
        if (brush) {
                MTex *mtex = &brush->mtex;
-               if (mtex->tex && mtex->tex->nodetree)
-                       ntreeTexBeginExecTree(mtex->tex->nodetree);  /* has internal flag to detect it only does it once */
+               if (mtex->tex && mtex->tex->nodetree) {
+                       /* has internal flag to detect it only does it once */
+                       ntreeTexBeginExecTree(mtex->tex->nodetree);
+               }
                mtex = &brush->mask_mtex;
-               if (mtex->tex && mtex->tex->nodetree)
+               if (mtex->tex && mtex->tex->nodetree) {
                        ntreeTexBeginExecTree(mtex->tex->nodetree);
+               }
        }
 }
 
@@ -493,7 +489,7 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo
        }
 
        settings->imapaint.flag |= IMAGEPAINT_DRAWING;
-       ED_image_undo_push_begin(op->type->name);
+       ED_image_undo_push_begin(op->type->name, PAINT_MODE_TEXTURE_2D);
 
        return pop;
 }
@@ -1105,7 +1101,8 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
 
                /* entering paint mode also sets image to editors */
                if (imapaint->mode == IMAGEPAINT_MODE_MATERIAL) {
-                       Material *ma = give_current_material(ob, ob->actcol); /* set the current material active paint slot on image editor */
+                       /* set the current material active paint slot on image editor */
+                       Material *ma = give_current_material(ob, ob->actcol);
 
                        if (ma && ma->texpaintslot)
                                ima = ma->texpaintslot[ma->paint_active_slot].ima;
@@ -1237,7 +1234,7 @@ void ED_imapaint_bucket_fill(struct bContext *C, float color[3], wmOperator *op)
 
        BKE_undosys_step_push_init_with_type(wm->undo_stack, C, op->type->name, BKE_UNDOSYS_TYPE_IMAGE);
 
-       ED_image_undo_push_begin(op->type->name);
+       ED_image_undo_push_begin(op->type->name, PAINT_MODE_TEXTURE_2D);
 
        paint_2d_bucket_fill(C, color, NULL, NULL, NULL);