summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-04 06:53:25 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-04 06:53:25 +0000
commita75a924ca5f67336d9e065ab307d976c4cd8fabc (patch)
tree052710fb2cac216521e398e8774426092426bf41 /crawl-ref/source/dungeon.h
parentb53b7421dc0bda8dc3a4713cad64a6275132261c (diff)
downloadcrawl-ref-a75a924ca5f67336d9e065ab307d976c4cd8fabc.tar.gz
crawl-ref-a75a924ca5f67336d9e065ab307d976c4cd8fabc.zip
[1699948] Allow changing the viewport size if you're using a larger terminal
than 80x24. Also allow moving the PC around the viewport without scrolling the viewport if the viewport is large enough. This is not tested on DOS and Windows yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1524 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.h')
-rw-r--r--crawl-ref/source/dungeon.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h
index 226be99c82..172cea7061 100644
--- a/crawl-ref/source/dungeon.h
+++ b/crawl-ref/source/dungeon.h
@@ -56,6 +56,11 @@ struct dgn_region
return dgn_region(left, top, right - left + 1, bottom - top + 1);
}
+ static dgn_region absolute(const coord_def &c1, const coord_def &c2)
+ {
+ return dgn_region(c1.x, c1.y, c2.x, c2.y);
+ }
+
static bool between(int val, int low, int high)
{
return (val >= low && val <= high);
@@ -63,8 +68,13 @@ struct dgn_region
bool contains(const coord_def &p) const
{
- return (p.x >= pos.x && p.x < pos.x + size.x
- && p.y >= pos.y && p.y < pos.y + size.y);
+ return contains(p.x, p.y);
+ }
+
+ bool contains(int xp, int yp) const
+ {
+ return (xp >= pos.x && xp < pos.x + size.x
+ && yp >= pos.y && yp < pos.y + size.y);
}
bool fully_contains(const coord_def &p) const