summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-20 21:03:48 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-20 21:03:48 +0000
commit91e8400448873bd08bd509862f9b6c7d30f29e5b (patch)
treea44b6984e9496dd257303dcc5d319f6f8620cedd /crawl-ref/source/tilereg.cc
parent8be1faf8bf1230e22d272720c54bba62d955bc74 (diff)
downloadcrawl-ref-91e8400448873bd08bd509862f9b6c7d30f29e5b.tar.gz
crawl-ref-91e8400448873bd08bd509862f9b6c7d30f29e5b.zip
Adding auto-sizing for font, map, and window sizes. Windows should fit on the screen by default now. The options are still somewhat of a mess, but I don't think that they'll need to be modified by most people.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7889 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 27c3948a99..c2a3a6e8ad 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -172,8 +172,11 @@ bool Region::mouse_pos(int mouse_x, int mouse_y, int &cx, int &cy)
{
int x = mouse_x - ox - sx;
int y = mouse_y - oy - sy;
+
bool valid = (x >= 0 && y >= 0);
+ ASSERT(dx > 0);
+ ASSERT(dy > 0);
x /= dx;
y /= dy;
valid &= ((unsigned int)x < mx && (unsigned int)y < my);
@@ -1718,6 +1721,8 @@ MapRegion::MapRegion(unsigned int pixsz) :
m_buf(NULL),
m_far_view(false)
{
+ ASSERT(pixsz > 0);
+
dx = pixsz;
dy = pixsz;
clear();