Make snxtsct_area() expect correct range width and height
snxtsct_area() computed width and height, overwriting the values passed in, even though all but two callers passed correct values. The exceptions were snxtsct() in case NS_ALL, and snxtsct_all(). Change them to pass correct values, and drop the recomputation from snxtsct_area(). Simplifies the interface between snxtsct_area() and its callers.
This commit is contained in:
parent
bf9389a7a9
commit
5c4963c464
1 changed files with 2 additions and 3 deletions
|
@ -85,7 +85,7 @@ snxtsct(struct nstr_sect *np, char *str)
|
||||||
range.ly = yabs(natp, -WORLD_Y / 2);
|
range.ly = yabs(natp, -WORLD_Y / 2);
|
||||||
range.hx = xabs(natp, WORLD_X / 2);
|
range.hx = xabs(natp, WORLD_X / 2);
|
||||||
range.hy = yabs(natp, WORLD_Y / 2);
|
range.hy = yabs(natp, WORLD_Y / 2);
|
||||||
range.width = range.height = 0;
|
xysize_range(&range);
|
||||||
snxtsct_area(np, &range);
|
snxtsct_area(np, &range);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -108,7 +108,7 @@ snxtsct_all(struct nstr_sect *np)
|
||||||
worldrange.ly = -WORLD_Y / 2;
|
worldrange.ly = -WORLD_Y / 2;
|
||||||
worldrange.hx = WORLD_X / 2;
|
worldrange.hx = WORLD_X / 2;
|
||||||
worldrange.hy = WORLD_Y / 2;
|
worldrange.hy = WORLD_Y / 2;
|
||||||
worldrange.width = worldrange.height = 0;
|
xysize_range(&worldrange);
|
||||||
snxtsct_area(np, &worldrange);
|
snxtsct_area(np, &worldrange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,6 @@ snxtsct_area(struct nstr_sect *np, struct range *range)
|
||||||
np->y = np->range.ly;
|
np->y = np->range.ly;
|
||||||
np->dx = -1;
|
np->dx = -1;
|
||||||
np->dy = 0;
|
np->dy = 0;
|
||||||
xysize_range(&np->range);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue