From bf1ba28b0bdb107fb9a893e404630f3930be49b1 Mon Sep 17 00:00:00 2001 From: Deskull Date: Mon, 12 Nov 2018 21:50:45 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37287=20#37353=20=E5=9E=8B?= =?utf8?q?=E3=81=AE=E7=BD=AE=E6=8F=9B=E3=80=82=20/=20Type=20replacement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/chuukei.c | 2 +- src/cmd4.c | 8 ++++---- src/externs.h | 6 +++--- src/spells1.c | 2 +- src/variable.c | 4 ++-- src/z-term.c | 18 +++++++++--------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/chuukei.c b/src/chuukei.c index 8fd22f7a9..f4a193463 100644 --- a/src/chuukei.c +++ b/src/chuukei.c @@ -522,7 +522,7 @@ static bool string_is_repeat(char *str, int len) return (TRUE); } -static errr send_text_to_chuukei_server(int x, int y, int len, byte col, cptr str) +static errr send_text_to_chuukei_server(TERM_LEN x, TERM_LEN y, int len, TERM_COLOR col, cptr str) { char buf[1024]; char buf2[1024]; diff --git a/src/cmd4.c b/src/cmd4.c index ce7e171b1..60e49da14 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -3330,9 +3330,9 @@ void do_cmd_visuals(void) int c; IDX t; - byte da = r_ptr->d_attr; + TERM_COLOR da = r_ptr->d_attr; byte dc = r_ptr->d_char; - byte ca = r_ptr->x_attr; + TERM_COLOR ca = r_ptr->x_attr; byte cc = r_ptr->x_char; /* Label the object */ @@ -6434,7 +6434,7 @@ static void display_visual_list(int col, int row, int height, int width, byte at /* * Place the cursor at the collect position for visual mode */ -static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, byte a, byte c, byte attr_top, byte char_left) +static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, byte c, byte attr_top, byte char_left) { int i = (a & 0x7f) - attr_top; int j = c - char_left; @@ -6466,7 +6466,7 @@ static byte char_idx_feat[F_LIT_MAX]; static bool visual_mode_command(char ch, bool *visual_list_ptr, int height, int width, byte *attr_top_ptr, byte *char_left_ptr, - byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw) + TERM_COLOR *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw) { static byte attr_old = 0, char_old = 0; diff --git a/src/externs.h b/src/externs.h index 6cb7505aa..53e13987d 100644 --- a/src/externs.h +++ b/src/externs.h @@ -282,9 +282,9 @@ extern s16b alloc_kind_size; extern alloc_entry *alloc_kind_table; extern s16b alloc_race_size; extern alloc_entry *alloc_race_table; -extern byte misc_to_attr[256]; +extern TERM_COLOR misc_to_attr[256]; extern char misc_to_char[256]; -extern byte tval_to_attr[128]; +extern TERM_COLOR tval_to_attr[128]; extern char tval_to_char[128]; extern cptr keymap_act[KEYMAP_MODES][256]; extern player_type *p_ptr; @@ -479,7 +479,7 @@ extern void update_local_illumination(POSITION y, POSITION x); extern bool player_can_see_bold(POSITION y, POSITION x); extern bool cave_valid_bold(POSITION y, POSITION x); extern bool no_lite(void); -extern void apply_default_feat_lighting(byte f_attr[F_LIT_MAX], byte f_char[F_LIT_MAX]); +extern void apply_default_feat_lighting(TERM_COLOR f_attr[F_LIT_MAX], byte f_char[F_LIT_MAX]); extern void map_info(POSITION y, POSITION x, byte *ap, char *cp, byte *tap, char *tcp); extern void move_cursor_relative(int row, int col); extern void print_rel(char c, byte a, TERM_LEN y, TERM_LEN x); diff --git a/src/spells1.c b/src/spells1.c index e8dc0245f..843ffb1db 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -290,7 +290,7 @@ u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ) byte k; - byte a; + TERM_COLOR a; char c; /* No motion (*) */ diff --git a/src/variable.c b/src/variable.c index b2736ae54..66ce32a72 100644 --- a/src/variable.c +++ b/src/variable.c @@ -576,7 +576,7 @@ alloc_entry *alloc_race_table; * Specify attr/char pairs for visual special effects * Be sure to use "index & 0x7F" to avoid illegal access */ -byte misc_to_attr[256]; +TERM_COLOR misc_to_attr[256]; char misc_to_char[256]; @@ -584,7 +584,7 @@ char misc_to_char[256]; * Specify attr/char pairs for inventory items (by tval) * Be sure to use "index & 0x7F" to avoid illegal access */ -byte tval_to_attr[128]; +TERM_COLOR tval_to_attr[128]; char tval_to_char[128]; diff --git a/src/z-term.c b/src/z-term.c index 8f709d3a4..f7515a4e0 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -778,10 +778,10 @@ void Term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr s) else { #endif - byte oa = scr_aa[x]; + TERM_COLOR oa = scr_aa[x]; char oc = scr_cc[x]; - byte ota = scr_taa[x]; + TERM_COLOR ota = scr_taa[x]; char otc = scr_tcc[x]; /* Hack -- Ignore non-changes */ @@ -1199,14 +1199,14 @@ static void Term_fresh_row_both(TERM_LEN y, int x1, int x2) * * Display text using "Term_text()" and "Term_wipe()" */ -static void Term_fresh_row_text(TERM_LEN y, int x1, int x2) +static void Term_fresh_row_text(TERM_LEN y, TERM_LEN x1, TERM_LEN x2) { TERM_LEN x; - byte *old_aa = Term->old->a[y]; + TERM_COLOR *old_aa = Term->old->a[y]; char *old_cc = Term->old->c[y]; - byte *scr_aa = Term->scr->a[y]; + TERM_COLOR *scr_aa = Term->scr->a[y]; char *scr_cc = Term->scr->c[y]; /* The "always_text" flag */ @@ -1221,10 +1221,10 @@ static void Term_fresh_row_text(TERM_LEN y, int x1, int x2) /* Pending attr */ byte fa = Term->attr_blank; - byte oa; + TERM_COLOR oa; char oc; - byte na; + TERM_COLOR na; char nc; #ifdef JP @@ -1536,10 +1536,10 @@ errr Term_fresh(void) /* Wipe each row */ for (y = 0; y < h; y++) { - byte *aa = old->a[y]; + TERM_COLOR *aa = old->a[y]; char *cc = old->c[y]; - byte *taa = old->ta[y]; + TERM_COLOR *taa = old->ta[y]; char *tcc = old->tc[y]; -- 2.11.0