diff options
Diffstat (limited to 'crawl-ref/source/coord.cc')
-rw-r--r-- | crawl-ref/source/coord.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crawl-ref/source/coord.cc b/crawl-ref/source/coord.cc index 576c71bd27..c4f1a5ec64 100644 --- a/crawl-ref/source/coord.cc +++ b/crawl-ref/source/coord.cc @@ -97,4 +97,15 @@ coord_def random_in_bounds() random_range(MAPGEN_BORDER, GYM - MAPGEN_BORDER - 1)); } +// Coordinate system conversions. + +coord_def player2grid(const coord_def &pc) +{ + return (pc + you.pos()); +} + +coord_def grid2player(const coord_def &gc) +{ + return (gc - you.pos()); +} |