diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-03 11:55:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-03 12:35:44 +0400 |
commit | d900f5be55d0812eb5c7dfd3ea47020c3edafd41 (patch) | |
tree | 7d5035e3dbafdcd4988e7ed57068e48c951a989a /source/blender/gpu/intern | |
parent | a948ae2c5167c49819241572d3aacb4e4bf5b6d7 (diff) |
Code cleanup: use bools where possible
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 12 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index ecd4ad6f0c3..68cf51f10d3 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1191,7 +1191,7 @@ GPUNodeLink *GPU_builtin(GPUBuiltin builtin) return link; } -int GPU_link(GPUMaterial *mat, const char *name, ...) +bool GPU_link(GPUMaterial *mat, const char *name, ...) { GPUNode *node; GPUFunction *function; @@ -1227,7 +1227,7 @@ int GPU_link(GPUMaterial *mat, const char *name, ...) return 1; } -int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...) +bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...) { GPUNode *node; GPUFunction *function; diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index c4827a5868c..7de0bf9e504 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1336,11 +1336,11 @@ static struct GPUMaterialState { float (*gviewmat)[4]; float (*gviewinv)[4]; - int backface_culling; + bool backface_culling; GPUBlendMode *alphablend; GPUBlendMode alphablend_fixed[FIXEDMAT]; - int use_alpha_pass, is_alpha_pass; + bool use_alpha_pass, is_alpha_pass; int lastmatnr, lastretval; GPUBlendMode lastalphablend; @@ -1397,9 +1397,9 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O GPUMaterial *gpumat; GPUBlendMode alphablend; int a; - int gamma = BKE_scene_check_color_management_enabled(scene); - int new_shading_nodes = BKE_scene_use_new_shading_nodes(scene); - int use_matcap = (v3d->flag2 & V3D_SHOW_SOLID_MATCAP); /* assumes v3d->defmaterial->preview is set */ + const bool gamma = BKE_scene_check_color_management_enabled(scene); + const bool new_shading_nodes = BKE_scene_use_new_shading_nodes(scene); + const bool use_matcap = (v3d->flag2 & V3D_SHOW_SOLID_MATCAP) != 0; /* assumes v3d->defmaterial->preview is set */ ob = BKE_object_lod_matob_get(ob, scene); @@ -1409,7 +1409,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O GMS.lastretval = -1; GMS.lastalphablend = GPU_BLEND_SOLID; - GMS.backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING); + GMS.backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING) != 0; GMS.gob = ob; GMS.gscene = scene; diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 7c67e615217..2781437225b 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1891,11 +1891,11 @@ void GPU_lamp_free(Object *ob) BLI_freelistN(&ob->gpulamp); } -int GPU_lamp_has_shadow_buffer(GPULamp *lamp) +bool GPU_lamp_has_shadow_buffer(GPULamp *lamp) { return (!(lamp->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && - !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) && - lamp->tex && lamp->fb); + !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) && + lamp->tex && lamp->fb); } void GPU_lamp_update_buffer_mats(GPULamp *lamp) |