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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-01-31 14:56:40 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-01-31 16:31:41 +0300
commitc1da8e3b28f95188f9e9152383856c95f29586b4 (patch)
tree611acd206bfb126f076e78caa047b14bcd3673b6 /source/blender/depsgraph/intern/depsgraph_physics.cc
parent7ccef23c4d010d4b4f83efe2cd6c82ff26824a10 (diff)
Depsgraph: Comb code to a better state all over
Some summary of changes: - Don't use DEG prefix for types and enumerator values: the code is already inside DEG namespace. - Put code where it locally belongs to: avoid having one single header file with all sort of definitions in it. - Take advantage of modern C++11 enabled by default.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_physics.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_physics.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc
index e091f612a05..f0d3644d57c 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -27,6 +27,8 @@
* Physics utilities for effectors and collision.
*/
+#include "intern/depsgraph_physics.h"
+
#include "MEM_guardedalloc.h"
#include "BLI_compiler_compat.h"
@@ -48,7 +50,6 @@ extern "C" {
#include "DEG_depsgraph_query.h"
#include "depsgraph.h"
-#include "depsgraph_intern.h"
/*************************** Evaluation Query API *****************************/
@@ -110,7 +111,7 @@ void DEG_add_collision_relations(DepsNodeHandle *handle,
{
Depsgraph *depsgraph = DEG_get_graph_from_handle(handle);
DEG::Depsgraph *deg_graph = (DEG::Depsgraph *)depsgraph;
- ListBase *relations = deg_build_collision_relations(
+ ListBase *relations = build_collision_relations(
deg_graph, collection, modifier_type);
LISTBASE_FOREACH (CollisionRelation *, relation, relations) {
Object *ob1 = relation->ob;
@@ -140,7 +141,7 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle,
Depsgraph *depsgraph = DEG_get_graph_from_handle(handle);
DEG::Depsgraph *deg_graph = (DEG::Depsgraph *)depsgraph;
ListBase *relations =
- deg_build_effector_relations(deg_graph, effector_weights->group);
+ build_effector_relations(deg_graph, effector_weights->group);
LISTBASE_FOREACH (EffectorRelation *, relation, relations) {
if (relation->ob == object) {
continue;
@@ -195,8 +196,7 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle,
namespace DEG
{
-ListBase *deg_build_effector_relations(Depsgraph *graph,
- Collection *collection)
+ListBase *build_effector_relations(Depsgraph *graph, Collection *collection)
{
GHash *hash = graph->physics_relations[DEG_PHYSICS_EFFECTOR];
if (hash == NULL) {
@@ -215,9 +215,9 @@ ListBase *deg_build_effector_relations(Depsgraph *graph,
return relations;
}
-ListBase *deg_build_collision_relations(Depsgraph *graph,
- Collection *collection,
- unsigned int modifier_type)
+ListBase *build_collision_relations(Depsgraph *graph,
+ Collection *collection,
+ unsigned int modifier_type)
{
const ePhysicsRelationType type = modifier_to_relation_type(modifier_type);
GHash *hash = graph->physics_relations[type];
@@ -251,11 +251,11 @@ void free_collision_relations(void *value)
} // namespace
-void deg_clear_physics_relations(Depsgraph *graph)
+void clear_physics_relations(Depsgraph *graph)
{
for (int i = 0; i < DEG_PHYSICS_RELATIONS_NUM; i++) {
if (graph->physics_relations[i]) {
- ePhysicsRelationType type = (ePhysicsRelationType)i;
+ const ePhysicsRelationType type = (ePhysicsRelationType)i;
switch (type) {
case DEG_PHYSICS_EFFECTOR: