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 64fb49c4d66508bad29459ffbce28ef5225cda01..5f504df5628ddeae17a59b0bebb9211420ff0d43 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 1b7b29432e22a105eddd39f06f09eac83f3fcbd3..8e4d370e8a041c5f14d72ea3b9e546a586d62f21 100644 (file)
@@ -99,5 +99,4 @@ typedef struct Main {
 }
 #endif
 
-#endif
-
+#endif  /* __BKE_MAIN_H__ */
index d3fb7eeffc1f5d1e2876b4ae53d22260f0aa55f5..718fa2f9ecd7d78b6eea109a7382ab351d00bf19 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 ad828a70dd8a031371d23bf81e3060e9bd76d3e5..5028d97835111fd9ee369c793cece25a38a96b42 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 c4274aa1f9336caf18799973763df0742f6e6b85..695ac7da7929afa7f6aa2e9bd88c2f9a868bc09c 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 15b8eb184d0e2ee4d09d5e522fc6725962002a8a..56c8ffb693156c1a27b842e50351e7e0e5d87dd0 100644 (file)
 #define hypotf(a, b) ((float)hypot(a, b))
 #endif
 
-#endif
+#endif  /* C99 or POSIX.1-2001 */
 
 #ifdef WIN32
 #  ifndef FREE_WINDOWS
index fa8beb3716c4d3f530b5b84e5b3a48bf6ebed661..0976c4cdfbb11b7f7ec85b42f2041171291e3317 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 bdff02c15513f04932b408f6bbe65d965797fc83..3385d334b71f4fc72caf4f4c476e5c8ec4df5217 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 f073fdd5125a982801bb86434b5813affa8bd009..105c2dc88d117f111c62426c39c5e9251ada28d9 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 04154a27b74c8df7a235cb0f20bf11b66ec86e4e..927834a892431c9e866aa1d31d764b063d1fbdc5 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 a3efa15c54a0e397bf9162828600684665c511dd..7d2b80d50ba95dfb7e65fab39733e1b672b3bba1 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 615ae71cf9b32b3159c9ee0e4444323e511f1510..bf1c5404c0ecf5b34528845457cda23b96b67dea 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 90a92dbcddcc273e40d572bc8c82710cad4ce017..63cde9c7d5947c0d3e2b56f681917da7a1ddfe24 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 0ef60aaf978c71a88646368654f4792c4f7fcb65..e8e470131591b6eafc848d0bf2ae578938fe17d2 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 c408b9173471f5a07f04fe82a8b0eeca17381fc7..f7daf6a3b0618441d40a7074ff8ba5e8cc521007 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 14db7bddcd1d5c40082b6fefa23e4b4d31bd4320..fc67ae27387ee8a048af15658a57522ebd3f2e4c 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 835c2b75aa4986a9814d14ef9e63193b480d2559..7198798a152f0fee928b7aa5fbdac31ca4d40c90 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 579d46f45eb719f9fa601043a603eabcc788f365..7a8b8c940c9df0f6256692ce96f81c5011998a7d 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 679439ef12ebe21b178841703b9c67c4da7eb943..5febda036e02dc7aa8795862a0630abd0c7f24b1 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 74a64f186cbe74594e15b415398f1e4508154932..8fde0b9c3429341027ec1c3b7d8e4502592bcbf7 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 e4dc74e8d40981e8e254cac7231dbb11f24ddeb3..9c911501435e6f19f96e1d5c738f700fb63e6b3d 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 cf6f778bbf538ef948cf32fcfbe6971cdab1eed7..9c784709de3a313f9c8ee5994c2117d8f5780599 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 16dbc2f7bfb58d2a32a4ae3b7838a0663a8155a7..3b2a7e14f695d0ce165db7166538cd1a79017d4a 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 41bfd0ae00a802537f1d2de7d4a178884aaf4746..aa427ff3587d0eaf18ee7abdf3761aa4096e7aa7 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 d03bdb744072ee0fc5e675ac068a9138c8d1871f..3e80deefecd79d9b7e8063ddb271140b023db90b 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 87912f546e839097fc68c53d218fafa53ab56f32..1a24055c7f4e8801da6b2830f2400b6ece777990 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 c59c3685d7dd97eae53833fc94237bccfcc6e77b..bf0087d02927ad019cee665eec9f6910593b857a 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);