diff options
Diffstat (limited to 'crawl-ref/source/direct.h')
-rw-r--r-- | crawl-ref/source/direct.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crawl-ref/source/direct.h b/crawl-ref/source/direct.h index e591107578..d3aec5816a 100644 --- a/crawl-ref/source/direct.h +++ b/crawl-ref/source/direct.h @@ -44,4 +44,24 @@ bool in_vlos(int x, int y); std::string feature_description(int mx, int my); +inline int view2gridX(int vx) +{ + return (you.x_pos + vx - VIEW_CX); +} + +inline int view2gridY(int vy) +{ + return (you.y_pos + vy - VIEW_CY); +} + +inline int grid2viewX(int gx) +{ + return (gx - you.x_pos + VIEW_CX); +} + +inline int grid2viewY(int gy) +{ + return (gy - you.y_pos + VIEW_CY); +} + #endif |