From 9d673cd3540d3970430358470335bdadae6f96d1 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 15 Aug 2009 19:48:50 +0000 Subject: 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. --- source/blender/blenkernel/BKE_global.h | 5 ---- source/blender/blenkernel/BKE_paint.h | 38 ++++++++++++++++++++++++++ source/blender/blenkernel/intern/DerivedMesh.c | 3 +- source/blender/blenkernel/intern/paint.c | 37 +++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 source/blender/blenkernel/BKE_paint.h create mode 100644 source/blender/blenkernel/intern/paint.c (limited to 'source/blender/blenkernel') 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)); + +} -- cgit v1.2.3