Simplify xrel() and yrel()
Value of XNORM() and YNORM() is in [0,WORLD_X) and [0,WORLD_Y), respectively.
This commit is contained in:
parent
5f76428524
commit
ae835ff1db
1 changed files with 0 additions and 4 deletions
|
@ -71,8 +71,6 @@ xrel(struct natstr *np, coord absx)
|
|||
x = XNORM(absx - np->nat_xorg);
|
||||
if (x >= WORLD_X / 2)
|
||||
x -= WORLD_X;
|
||||
else if (x < -WORLD_X / 2)
|
||||
x += WORLD_X;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
@ -84,8 +82,6 @@ yrel(struct natstr *np, coord absy)
|
|||
y = YNORM(absy - np->nat_yorg);
|
||||
if (y >= WORLD_Y / 2)
|
||||
y -= WORLD_Y;
|
||||
else if (y < -WORLD_Y / 2)
|
||||
y += WORLD_Y;
|
||||
return y;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue