From 9ea5f1e7067c8ce37a180b094a13ec5e8a576cc4 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 23 Feb 2015 09:12:00 +0100 Subject: "Inline" cmovie_clean_line in files.cc It wasn't being used anywhere else, so we might as well limit is definition scope. --- src/CMakeLists.txt | 1 - src/cmovie.cc | 56 ------------------------------------------------------ src/externs.h | 3 --- src/files.cc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 60 deletions(-) delete mode 100644 src/cmovie.cc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 24074cb9..9573fe7d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,6 @@ SET(SRCS_COMMON cmd1.cc cmd2.cc cmd3.cc cmd4.cc cmd5.cc cmd6.cc cmd7.cc help.cc hiscore.cc range.cc dice.cc generate.cc gen_maze.cc gen_evol.cc wild.cc levels.cc store.cc bldg.cc - cmovie.cc wizard1.cc wizard2.cc init1.cc init2.cc birth.cc quark.cc # Lua bits: diff --git a/src/cmovie.cc b/src/cmovie.cc deleted file mode 100644 index b6cb4d05..00000000 --- a/src/cmovie.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* File: cmovie.c */ - -/* Purpose: play cmovie files -DarkGod-Improv- */ - -#include "angband.h" - -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'; -} diff --git a/src/externs.h b/src/externs.h index a8c7beca..e55ddcd3 100644 --- a/src/externs.h +++ b/src/externs.h @@ -518,9 +518,6 @@ extern int is_quest(int level); extern int random_quest_number(void); extern int new_effect(int type, int dam, int time, int cy, int cx, int rad, s32b flags); -/* cmovie.c */ -extern void cmovie_clean_line(int y, char *abuf, char *cbuf); - /* cmd1.c */ extern void attack_special(monster_type *m_ptr, s32b special, int dam); extern bool_ test_hit_fire(int chance, int ac, int vis); 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) { -- cgit v1.2.3