Depsgraph: Be consistent about id type variable name

This commit is contained in:
Sergey Sharybin 2017-07-24 15:33:35 +02:00
parent 7721f8a269
commit 7b420e1908
4 changed files with 15 additions and 15 deletions

View File

@ -176,7 +176,7 @@ void DEG_id_tag_update_ex(struct Main *bmain,
* Used by all sort of render engines to quickly check if
* IDs of a given type need to be checked for update.
*/
void DEG_id_type_tag(struct Main *bmain, short idtype);
void DEG_id_type_tag(struct Main *bmain, short id_type);
void DEG_ids_clear_recalc(struct Main *bmain);

View File

@ -50,7 +50,7 @@ extern "C" {
#endif
/* Check if given ID type was tagged for update. */
bool DEG_id_type_tagged(struct Main *bmain, short idtype);
bool DEG_id_type_tagged(struct Main *bmain, short id_type);
/* Get additional evaluation flags for the given ID. */
short DEG_get_eval_flags_for_id(struct Depsgraph *graph, struct ID *id);

View File

@ -53,9 +53,9 @@ extern "C" {
# include "intern/eval/deg_eval_copy_on_write.h"
#endif
bool DEG_id_type_tagged(Main *bmain, short idtype)
bool DEG_id_type_tagged(Main *bmain, short id_type)
{
return bmain->id_tag_update[BKE_idcode_to_index(idtype)] != 0;
return bmain->id_tag_update[BKE_idcode_to_index(id_type)] != 0;
}
short DEG_get_eval_flags_for_id(Depsgraph *graph, ID *id)

View File

@ -108,8 +108,8 @@ void lib_id_recalc_tag_flag(Main *bmain, ID *id, int flag)
* after relations update and after layer visibility changes.
*/
if (flag) {
short idtype = GS(id->name);
if (idtype == ID_OB) {
short id_type = GS(id->name);
if (id_type == ID_OB) {
Object *object = (Object *)id;
object->recalc |= (flag & OB_RECALC_ALL);
}
@ -151,9 +151,9 @@ void id_tag_update_object_transform(Depsgraph *graph, IDDepsNode *id_node)
/* Tag corresponding to OB_RECALC_DATA. */
void id_tag_update_object_data(Depsgraph *graph, IDDepsNode *id_node)
{
const short idtype = GS(id_node->id_orig->name);
const short id_type = GS(id_node->id_orig->name);
ComponentDepsNode *data_comp = NULL;
switch (idtype) {
switch (id_type) {
case ID_OB:
{
const Object *object = (Object *)id_node->id_orig;
@ -190,7 +190,7 @@ void id_tag_update_object_data(Depsgraph *graph, IDDepsNode *id_node)
/* Special legacy compatibility code, tag data ID for update when object
* is tagged for data update.
*/
if (idtype == ID_OB) {
if (id_type == ID_OB) {
Object *object = (Object *)id_node->id_orig;
ID *data_id = (ID *)object->data;
if (data_id != NULL) {
@ -316,8 +316,8 @@ void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph)
/* Make sure objects are up to date. */
GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash)
{
const short idtype = GS(id_node->id_orig->name);
if (idtype != ID_OB) {
const short id_type = GS(id_node->id_orig->name);
if (id_type != ID_OB) {
/* Ignore non-object nodes on visibility changes. */
continue;
}
@ -328,7 +328,7 @@ void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph)
*
* TODO(sergey): Need to generalize this somehow.
*/
if (idtype == ID_OB) {
if (id_type == ID_OB) {
Object *object = (Object *)id_node->id_orig;
flag |= OB_RECALC_OB;
if (ELEM(object->type, OB_MESH,
@ -370,9 +370,9 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, int flag)
}
/* Tag given ID type for update. */
void DEG_id_type_tag(Main *bmain, short idtype)
void DEG_id_type_tag(Main *bmain, short id_type)
{
if (idtype == ID_NT) {
if (id_type == ID_NT) {
/* Stupid workaround so parent datablocks of nested nodetree get looped
* over when we loop over tagged datablock types.
*/
@ -383,7 +383,7 @@ void DEG_id_type_tag(Main *bmain, short idtype)
DEG_id_type_tag(bmain, ID_SCE);
}
bmain->id_tag_update[BKE_idcode_to_index(idtype)] = 1;
bmain->id_tag_update[BKE_idcode_to_index(id_type)] = 1;
}
/* Recursively push updates out to all nodes dependent on this,