diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-12-03 08:34:39 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-12-03 09:02:40 +0100 |
commit | 7208f8f4b2d780c7c93392b81da2bc07c1a164ee (patch) | |
tree | d46757223c7494d4481aacbfc436194de8c8beec /crawl-ref/source/initfile.cc | |
parent | 3ace87921b68b1d9db5362c73a1d33ebb41f6f52 (diff) | |
download | crawl-ref-7208f8f4b2d780c7c93392b81da2bc07c1a164ee.tar.gz crawl-ref-7208f8f4b2d780c7c93392b81da2bc07c1a164ee.zip |
Clean up window size option handling.
view_{min,max}_width now use INT_OPTION (hope I didn't miss anything
there), and msg_max_height gets an explicit minimum.
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r-- | crawl-ref/source/initfile.cc | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 23267b635f..28803b4857 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -603,7 +603,7 @@ void game_options::reset_options() view_max_width = std::max(33, VIEW_MIN_WIDTH); view_max_height = std::max(21, VIEW_MIN_HEIGHT); mlist_min_height = 5; - msg_max_height = 10; + msg_max_height = std::max(10, MSG_MIN_HEIGHT); mlist_allow_alternate_layout = false; messages_at_top = false; mlist_targetting = false; @@ -2401,27 +2401,11 @@ void game_options::read_option_line(const std::string &str, bool runscript) else BOOL_OPTION(messaging); #endif else BOOL_OPTION(mouse_input); - else if (key == "view_max_width") - { - view_max_width = atoi(field.c_str()); - if (view_max_width < VIEW_MIN_WIDTH) - view_max_width = VIEW_MIN_WIDTH; - - // Allow the view to be one larger than GXM because the view width - // needs to be odd, and GXM is even. - else if (view_max_width > GXM + 1) - view_max_width = GXM + 1; - } - else if (key == "view_max_height") - { - view_max_height = atoi(field.c_str()); - if (view_max_height < VIEW_MIN_HEIGHT) - view_max_height = VIEW_MIN_HEIGHT; - else if (view_max_height > GYM + 1) - view_max_height = GYM + 1; - } + // These need to be odd, hence allow +1. + else INT_OPTION(view_max_width, VIEW_MIN_WIDTH, GXM + 1); + else INT_OPTION(view_max_height, VIEW_MIN_HEIGHT, GYM + 1); else INT_OPTION(mlist_min_height, 0, INT_MAX); - else INT_OPTION(msg_max_height, 6, INT_MAX); + else INT_OPTION(msg_max_height, MSG_MIN_HEIGHT, INT_MAX); else BOOL_OPTION(mlist_allow_alternate_layout); else BOOL_OPTION(messages_at_top); #ifndef USE_TILE |