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:
authorHans Goudey <h.goudey@me.com>2021-01-20 01:43:08 +0300
committerHans Goudey <h.goudey@me.com>2021-01-20 01:43:08 +0300
commit6290091bace2fc7654dd3052b8b2553310cead13 (patch)
tree15ac3d25dac4a45ca1cac01fc60dcd2782880099 /source/blender/editors/space_node/drawnode.c
parentda6dea5701311f41c7d70429b111b901b6bcf966 (diff)
Cleanup: Store runtime space node variables in a separate struct
This commit moves runtime-only variables from the `SpaceNode` DNA struct to a private struct in `node_intern.h`. Before, it was hard to tell which data needed to be saved in files, this should make it more clear. Node that the `edittree` field is basically a runtime variable, since it's set from the `treepath` list on read, but moving it would require some more invasive changes that I don't think are worth it right now. Also, not all of the moved variables were explicitly cleared on read-- `aspect` is set at the start of a redraw, `cursor` is set in a region callback, and `recalc` was used as an update flag. Differential Revision: https://developer.blender.org/D10141
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r--source/blender/editors/space_node/drawnode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index c42b8f78952..7b09f681dfa 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -455,7 +455,7 @@ static void node_draw_frame(const bContext *C,
}
/* label */
- node_draw_frame_label(ntree, node, snode->aspect);
+ node_draw_frame_label(ntree, node, snode->runtime->aspect);
UI_block_end(C, node->block);
UI_block_draw(C, node->block);
@@ -3833,10 +3833,10 @@ static bool node_link_bezier_handles(const View2D *v2d,
float cursor[2] = {0.0f, 0.0f};
/* this function can be called with snode null (via cut_links_intersect) */
- /* XXX map snode->cursor back to view space */
+ /* XXX map snode->runtime->cursor back to view space */
if (snode) {
- cursor[0] = snode->cursor[0] * UI_DPI_FAC;
- cursor[1] = snode->cursor[1] * UI_DPI_FAC;
+ cursor[0] = snode->runtime->cursor[0] * UI_DPI_FAC;
+ cursor[1] = snode->runtime->cursor[1] * UI_DPI_FAC;
}
/* in v0 and v3 we put begin/end points */
@@ -4107,7 +4107,7 @@ static void nodelink_batch_draw(const SpaceNode *snode)
GPU_batch_program_set_builtin(g_batch_link.batch, GPU_SHADER_2D_NODELINK_INST);
GPU_batch_uniform_4fv_array(g_batch_link.batch, "colors", 6, colors);
- GPU_batch_uniform_1f(g_batch_link.batch, "expandSize", snode->aspect * LINK_WIDTH);
+ GPU_batch_uniform_1f(g_batch_link.batch, "expandSize", snode->runtime->aspect * LINK_WIDTH);
GPU_batch_uniform_1f(g_batch_link.batch, "arrowSize", ARROW_SIZE);
GPU_batch_draw(g_batch_link.batch);
@@ -4194,7 +4194,7 @@ void node_draw_link_bezier(const View2D *v2d,
GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_NODELINK);
GPU_batch_uniform_2fv_array(batch, "bezierPts", 4, vec);
GPU_batch_uniform_4fv_array(batch, "colors", 3, colors);
- GPU_batch_uniform_1f(batch, "expandSize", snode->aspect * LINK_WIDTH);
+ GPU_batch_uniform_1f(batch, "expandSize", snode->runtime->aspect * LINK_WIDTH);
GPU_batch_uniform_1f(batch, "arrowSize", ARROW_SIZE);
GPU_batch_uniform_1i(batch, "doArrow", drawarrow);
GPU_batch_draw(batch);