aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_readwrite.c
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2002-11-25 10:47:53 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2002-11-25 10:47:53 +0000
commit5aef03b3a165b309622f6d051bd4d53c42b4532d (patch)
tree808a2924e736f3327c968f0868fd1efdbc3a1aec /pd/src/g_readwrite.c
parentb09bea965d034a8e092b35d369f2ef6591ef0e65 (diff)
This commit was generated by cvs2svn to compensate for changes in r232,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=233
Diffstat (limited to 'pd/src/g_readwrite.c')
-rw-r--r--pd/src/g_readwrite.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c
index ab380971..40755bb0 100644
--- a/pd/src/g_readwrite.c
+++ b/pd/src/g_readwrite.c
@@ -587,20 +587,20 @@ static void canvas_saveto(t_canvas *x, t_binbuf *b)
linetraverser_start(&t, x);
while (oc = linetraverser_next(&t))
{
- int srcno, sinkno;
- for (srcno = 0, y = x->gl_list; y && y != &t.tr_ob->ob_g; y = y->g_next)
- srcno++;
- for (sinkno = 0, y = x->gl_list; y && y != &t.tr_ob2->ob_g; y = y->g_next)
- sinkno++;
+ int srcno = canvas_getindex(x, &t.tr_ob->ob_g);
+ int sinkno = canvas_getindex(x, &t.tr_ob2->ob_g);
binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"),
srcno, t.tr_outno, sinkno, t.tr_inno);
}
- if (x->gl_isgraph)
- binbuf_addv(b, "ssfffffff;", gensym("#X"), gensym("coords"),
- x->gl_x1, x->gl_y1,
- x->gl_x2, x->gl_y2,
- (float)x->gl_pixwidth, (float)x->gl_pixheight,
- (float)x->gl_isgraph);
+ /* unless everything is the default (as in ordinary subpatches)
+ print out a "coords" message to set up the coordinate systems */
+ if (x->gl_isgraph || x->gl_x1 || x->gl_y1 ||
+ x->gl_x2 != 1 || x->gl_y2 != 1 || x->gl_pixwidth || x->gl_pixheight)
+ binbuf_addv(b, "ssfffffff;", gensym("#X"), gensym("coords"),
+ x->gl_x1, x->gl_y1,
+ x->gl_x2, x->gl_y2,
+ (float)x->gl_pixwidth, (float)x->gl_pixheight,
+ (float)x->gl_isgraph);
}
/* call this recursively to collect all the template names for