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
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-08-15 23:48:50 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-15 23:48:50 +0400
commit9d673cd3540d3970430358470335bdadae6f96d1 (patch)
treebe20a59bf709bfb17167ba5d33457b59efa54192 /source/blender/blenkernel
parent0ce5163cc0aa32df5450752da9056059a88f1fd5 (diff)
2.5, continuing work with localizing paint modes.
* Replaced FACESEL_PAINT_TEST macro with paint_facesel_test. This removes one more thing from BKE_global, and it'll make it easier to localize. * Fixed sculpt paint cursor sometimes not showing.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_global.h5
-rw-r--r--source/blender/blenkernel/BKE_paint.h38
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c3
-rw-r--r--source/blender/blenkernel/intern/paint.c37
4 files changed, 77 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index dd50bf33869..3c31989e508 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -127,11 +127,6 @@ typedef struct Global {
/* #define G_AUTOMATKEYS (1 << 30) also removed */
#define G_HIDDENHANDLES (1 << 31) /* used for curves only */
-/* macro for testing face select mode
- * Texture paint could be removed since selected faces are not used
- * however hiding faces is useful */
-#define FACESEL_PAINT_TEST ((G.f&G_FACESELECT) && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)))
-
/* G.fileflags */
#define G_AUTOPACK (1 << 0)
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
new file mode 100644
index 00000000000..582b85d5672
--- /dev/null
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -0,0 +1,38 @@
+/*
+ * ***** 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_PAINT_H
+#define BKE_PAINT_H
+
+struct Object;
+
+/* testing face select mode
+ * Texture paint could be removed since selected faces are not used
+ * however hiding faces is useful */
+int paint_facesel_test(struct Object *ob);
+
+#endif
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 090f256ab9f..f4ed488b1f3 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -72,6 +72,7 @@
#include "BKE_modifier.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_subsurf.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
@@ -2076,7 +2077,7 @@ static void clear_mesh_caches(Object *ob)
static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
{
Object *obact = scene->basact?scene->basact->object:NULL;
- int editing = (FACESEL_PAINT_TEST)|(G.f & G_PARTICLEEDIT);
+ int editing = paint_facesel_test(ob)|(G.f & G_PARTICLEEDIT);
int needMapping = editing && (ob==obact);
float min[3], max[3];
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
new file mode 100644
index 00000000000..a42581f3a76
--- /dev/null
+++ b/source/blender/blenkernel/intern/paint.c
@@ -0,0 +1,37 @@
+/*
+ * ***** 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "DNA_object_types.h"
+
+#include "BKE_global.h"
+#include "BKE_paint.h"
+
+int paint_facesel_test(Object *ob)
+{
+ return (G.f&G_FACESELECT) && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT));
+
+}