Depsgraph: Refactor, move debug struct to own file

This commit is contained in:
Sergey Sharybin 2020-01-24 11:26:15 +01:00
parent c89e103348
commit cf84db61a6
4 changed files with 17 additions and 9 deletions

View File

@ -32,6 +32,10 @@
namespace DEG {
DepsgraphDebug::DepsgraphDebug() : flags(G.debug)
{
}
bool terminal_do_color(void)
{
return (G.debug & G_DEBUG_DEPSGRAPH_PRETTY) != 0;

View File

@ -31,6 +31,17 @@
namespace DEG {
struct DepsgraphDebug {
DepsgraphDebug();
/* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
int flags;
/* Name of this dependency graph (is used for debug prints, helping to distinguish graphs
* created for different view layer). */
string name;
};
#define DEG_DEBUG_PRINTF(depsgraph, type, ...) \
do { \
if (DEG_debug_flags_get(depsgraph) & G_DEBUG_DEPSGRAPH_##type) { \

View File

@ -83,7 +83,6 @@ Depsgraph::Depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluati
BLI_spin_init(&lock);
id_hash = BLI_ghash_ptr_new("Depsgraph id hash");
entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags");
debug.flags = G.debug;
memset(id_type_updated, 0, sizeof(id_type_updated));
memset(id_type_exist, 0, sizeof(id_type_exist));
memset(physics_relations, 0, sizeof(physics_relations));

View File

@ -40,6 +40,7 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_physics.h"
#include "intern/debug/deg_debug.h"
#include "intern/depsgraph_type.h"
struct GHash;
@ -156,14 +157,7 @@ struct Depsgraph {
* to read stuff from. */
bool is_active;
struct {
/* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
int flags;
/* Name of this dependency graph (is used for debug prints, helping to distinguish graphs
* created for different view layer). */
string name;
} debug;
DepsgraphDebug debug;
bool is_evaluating;