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:
authorCampbell Barton <ideasman42@gmail.com>2014-04-01 04:34:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-01 08:22:28 +0400
commit617557b08ea94e2b65a1697ddf0b79651204d92b (patch)
tree50b24bab075b42fa20456140c9a9681cfb01325b /source/blender/blenkernel/intern/material.c
parent2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d (diff)
Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index eb8b385bbc7..01bbd1db003 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -80,7 +80,7 @@ void init_def_material(void)
/* not material itself */
void BKE_material_free(Material *ma)
{
- BKE_material_free_ex(ma, TRUE);
+ BKE_material_free_ex(ma, true);
}
/* not material itself */
@@ -294,7 +294,8 @@ void BKE_material_make_local(Material *ma)
Mesh *me;
Curve *cu;
MetaBall *mb;
- int a, is_local = FALSE, is_lib = FALSE;
+ int a;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -318,8 +319,8 @@ void BKE_material_make_local(Material *ma)
if (ob->mat) {
for (a = 0; a < ob->totcol; a++) {
if (ob->mat[a] == ma) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -331,8 +332,8 @@ void BKE_material_make_local(Material *ma)
if (me->mat) {
for (a = 0; a < me->totcol; a++) {
if (me->mat[a] == ma) {
- if (me->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (me->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -344,8 +345,8 @@ void BKE_material_make_local(Material *ma)
if (cu->mat) {
for (a = 0; a < cu->totcol; a++) {
if (cu->mat[a] == ma) {
- if (cu->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (cu->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -357,8 +358,8 @@ void BKE_material_make_local(Material *ma)
if (mb->mat) {
for (a = 0; a < mb->totcol; a++) {
if (mb->mat[a] == ma) {
- if (mb->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (mb->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -366,7 +367,7 @@ void BKE_material_make_local(Material *ma)
}
/* Only local users. */
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &ma->id);
extern_local_material(ma);
}
@@ -944,14 +945,14 @@ short find_material_index(Object *ob, Material *ma)
return 0;
}
-int object_add_material_slot(Object *ob)
+bool object_add_material_slot(Object *ob)
{
- if (ob == NULL) return FALSE;
- if (ob->totcol >= MAXMAT) return FALSE;
+ if (ob == NULL) return false;
+ if (ob->totcol >= MAXMAT) return false;
assign_material(ob, NULL, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF);
ob->actcol = ob->totcol;
- return TRUE;
+ return true;
}
static void do_init_render_material(Material *ma, int r_mode, float *amb)
@@ -1128,7 +1129,7 @@ static bool material_in_nodetree(bNodeTree *ntree, Material *mat)
return 0;
}
-int material_in_material(Material *parmat, Material *mat)
+bool material_in_material(Material *parmat, Material *mat)
{
if (parmat == mat)
return 1;
@@ -1196,7 +1197,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
ma->id.flag &= ~LIB_DOIT;
}
-int object_remove_material_slot(Object *ob)
+bool object_remove_material_slot(Object *ob)
{
Material *mao, ***matarar;
Object *obt;
@@ -1204,14 +1205,14 @@ int object_remove_material_slot(Object *ob)
short a, actcol;
if (ob == NULL || ob->totcol == 0) {
- return FALSE;
+ return false;
}
/* this should never happen and used to crash */
if (ob->actcol <= 0) {
printf("%s: invalid material index %d, report a bug!\n", __func__, ob->actcol);
BLI_assert(0);
- return FALSE;
+ return false;
}
/* take a mesh/curve/mball as starting point, remove 1 index,
@@ -1280,7 +1281,7 @@ int object_remove_material_slot(Object *ob)
}
}
- return TRUE;
+ return true;
}
@@ -1532,7 +1533,7 @@ void free_matcopybuf(void)
matcopybuf.ramp_spec = NULL;
if (matcopybuf.nodetree) {
- ntreeFreeTree_ex(matcopybuf.nodetree, FALSE);
+ ntreeFreeTree_ex(matcopybuf.nodetree, false);
MEM_freeN(matcopybuf.nodetree);
matcopybuf.nodetree = NULL;
}
@@ -1558,7 +1559,7 @@ void copy_matcopybuf(Material *ma)
matcopybuf.mtex[a] = MEM_dupallocN(mtex);
}
}
- matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, FALSE);
+ matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, false);
matcopybuf.preview = NULL;
BLI_listbase_clear(&matcopybuf.gpumaterial);
matcopied = 1;
@@ -1611,7 +1612,7 @@ void paste_matcopybuf(Material *ma)
}
}
- ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, FALSE);
+ ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, false);
}