Simplify routech[]
routech[][1] hasn't been used in living memory. Drop it, and simplify to routech[].
This commit is contained in:
parent
2ec20c8896
commit
d012940230
4 changed files with 5 additions and 12 deletions
|
@ -58,7 +58,7 @@ enum p_mode { /* How to find path to destination */
|
||||||
extern signed char dirindex['z'-'a'+1];
|
extern signed char dirindex['z'-'a'+1];
|
||||||
extern int diroff[DIR_MAP+1][2];
|
extern int diroff[DIR_MAP+1][2];
|
||||||
extern char dirch[DIR_MAP+2];
|
extern char dirch[DIR_MAP+2];
|
||||||
extern char *routech[DIR_LAST+1][2];
|
extern char *routech[DIR_LAST+1];
|
||||||
|
|
||||||
/* src/lib/subs/paths.c */
|
/* src/lib/subs/paths.c */
|
||||||
extern char *getpath(char *, char *, coord, coord, int, int, enum p_mode);
|
extern char *getpath(char *, char *, coord, coord, int, int, enum p_mode);
|
||||||
|
|
|
@ -101,8 +101,7 @@ path(void)
|
||||||
if (i == DIR_STOP)
|
if (i == DIR_STOP)
|
||||||
break;
|
break;
|
||||||
memcpy(&map[delty(&ns.range, cy)][deltx(&ns.range, cx) * 2],
|
memcpy(&map[delty(&ns.range, cy)][deltx(&ns.range, cx) * 2],
|
||||||
routech[i][0],
|
routech[i], 3);
|
||||||
3);
|
|
||||||
cx = xnorm(cx + diroff[i][0]);
|
cx = xnorm(cx + diroff[i][0]);
|
||||||
cy = ynorm(cy + diroff[i][1]);
|
cy = ynorm(cy + diroff[i][1]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ rout(void)
|
||||||
p = &map[ns.dy][ns.dx * 2];
|
p = &map[ns.dy][ns.dx * 2];
|
||||||
if ((dir = sect.sct_del[i_del] & 0x7) &&
|
if ((dir = sect.sct_del[i_del] & 0x7) &&
|
||||||
nstr_exec(cond, ncond, §))
|
nstr_exec(cond, ncond, §))
|
||||||
memcpy(p, routech[dir][0], 3);
|
memcpy(p, routech[dir], 3);
|
||||||
p[1] = dchr[sect.sct_type].d_mnem;
|
p[1] = dchr[sect.sct_type].d_mnem;
|
||||||
}
|
}
|
||||||
for (row = 0, y = ns.range.ly; row < ns.range.height; y++, row++) {
|
for (row = 0, y = ns.range.ly; row < ns.range.height; y++, row++) {
|
||||||
|
|
|
@ -63,12 +63,6 @@ signed char dirindex[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* must agree with dirch[] and DIR_ defines */
|
/* must agree with dirch[] and DIR_ defines */
|
||||||
char *routech[][2] = {
|
char *routech[] = {
|
||||||
{" ", "$ $"},
|
" ", " /", " >"," \\","/ ","< ","\\ "
|
||||||
{" /", "$ /"},
|
|
||||||
{" >", "$ >"},
|
|
||||||
{" \\", "$ \\"},
|
|
||||||
{"/ ", "/ $"},
|
|
||||||
{"< ", "< $"},
|
|
||||||
{"\\ ", "\\ $"}
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue