diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-24 10:10:35 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-24 11:05:13 +0100 |
commit | e022aaa532c3c4b5cd43b1ea7d43e1e2e4e7aa91 (patch) | |
tree | 2dd3d2702c6afb0c2143ffed1c4e9305b10311ea /crawl-ref/source/coord.cc | |
parent | 6728050e3e412aa0c335a3f7439657288c79d4c5 (diff) | |
download | crawl-ref-e022aaa532c3c4b5cd43b1ea7d43e1e2e4e7aa91.tar.gz crawl-ref-e022aaa532c3c4b5cd43b1ea7d43e1e2e4e7aa91.zip |
Move player2grid and grid2player to coord.
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()); +} |