diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-08 16:55:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-08 16:55:05 +0400 |
commit | 357655af32204d5edf2b6257bd39168f3d1c9cc7 (patch) | |
tree | 870706a18937e071811b07afb4b8142e229c4408 /source/blender/render/intern/raytrace | |
parent | 8238cd6992413d8d85e48b9b5dceabbbc49d1d1f (diff) |
use static functions for raycast functions.
Diffstat (limited to 'source/blender/render/intern/raytrace')
6 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/render/intern/raytrace/bvh.h b/source/blender/render/intern/raytrace/bvh.h index 47d3a892e84..25fdb41bb3a 100644 --- a/source/blender/render/intern/raytrace/bvh.h +++ b/source/blender/render/intern/raytrace/bvh.h @@ -359,7 +359,7 @@ static int bvh_node_raycast(Node *node, Isect *isec) #endif template<class Node, class HintObject> -void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject) +static void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject) { assert(hint->size + reserve_space + 1 <= RE_RAY_LCTS_MAX_SIZE); diff --git a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp index 33ce3bd33d5..5b90ae77732 100644 --- a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp @@ -94,7 +94,7 @@ void bvh_done<QBVHTree>(QBVHTree *obj) } template<int StackSize> -int intersect(QBVHTree *obj, Isect *isec) +static int intersect(QBVHTree *obj, Isect *isec) { //TODO renable hint support if (RE_rayobject_isAligned(obj->root)) { @@ -108,7 +108,7 @@ int intersect(QBVHTree *obj, Isect *isec) } template<class Tree> -void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) +static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) { //TODO renable hint support { @@ -118,7 +118,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m } /* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */ template<class Tree, int STACK_SIZE> -RayObjectAPI make_api() +static RayObjectAPI make_api() { static RayObjectAPI api = { diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp index c1bdfa6c72c..eb7dddac06e 100644 --- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp @@ -126,7 +126,7 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj) } template<int StackSize> -int intersect(SVBVHTree *obj, Isect *isec) +static int intersect(SVBVHTree *obj, Isect *isec) { //TODO renable hint support if (RE_rayobject_isAligned(obj->root)) { @@ -140,7 +140,7 @@ int intersect(SVBVHTree *obj, Isect *isec) } template<class Tree> -void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) +static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) { //TODO renable hint support { @@ -150,7 +150,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m } /* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */ template<class Tree, int STACK_SIZE> -RayObjectAPI make_api() +static RayObjectAPI make_api() { static RayObjectAPI api = { @@ -167,7 +167,7 @@ RayObjectAPI make_api() } template<class Tree> -RayObjectAPI *bvh_get_api(int maxstacksize) +static RayObjectAPI *bvh_get_api(int maxstacksize) { static RayObjectAPI bvh_api256 = make_api<Tree, 1024>(); diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp index 3e80deefecd..dfa5a69b335 100644 --- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp @@ -129,7 +129,7 @@ void bvh_done<VBVHTree>(VBVHTree *obj) } template<int StackSize> -int intersect(VBVHTree *obj, Isect *isec) +static int intersect(VBVHTree *obj, Isect *isec) { //TODO renable hint support if (RE_rayobject_isAligned(obj->root)) { @@ -143,7 +143,7 @@ int intersect(VBVHTree *obj, Isect *isec) } template<class Tree> -void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) +static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) { //TODO renable hint support { @@ -174,7 +174,7 @@ static void bfree(VBVHTree *tree) /* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */ template<class Tree, int STACK_SIZE> -RayObjectAPI make_api() +static RayObjectAPI make_api() { static RayObjectAPI api = { diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h index 5624df25267..fd54433edd0 100644 --- a/source/blender/render/intern/raytrace/reorganize.h +++ b/source/blender/render/intern/raytrace/reorganize.h @@ -55,13 +55,13 @@ extern int tot_pushdown; #endif template<class Node> -bool node_fits_inside(Node *a, Node *b) +static bool node_fits_inside(Node *a, Node *b) { return bb_fits_inside(b->bb, b->bb + 3, a->bb, a->bb + 3); } template<class Node> -void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Node *> &cost) +static void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Node *> &cost) { std::queue<Node *> q; q.push(tree); @@ -81,7 +81,7 @@ void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Nod } template<class Node> -void reorganize(Node *root) +static void reorganize(Node *root) { std::queue<Node *> q; @@ -124,7 +124,7 @@ void reorganize(Node *root) * prunes nodes with only one child (except if that child is a primitive) */ template<class Node> -void remove_useless(Node *node, Node **new_node) +static void remove_useless(Node *node, Node **new_node) { if (RE_rayobject_isAligned(node->child) ) { @@ -153,7 +153,7 @@ void remove_useless(Node *node, Node **new_node) * it uses surface area heuristic for determining whether a node should be colapsed */ template<class Node> -void pushup(Node *parent) +static void pushup(Node *parent) { if (is_leaf(parent)) return; @@ -189,7 +189,7 @@ void pushup(Node *parent) * try to optimize number of childs to be a multiple of SSize */ template<class Node, int SSize> -void pushup_simd(Node *parent) +static void pushup_simd(Node *parent) { if (is_leaf(parent)) return; @@ -221,7 +221,7 @@ void pushup_simd(Node *parent) * makes sure no child fits inside any of its sibling */ template<class Node> -void pushdown(Node *parent) +static void pushdown(Node *parent) { Node **s_child = &parent->child; Node *child = parent->child; @@ -260,7 +260,7 @@ void pushdown(Node *parent) * readjust nodes BB (useful if nodes childs where modified) */ template<class Node> -float bvh_refit(Node *node) +static float bvh_refit(Node *node) { if (is_leaf(node)) return 0; if (is_leaf(node->child)) return 0; diff --git a/source/blender/render/intern/raytrace/vbvh.h b/source/blender/render/intern/raytrace/vbvh.h index 9755bf89668..abccab5fc13 100644 --- a/source/blender/render/intern/raytrace/vbvh.h +++ b/source/blender/render/intern/raytrace/vbvh.h @@ -79,7 +79,7 @@ inline static void bvh_node_push_childs(Node *node, Isect *UNUSED(isec), Node ** template<class Node> -int count_childs(Node *parent) +static int count_childs(Node *parent) { int n = 0; for (Node *i = parent->child; i; i = i->sibling) { @@ -93,7 +93,7 @@ int count_childs(Node *parent) template<class Node> -void append_sibling(Node *node, Node *sibling) +static void append_sibling(Node *node, Node *sibling) { while (node->sibling) node = node->sibling; |