summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
committerBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
commit77057bed68e16af625b2e4f75d2ede9762cc71e7 (patch)
treeb39dd42378c08699ea703b461ecc67805c923753
parent1d477ab119bc87793449307d59eadec096e9aa6f (diff)
Inline effectively constant term::{char,attr}_blank
-rw-r--r--src/main-gcu.c4
-rw-r--r--src/main-gtk2.c5
-rw-r--r--src/main-sdl.c4
-rw-r--r--src/main-win.c4
-rw-r--r--src/main-x11.c4
-rw-r--r--src/z-term.c24
-rw-r--r--src/z-term.h9
7 files changed, 13 insertions, 41 deletions
diff --git a/src/main-gcu.c b/src/main-gcu.c
index 3e1d1ff..b129770 100644
--- a/src/main-gcu.c
+++ b/src/main-gcu.c
@@ -784,10 +784,6 @@ static errr term_data_init_gcu(term_data *td, int rows, int cols, int y, int x)
/* Avoid bottom right corner */
t->icky_corner = TRUE;
- /* Erase with "white space" */
- t->attr_blank = TERM_WHITE;
- t->char_blank = ' ';
-
/* Set some hooks */
t->init_hook = Term_init_gcu;
t->nuke_hook = Term_nuke_gcu;
diff --git a/src/main-gtk2.c b/src/main-gtk2.c
index bdf7f6a..7bb1b14 100644
--- a/src/main-gtk2.c
+++ b/src/main-gtk2.c
@@ -1271,10 +1271,7 @@ static errr term_data_init(term_data *td, int i)
/* Use a "soft" cursor */
t->soft_cursor = TRUE;
- /* Erase with "white space" */
- t->attr_blank = TERM_WHITE;
- t->char_blank = ' ';
-
+ /* Hooks */
t->xtra_hook = Term_xtra_gtk;
t->text_hook = Term_text_gtk;
t->wipe_hook = Term_wipe_gtk;
diff --git a/src/main-sdl.c b/src/main-sdl.c
index 7a534ad..1ab8954 100644
--- a/src/main-sdl.c
+++ b/src/main-sdl.c
@@ -1767,10 +1767,6 @@ static errr term_data_init(term_data *td, int i)
/* Picture routine flags */
t->always_text = FALSE;
- /* Erase with "white space" */
- t->attr_blank = TERM_WHITE;
- t->char_blank = ' ';
-
/* Hooks */
t->xtra_hook = Term_xtra_sdl;
t->curs_hook = Term_curs_sdl;
diff --git a/src/main-win.c b/src/main-win.c
index 05742c8..2ca6704 100644
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -1697,10 +1697,6 @@ static void term_data_link(term_data *td)
/* Use a "software" cursor */
t->soft_cursor = TRUE;
- /* Erase with "white space" */
- t->attr_blank = TERM_WHITE;
- t->char_blank = ' ';
-
/* Prepare the template hooks */
t->xtra_hook = Term_xtra_win;
t->curs_hook = Term_curs_win;
diff --git a/src/main-x11.c b/src/main-x11.c
index 6d12274..ef82855 100644
--- a/src/main-x11.c
+++ b/src/main-x11.c
@@ -2476,10 +2476,6 @@ static errr term_data_init(term_data *td, int i)
/* Use a "soft" cursor */
t->soft_cursor = TRUE;
- /* Erase with "white space" */
- t->attr_blank = TERM_WHITE;
- t->char_blank = ' ';
-
/* Hooks */
t->xtra_hook = Term_xtra_x11;
t->curs_hook = Term_curs_x11;
diff --git a/src/z-term.c b/src/z-term.c
index de4a7b4..1a16b09 100644
--- a/src/z-term.c
+++ b/src/z-term.c
@@ -477,6 +477,11 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s)
}
+/*
+ * Blank attribute/character
+ */
+static const byte ATTR_BLANK = TERM_WHITE;
+static const char CHAR_BLANK = ' ';
/*
* Flush a row of the current window (see "Term_fresh")
@@ -503,7 +508,7 @@ static void Term_fresh_row_text(int y, int x1, int x2)
int fx = 0;
/* Pending attr */
- byte fa = Term->attr_blank;
+ byte fa = ATTR_BLANK;
byte oa;
char oc;
@@ -727,8 +732,8 @@ errr Term_fresh(void)
/* Handle "total erase" */
if (Term->total_erase)
{
- byte na = Term->attr_blank;
- char nc = Term->char_blank;
+ byte na = ATTR_BLANK;
+ char nc = CHAR_BLANK;
/* Physically erase the entire window */
Term_xtra(TERM_XTRA_CLEAR, 0);
@@ -1130,8 +1135,8 @@ errr Term_erase(int x, int y, int n)
int x1 = -1;
int x2 = -1;
- int na = Term->attr_blank;
- int nc = Term->char_blank;
+ int na = ATTR_BLANK;
+ int nc = CHAR_BLANK;
byte *scr_aa;
char *scr_cc;
@@ -1201,8 +1206,8 @@ errr Term_clear(void)
int w = Term->wid;
int h = Term->hgt;
- byte na = Term->attr_blank;
- char nc = Term->char_blank;
+ byte na = ATTR_BLANK;
+ char nc = CHAR_BLANK;
/* Cursor usable */
Term->scr->cu = 0;
@@ -1954,11 +1959,6 @@ errr term_init(term *t, int w, int h, int k)
t->total_erase = TRUE;
- /* Default "blank" */
- t->attr_blank = 0;
- t->char_blank = ' ';
-
-
/* Success */
return (0);
}
diff --git a/src/z-term.h b/src/z-term.h
index f4f5252..875f13b 100644
--- a/src/z-term.h
+++ b/src/z-term.h
@@ -76,12 +76,6 @@ struct term_win
*
*
*
- * - Value "attr_blank"
- * Use this "attr" value for "blank" grids
- *
- * - Value "char_blank"
- * Use this "char" value for "blank" grids
- *
*
* - Ignore this pointer
*
@@ -134,9 +128,6 @@ struct term
bool_ soft_cursor;
bool_ always_text;
- byte attr_blank;
- char char_blank;
-
char *key_queue;
u16b key_head;
u16b key_tail;