sctoff2xy(): New, factored out of sct_oninit()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
f2b1ea3161
commit
0f3134fc15
3 changed files with 10 additions and 4 deletions
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Dave Pare, 1989
|
||||
* Markus Armbruster, 2004-2011
|
||||
* Markus Armbruster, 2004-2013
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -208,6 +208,12 @@ sctoff(coord x, coord y)
|
|||
return XYOFFSET(XNORM(x), YNORM(y));
|
||||
}
|
||||
|
||||
void sctoff2xy(coord *x, coord *y, int off)
|
||||
{
|
||||
*y = off * 2 / WORLD_X;
|
||||
*x = off * 2 % WORLD_X + *y % 2;
|
||||
}
|
||||
|
||||
coord
|
||||
xnorm(coord x)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue