summaryrefslogtreecommitdiff
path: root/src/files.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:12:00 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:12:00 +0100
commit9ea5f1e7067c8ce37a180b094a13ec5e8a576cc4 (patch)
treea58889ee0134cd6791f4b3d0c7341a4e69673c41 /src/files.cc
parent8e13db80439afe0049223cdbd44da9724fad84aa (diff)
"Inline" cmovie_clean_line in files.cc
It wasn't being used anywhere else, so we might as well limit is definition scope.
Diffstat (limited to 'src/files.cc')
-rw-r--r--src/files.cc51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/files.cc b/src/files.cc
index 304b5796..a805cea6 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -3795,6 +3795,57 @@ bool_ txt_to_html(cptr head, cptr foot, cptr base, cptr ext, bool_ force, bool_
return (TRUE);
}
+static void cmovie_clean_line(int y, char *abuf, char *cbuf)
+{
+ const byte *ap = Term->scr->a[y];
+ const char *cp = Term->scr->c[y];
+
+ byte a;
+ char c;
+
+ int x;
+ int wid, hgt;
+ int screen_wid, screen_hgt;
+
+
+ /* Retrieve current screen size */
+ Term_get_size(&wid, &hgt);
+
+ /* Calculate the size of dungeon map area */
+ screen_wid = wid - (COL_MAP + 1);
+ screen_hgt = hgt - (ROW_MAP + 1);
+
+ /* For the time being, assume 80 column display XXX XXX XXX */
+ for (x = 0; x < wid; x++)
+ {
+ /* Convert dungeon map into default attr/chars */
+ if (!character_icky &&
+ ((x - COL_MAP) >= 0) &&
+ ((x - COL_MAP) < screen_wid) &&
+ ((y - ROW_MAP) >= 0) &&
+ ((y - ROW_MAP) < screen_hgt))
+ {
+ /* Retrieve default attr/char */
+ map_info_default(y + panel_row_prt, x + panel_col_prt, &a, &c);
+
+ abuf[x] = conv_color[a & 0xf];
+
+ if (c == '\0') cbuf[x] = ' ';
+ else cbuf[x] = c;
+ }
+
+ else
+ {
+ abuf[x] = conv_color[ap[x] & 0xf];
+ cbuf[x] = cp[x];
+ }
+ }
+
+ /* Null-terminate the prepared strings */
+ abuf[x] = '\0';
+ cbuf[x] = '\0';
+}
+
/* Take an help file screenshot(yes yes I know..) */
void help_file_screenshot(cptr name)
{