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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-07-31 07:44:45 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-07-31 07:44:45 +0400
commitadfc77c1dbf8c85b1e594c64ebf9d06fa48a5543 (patch)
tree4916e90145697be1d2d197c56cc9ee99b253185d /source
parentbf6ea3d717e66efd9d526f4f340d6cd6e14fd3e3 (diff)
Use bool instead of int.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_bake.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 9e62781bce1..8b674cf1e50 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -107,13 +107,14 @@ typedef struct {
int threads;
} MultiresBakeJob;
-static int multiresbake_check(bContext *C, wmOperator *op)
+static bool multiresbake_check(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob;
Mesh *me;
MultiresModifierData *mmd;
- int ok = 1, a;
+ bool ok = true;
+ int a;
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
{
@@ -122,7 +123,7 @@ static int multiresbake_check(bContext *C, wmOperator *op)
if (ob->type != OB_MESH) {
BKE_report(op->reports, RPT_ERROR, "Baking of multires data only works with an active mesh object");
- ok = 0;
+ ok = false;
break;
}
@@ -137,12 +138,12 @@ static int multiresbake_check(bContext *C, wmOperator *op)
for (md = (ModifierData *)mmd->modifier.next; md && ok; md = md->next) {
if (modifier_isEnabled(scene, md, eModifierMode_Realtime)) {
- ok = 0;
+ ok = false;
}
}
}
else {
- ok = 0;
+ ok = false;
}
if (!ok) {
@@ -153,14 +154,14 @@ static int multiresbake_check(bContext *C, wmOperator *op)
if (mmd->lvl == 0) {
BKE_report(op->reports, RPT_ERROR, "Multires data baking is not supported for preview subdivision level 0");
- ok = 0;
+ ok = false;
break;
}
if (!me->mtpoly) {
BKE_report(op->reports, RPT_ERROR, "Mesh should be unwrapped before multires data baking");
- ok = 0;
+ ok = false;
}
else {
a = me->totpoly;
@@ -170,7 +171,7 @@ static int multiresbake_check(bContext *C, wmOperator *op)
if (!ima) {
BKE_report(op->reports, RPT_ERROR, "You should have active texture to use multires baker");
- ok = 0;
+ ok = false;
}
else {
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
@@ -178,14 +179,14 @@ static int multiresbake_check(bContext *C, wmOperator *op)
if (!ibuf) {
BKE_report(op->reports, RPT_ERROR, "Baking should happen to image with image buffer");
- ok = 0;
+ ok = false;
}
else {
if (ibuf->rect == NULL && ibuf->rect_float == NULL)
- ok = 0;
+ ok = false;
if (ibuf->rect_float && !(ibuf->channels == 0 || ibuf->channels == 4))
- ok = 0;
+ ok = false;
if (!ok)
BKE_report(op->reports, RPT_ERROR, "Baking to unsupported image type");