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:
authorTon Roosendaal <ton@blender.org>2009-02-17 16:37:06 +0300
committerTon Roosendaal <ton@blender.org>2009-02-17 16:37:06 +0300
commit7a66002753e8da11e53cb8cdad28bde606847758 (patch)
tree2001f2f686712264397c5ace5a595621fb4620fe /source/blender/editors/space_node
parent8020515ab2bf52aedc4250a51f7f928f057092e4 (diff)
2.5
Node/Composite tinkering: - titles in headers and on collapsed nodes back - backdrop option draws again (no scroll operator yet) - added preview option in blur, filter and mix nodes. Just for fun while working :) Probably every node should get this...
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/drawnode.c15
-rw-r--r--source/blender/editors/space_node/node_draw.c24
-rw-r--r--source/blender/editors/space_node/node_intern.h2
3 files changed, 14 insertions, 27 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index cc6fe4e9ebd..841600d7262 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -2443,7 +2443,7 @@ void node_rename_but(char *s)
#endif
-void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
+void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode)
{
if((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
@@ -2453,12 +2453,12 @@ void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
float x, y;
/* somehow the offset has to be calculated inverse */
- //glaDefine2DArea(&sa->winrct);
+ glaDefine2DArea(&ar->winrct);
/* ortho at pixel level curarea */
- //myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
+ wmOrtho2(-0.375, ar->winx-0.375, -0.375, ar->winy-0.375);
- x = (sa->winx-ibuf->x)/2 + snode->xof;
- y = (sa->winy-ibuf->y)/2 + snode->yof;
+ x = (ar->winx-ibuf->x)/2 + snode->xof;
+ y = (ar->winy-ibuf->y)/2 + snode->yof;
if(ibuf->rect)
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
@@ -2466,9 +2466,8 @@ void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
/* sort this out, this should not be needed */
- //myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax);
- //bwin_clear_viewmat(sa->win); /* clear buttons view */
- // glLoadIdentity();
+ wmOrtho2(ar->v2d.cur.xmin, ar->v2d.cur.xmax, ar->v2d.cur.ymin, ar->v2d.cur.ymax);
+ glLoadIdentity();
}
}
}
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 39a2144e867..8c9d2d12c86 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -94,7 +94,7 @@ extern void ui_rasterpos_safe(float x, float y, float aspect);
extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
-#if 0 // XXX
+
static void snode_drawstring(void *curfont, SpaceNode *snode, char *str, int okwidth)
{
char drawstr[NODE_MAXSTR];
@@ -118,7 +118,7 @@ static void snode_drawstring(void *curfont, SpaceNode *snode, char *str, int okw
}
UI_DrawString(curfont, drawstr, 0);
}
-#endif
+
static void node_scaling_widget(int color_id, float aspect, float xmin, float ymin, float xmax, float ymax)
{
@@ -730,7 +730,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
else
UI_ThemeColor(TH_TEXT);
- // ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
+ ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
if(node->flag & NODE_MUTED)
sprintf(showname, "[%s]", node->name);
@@ -739,11 +739,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
else
BLI_strncpy(showname, node->name, 128);
- block= uiBeginBlock(C, ar, "snode_drawstring_hack", UI_EMBOSSN, UI_HELV);
- // snode_drawstring(block->curfont, snode, showname, (int)(iconofs - rct->xmin-18.0f));
- bt= uiDefBut(block, LABEL, 0, showname, (int)rct->xmin+19, (int)rct->ymax-NODE_DY+5, 100, 20, NULL, 0, 0, 0, 0, "");
- uiEndBlock(C, block);
- block= NULL;
+ snode_drawstring(snode->curfont, snode, showname, (int)(iconofs - rct->xmin-18.0f));
/* body */
UI_ThemeColor4(TH_NODE);
@@ -871,7 +867,6 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
static void node_draw_hidden(View2D *v2d, SpaceNode *snode, bNode *node)
{
-// uiBlock *block; // XXX HACK
bNodeSocket *sock;
rctf *rct= &node->totr;
float dx, centy= 0.5f*(rct->ymax+rct->ymin);
@@ -923,13 +918,7 @@ static void node_draw_hidden(View2D *v2d, SpaceNode *snode, bNode *node)
else
BLI_strncpy(showname, node->name, 128);
- /* XXX
- block= uiBeginBlock(C, ar, "snode_drawstring_hack", UI_EMBOSSN, UI_HELV);
- // snode_drawstring(block->curfont, snode, showname, (int)(iconofs - rct->xmin-18.0f));
- bt= uiDefBut(block, LABEL, 0, showname, rct->xmin+21, centy-4, 100, 20, NULL, 0, 0, 0, 0, "");
- uiEndBlock(C, block);
- */
-
+ snode_drawstring(snode->curfont, snode, showname, (int)(rct->xmax - rct->xmin-18.0f -12.0f));
}
/* scale widget thing */
@@ -1092,7 +1081,6 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
float col[3];
View2DScrollers *scrollers;
SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C);
- ScrArea *sa= CTX_wm_area(C);
UI_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0);
@@ -1112,7 +1100,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
UI_view2d_constant_grid_draw(C, v2d);
/* backdrop */
- draw_nodespace_back_pix(sa, snode);
+ draw_nodespace_back_pix(ar, snode);
/* nodes */
snode_set_context(snode, CTX_data_scene(C));
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index b8fbed6db16..de3999ae5cb 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -64,7 +64,7 @@ void NODE_OT_border_select(struct wmOperatorType *ot);
void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link);
void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int th_col2, int do_shaded);
int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol);
-void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode);
+void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode);
/* node_edit.c */
void snode_handle_recalc(bContext *C, SpaceNode *snode);