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-12-04 00:25:17 +0300
committerHans Goudey <h.goudey@me.com>2021-12-04 00:25:17 +0300
commit2d8606b36071dd14290aa8852451535a49d3096d (patch)
tree66674726756a859fa1a1e66e9b8eac84387ba2b8 /source/blender/editors/space_node/space_node.cc
parentca0dbf8c26fb637ad06bd170e4e25d200d7ca0f0 (diff)
Cleanup: Use references in node editor, other improvements
This helps to tell when a pointer is expected to be null, and avoid overly verbose code when dereferencing. This commit also includes a few other cleanups in this area: - Use const in a few places - Use `float2` instead of `float[2]` - Remove some unnecessary includes and old code The change can be continued further in the future.
Diffstat (limited to 'source/blender/editors/space_node/space_node.cc')
-rw-r--r--source/blender/editors/space_node/space_node.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc
index ffca26946bc..b57f091b1d7 100644
--- a/source/blender/editors/space_node/space_node.cc
+++ b/source/blender/editors/space_node/space_node.cc
@@ -479,7 +479,7 @@ static void node_area_refresh(const struct bContext *C, ScrArea *area)
/* default now: refresh node is starting preview */
SpaceNode *snode = (SpaceNode *)area->spacedata.first;
- snode_set_context(C);
+ snode_set_context(*C);
if (snode->nodetree) {
if (snode->nodetree->type == NTREE_SHADER) {
@@ -595,7 +595,7 @@ static void node_cursor(wmWindow *win, ScrArea *area, ARegion *region)
&snode->runtime->cursor[1]);
/* here snode->runtime->cursor is used to detect the node edge for sizing */
- node_set_cursor(win, snode, snode->runtime->cursor);
+ node_set_cursor(*win, *snode, snode->runtime->cursor);
/* XXX snode->runtime->cursor is in placing new nodes space */
snode->runtime->cursor[0] /= UI_DPI_FAC;
@@ -629,7 +629,7 @@ static void node_main_region_init(wmWindowManager *wm, ARegion *region)
static void node_main_region_draw(const bContext *C, ARegion *region)
{
- node_draw_space(C, region);
+ node_draw_space(*C, *region);
}
/* ************* dropboxes ************* */
@@ -752,7 +752,7 @@ static void node_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region
static void node_header_region_draw(const bContext *C, ARegion *region)
{
/* find and set the context */
- snode_set_context(C);
+ snode_set_context(*C);
ED_region_header(C, region);
}