header cleanup, include BLI before BKE, also use bool for ntreeShaderExecTree
authorCampbell Barton <ideasman42@gmail.com>
Thu, 24 Jan 2013 21:57:13 +0000 (21:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 24 Jan 2013 21:57:13 +0000 (21:57 +0000)
27 files changed:
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/ocean.c
source/blender/blenlib/BLI_math_base.h
source/blender/bmesh/operators/bmo_mesh_conv.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/screen/glutil.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_texture.c
source/blender/nodes/composite/nodes/node_composite_common.c
source/blender/nodes/intern/node_exec.c
source/blender/nodes/intern/node_exec.h
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/shader/node_shader_util.h
source/blender/nodes/shader/nodes/node_shader_common.c
source/blender/nodes/texture/node_texture_util.h
source/blender/nodes/texture/nodes/node_texture_common.c
source/blender/render/intern/raytrace/rayobject_vbvh.cpp
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeinput.c

index 64fb49c..5f504df 100644 (file)
@@ -731,4 +731,4 @@ BLI_INLINE int DM_origindex_mface_mpoly(const int *index_mf_to_mpoly, const int
        return (j != ORIGINDEX_NONE) ? (index_mp_to_orig ? index_mp_to_orig[j] : j) : ORIGINDEX_NONE;
 }
 
-#endif
+#endif  /* __BKE_DERIVEDMESH_H__ */
index 1b7b294..8e4d370 100644 (file)
@@ -99,5 +99,4 @@ typedef struct Main {
 }
 #endif
 
-#endif
-
+#endif  /* __BKE_MAIN_H__ */
index d3fb7ee..718fa2f 100644 (file)
@@ -577,7 +577,7 @@ struct ShadeResult;
 
 struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree, int use_tree_data);
 void            ntreeShaderEndExecTree(struct bNodeTreeExec *exec, int use_tree_data);
-int             ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
+bool            ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
 void            ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
 void            nodeShaderSynchronizeID(struct bNode *node, int copyto);
 
index ad828a7..5028d97 100644 (file)
 
 #include "BLI_utildefines.h"
 #include "BLI_linklist.h"
+#include "BLI_math.h"
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_tessmesh.h"
 
-#include "BLI_math.h"
 #include "MEM_guardedalloc.h"
 
 /* Math stuff for ray casting on mesh faces and for nearest surface */
index c4274aa..695ac7d 100644 (file)
 
 #include "DNA_scene_types.h"
 
-#include "BKE_global.h" /* XXX TESTING */
-#include "BKE_image.h"
-#include "BKE_ocean.h"
-
 #include "BLI_math.h"
 #include "BLI_path_util.h"
 #include "BLI_rand.h"
@@ -46,6 +42,9 @@
 #include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_image.h"
+#include "BKE_ocean.h"
+
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
 
@@ -1425,4 +1424,4 @@ void BKE_bake_ocean(struct Ocean *UNUSED(o), struct OceanCache *UNUSED(och),
        /* unused */
        (void)update_cb;
 }
-#endif /* WITH_OCEANSIM */
\ No newline at end of file
+#endif /* WITH_OCEANSIM */
index 15b8eb1..56c8ffb 100644 (file)
 #define hypotf(a, b) ((float)hypot(a, b))
 #endif
 
-#endif
+#endif  /* C99 or POSIX.1-2001 */
 
 #ifdef WIN32
 #  ifndef FREE_WINDOWS
index fa8beb3..0976c4c 100644 (file)
@@ -36,6 +36,9 @@
 #include "DNA_key_types.h"
 #include "DNA_modifier_types.h"
 
+#include "BLI_math.h"
+#include "BLI_array.h"
+
 #include "BKE_mesh.h"
 #include "BLI_listbase.h"
 #include "BKE_global.h"
@@ -43,9 +46,6 @@
 #include "BKE_main.h"
 #include "BKE_customdata.h"
 
-#include "BLI_math.h"
-#include "BLI_array.h"
-
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
index bdff02c..3385d33 100644 (file)
 #include "DNA_dynamicpaint_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
+#include "DNA_object_force.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_string.h"
 #include "BLI_ghash.h"
 #include "BLI_rect.h"
+#include "BLI_math.h"
+#include "BLI_listbase.h"
 
 #include "BLF_api.h"
 #include "BLF_translation.h"
 #include "BKE_animsys.h"
 #include "BKE_colortools.h"
 #include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_displist.h"
 #include "BKE_dynamicpaint.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
-#include "BKE_object.h"
 #include "BKE_material.h"
-#include "BKE_texture.h"
+#include "BKE_modifier.h"
+#include "BKE_object.h"
+#include "BKE_particle.h"
 #include "BKE_report.h"
-#include "BKE_displist.h"
 #include "BKE_sca.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
+#include "BKE_texture.h"
 
 #include "ED_screen.h"
 #include "ED_object.h"
 #include "ED_render.h"
+#include "ED_util.h"
 
 #include "RNA_access.h"
 #include "RNA_enum_types.h"
@@ -716,21 +723,6 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna
 
 #define ERROR_LIBDATA_MESSAGE "Can't edit external libdata"
 
-#include <string.h>
-
-#include "DNA_object_force.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-
-#include "ED_util.h"
-
-#include "BLI_math.h"
-#include "BLI_listbase.h"
-
-#include "ED_object.h"
-
 static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v)
 {
        Scene *scene = CTX_data_scene(C);
index f073fdd..105c2dc 100644 (file)
 
 #include "BLI_rect.h"
 #include "BLI_utildefines.h"
+#include "BLI_math.h"
+#include "BLI_threads.h"
 
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 
-#include "BLI_math.h"
-#include "BLI_threads.h"
-
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
index 04154a2..927834a 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_main.h"
-#include "BKE_mask.h"
-#include "BKE_movieclip.h"
-#include "BKE_context.h"
-#include "BKE_tracking.h"
-#include "BKE_library.h"
-
 #include "DNA_mask_types.h"
 #include "DNA_object_types.h"  /* SELECT */
 
 #include "BLI_string.h"
 #include "BLI_rect.h"
 
+#include "BKE_main.h"
+#include "BKE_mask.h"
+#include "BKE_movieclip.h"
+#include "BKE_context.h"
+#include "BKE_tracking.h"
+#include "BKE_library.h"
+
 #include "GPU_extensions.h"
 
 #include "IMB_imbuf_types.h"
index a3efa15..7d2b80d 100644 (file)
 
 #include "DNA_node_types.h"
 
-#include "BKE_context.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-
 #include "BLI_rect.h"
 #include "BLI_lasso.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_context.h"
+#include "BKE_main.h"
+#include "BKE_node.h"
+
 #include "ED_node.h"  /* own include */
 #include "ED_screen.h"
 #include "ED_types.h"
index 615ae71..bf1c540 100644 (file)
 #include "DNA_space_types.h"
 #include "DNA_view3d_types.h"
 
-#include "BKE_blender.h"
-#include "BKE_context.h"
-#include "BKE_main.h"
-
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_blender.h"
+#include "BKE_context.h"
+#include "BKE_main.h"
+
 #include "RNA_access.h"
 
 #include "WM_api.h"
index 90a92db..63cde9c 100644 (file)
@@ -52,6 +52,9 @@
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
 
+#include "BLI_threads.h"
+#include "BLI_blenlib.h"
+
 #include "BKE_bmfont.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
@@ -62,9 +65,6 @@
 #include "BKE_scene.h"
 #include "BKE_DerivedMesh.h"
 
-#include "BLI_threads.h"
-#include "BLI_blenlib.h"
-
 #include "GPU_buffers.h"
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
index 0ef60aa..e8e4701 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_global.h"
-
-
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 #include "BLI_math_base.h"
 
+#include "BKE_global.h"
+
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "gpu_codegen.h"
index c408b91..f7daf6a 100644 (file)
@@ -40,6 +40,8 @@
 #include "DNA_sequence_types.h"
 #include "DNA_movieclip_types.h"
 
+#include "BLI_math.h"
+
 #include "BKE_animsys.h"
 #include "BKE_global.h"
 #include "BKE_sequencer.h"
@@ -48,7 +50,6 @@
 #include "MEM_guardedalloc.h"
 
 #include "WM_types.h"
-#include "BLI_math.h"
 
 #include "BLF_translation.h"
 
index 14db7bd..fc67ae2 100644 (file)
@@ -44,6 +44,8 @@
 #include "DNA_particle_types.h"
 #include "DNA_scene_types.h" /* MAXFRAME only */
 
+#include "BLI_utildefines.h"
+
 #include "BKE_node.h"
 
 #include "WM_api.h"
index 835c2b7..7198798 100644 (file)
 
 #include "DNA_node_types.h"
 
-#include "BKE_node.h"
-
 #include "node_composite_util.h"
 #include "node_common.h"
 #include "node_exec.h"
 
+#include "BKE_node.h"
+
 void register_node_type_cmp_group(bNodeTreeType *ttype)
 {
        static bNodeType ntype;
index 579d46f..7a8b8c9 100644 (file)
@@ -287,7 +287,7 @@ void ntreeReleaseThreadStack(bNodeThreadStack *nts)
        nts->used = 0;
 }
 
-int ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *callerdata, int thread)
+bool ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *callerdata, int thread)
 {
        bNodeStack *nsin[MAX_SOCKET];   /* arbitrary... watch this */
        bNodeStack *nsout[MAX_SOCKET];  /* arbitrary... watch this */
@@ -306,7 +306,7 @@ int ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *calle
                         * and hence execute it!
                         */
 //                     if (node->typeinfo->compatibility == NODE_NEW_SHADING)
-//                             return 0;
+//                             return false;
                        if (node->typeinfo->execfunc)
                                node->typeinfo->execfunc(callerdata, node, nsin, nsout);
                        else if (node->typeinfo->newexecfunc)
@@ -315,5 +315,5 @@ int ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *calle
        }
        
        /* signal to that all went OK, for render */
-       return 1;
+       return true;
 }
index 679439e..5febda0 100644 (file)
@@ -79,6 +79,6 @@ void ntree_exec_end(struct bNodeTreeExec *exec);
 
 struct bNodeThreadStack *ntreeGetThreadStack(struct bNodeTreeExec *exec, int thread);
 void ntreeReleaseThreadStack(struct bNodeThreadStack *nts);
-int ntreeExecThreadNodes(struct bNodeTreeExec *exec, struct bNodeThreadStack *nts, void *callerdata, int thread);
+bool ntreeExecThreadNodes(struct bNodeTreeExec *exec, struct bNodeThreadStack *nts, void *callerdata, int thread);
 
 #endif
index 74a64f1..8fde0b9 100644 (file)
@@ -249,7 +249,7 @@ void ntreeShaderEndExecTree(bNodeTreeExec *exec, int use_tree_data)
 }
 
 /* only for Blender internal */
-int ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
+bool ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
 {
        ShaderCallData scd;
        /**
index e4dc74e..9c91150 100644 (file)
 #include "DNA_scene_types.h"
 #include "DNA_texture_types.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_threads.h"
+#include "BLI_utildefines.h"
+
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 #include "BKE_global.h"
 #include "NOD_shader.h"
 #include "node_util.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_threads.h"
-#include "BLI_utildefines.h"
-
 #include "BLF_translation.h"
 
 #include "IMB_imbuf_types.h"
index cf6f778..9c78470 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "DNA_node_types.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_node.h"
 
 #include "node_shader_util.h"
index 16dbc2f..3b2a7e1 100644 (file)
 #include "DNA_scene_types.h"
 #include "DNA_texture_types.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_threads.h"
+#include "BLI_utildefines.h"
+
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 #include "BKE_global.h"
 #include "BKE_material.h"
 #include "BKE_node.h"
 #include "BKE_texture.h"
-
 #include "BKE_library.h"
 
 #include "node_util.h"
 
 #include "NOD_texture.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_threads.h"
-#include "BLI_utildefines.h"
-
 #include "BLF_translation.h"
 
 #include "IMB_imbuf_types.h"
index 41bfd0a..aa427ff 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "DNA_node_types.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_node.h"
 
 #include "node_texture_util.h"
index d03bdb7..3e80dee 100644 (file)
@@ -38,12 +38,12 @@ int tot_hints    = 0;
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_global.h"
-
 #include "BLI_math.h"
 #include "BLI_memarena.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_global.h"
+
 #include "rayintersection.h"
 #include "rayobject.h"
 #include "rayobject_rtbuild.h"
index 87912f5..1a24055 100644 (file)
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
 
-#include "BKE_global.h"
-#include "BKE_scene.h"
-
-
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_jitter.h"
@@ -49,6 +45,9 @@
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_global.h"
+#include "BKE_scene.h"
+
 #include "PIL_time.h"
 
 #include "renderpipeline.h"
index c59c368..bf0087d 100644 (file)
@@ -151,7 +151,7 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
 /* do a shade, finish up some passes, apply mist */
 void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
 {
-       int compat = 0;
+       bool compat = false;
        float alpha;
        
        /* ------  main shading loop -------- */
@@ -163,7 +163,7 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
                compat = ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
        
        /* also run this when node shaders fail, due to incompatible shader nodes */
-       if (compat == 0) {
+       if (compat == false) {
                /* copy all relevant material vars, note, keep this synced with render_types.h */
                shade_input_init_material(shi);