From a75a924ca5f67336d9e065ab307d976c4cd8fabc Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 4 Jun 2007 06:53:25 +0000 Subject: [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 --- crawl-ref/source/initfile.cc | 67 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'crawl-ref/source/initfile.cc') diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 401dfda212..30e9619699 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -555,6 +555,17 @@ void game_options::reset_options() messaging = true; #endif + view_max_width = VIEW_EX; + view_max_height = VIEW_EY; + + view_lock_x = true; + view_lock_y = true; + + center_on_scroll = false; + symmetric_scroll = true; + scroll_margin_x = 4; + scroll_margin_y = 4; + autopickup_on = true; autoprayer_on = false; @@ -1855,6 +1866,62 @@ void game_options::read_option_line(const std::string &str, bool runscript) messaging = read_bool(field, messaging); } #endif + else if (key == "view_max_width") + { + view_max_width = atoi(field.c_str()); + if (view_max_width < VIEW_EX) + view_max_width = VIEW_EX; + 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_EY) + view_max_height = VIEW_EY; + else if (view_max_height > GYM + 1) + view_max_height = GYM + 1; + } + else if (key == "view_lock_x") + { + view_lock_x = read_bool(field, view_lock_x); + } + else if (key == "view_lock_y") + { + view_lock_y = read_bool(field, view_lock_y); + } + else if (key == "view_lock") + { + const bool lock = read_bool(field, true); + view_lock_x = view_lock_y = lock; + } + else if (key == "center_on_scroll") + { + center_on_scroll = read_bool(field, center_on_scroll); + } + else if (key == "symmetric_scroll") + { + symmetric_scroll = read_bool(field, symmetric_scroll); + } + else if (key == "scroll_margin_x") + { + scroll_margin_x = atoi(field.c_str()); + if (scroll_margin_x < 0) + scroll_margin_x = 0; + } + else if (key == "scroll_margin_y") + { + scroll_margin_y = atoi(field.c_str()); + if (scroll_margin_y < 0) + scroll_margin_y = 0; + } + else if (key == "scroll_margin") + { + int scrollmarg = atoi(field.c_str()); + if (scrollmarg < 0) + scrollmarg = 0; + scroll_margin_x = scroll_margin_y = scrollmarg; + } else if (key == "use_notes") { use_notes = read_bool( field, use_notes ); -- cgit v1.2.3-54-g00ecf