From face4db503cfe66fa827d841f424892ab187c362 Mon Sep 17 00:00:00 2001 From: mogami Date: Fri, 24 Oct 2003 10:38:13 +0000 Subject: [PATCH] =?utf8?q?bigtile=5Fattr()=E3=82=92=E5=BB=83=E6=AD=A2?= =?utf8?q?=E3=81=97=E3=81=A6=E3=80=81Term=5Fqueue=5Fchar()=E3=81=AEbigtile?= =?utf8?q?=E7=89=88=E9=96=A2=E6=95=B0=20Term=5Fqueue=5Fbigchar()=E3=82=92?= =?utf8?q?=E4=BD=9C=E3=81=A3=E3=81=A6=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?utf8?q?=E7=90=86=E3=80=82=E4=BB=8A=E3=81=BE=E3=81=A7=E8=A8=AD=E8=A8=88?= =?utf8?q?=E3=81=8C=E6=BB=85=E8=8C=B6=E8=8B=A6=E8=8C=B6=E3=81=AA=E9=9D=A2?= =?utf8?q?=E3=81=8C=E3=81=82=E3=82=8A=20Bigtile=E3=81=AE=E5=8D=B0=E3=82=92?= =?utf8?q?=E4=BB=98=E3=81=91=E3=82=8B=E3=82=B3=E3=83=BC=E3=83=89=E3=81=A8?= =?utf8?q?=E8=AA=AD=E3=81=BF=E5=87=BA=E3=81=99=E3=82=B3=E3=83=BC=E3=83=89?= =?utf8?q?=E3=81=8C=E7=9F=9B=E7=9B=BE=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F?= =?utf8?q?=E3=82=8A=E3=80=81=E3=83=88=E3=83=A9=E3=83=83=E3=83=97=E6=84=9F?= =?utf8?q?=20=E7=9F=A5=E7=9B=B4=E5=BE=8C=E3=81=AB=E5=85=A8=E8=A7=92ASCII?= =?utf8?q?=E6=96=87=E5=AD=97=E3=81=AE=E3=83=88=E3=83=A9=E3=83=83=E3=83=97?= =?utf8?q?=E3=81=AE=E4=B8=8A=E3=81=AB=E3=82=AB=E3=83=BC=E3=82=BD=E3=83=AB?= =?utf8?q?=E3=82=92=E4=B9=97=E3=81=9B=E3=82=8B=E3=81=A8=E6=96=87=E5=AD=97?= =?utf8?q?=E5=8C=96=E3=81=91=E3=81=99=E3=82=8B=E3=83=90=20=E3=82=B0?= =?utf8?q?=E3=81=8C=E6=AE=8B=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=8C?= =?utf8?q?=E3=80=81=E4=B8=80=E7=B7=92=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=97?= =?utf8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cave.c | 98 +++++++------------------------------------ src/cmd4.c | 96 +++++++----------------------------------- src/externs.h | 1 - src/z-term.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++----------- src/z-term.h | 1 + 5 files changed, 139 insertions(+), 188 deletions(-) diff --git a/src/cave.c b/src/cave.c index 025c02fb8..c1581d97f 100644 --- a/src/cave.c +++ b/src/cave.c @@ -1603,47 +1603,6 @@ void map_info(int y, int x, byte *ap, char *cp, byte *tap, char *tcp) } -#ifdef JP -/* - * Table of Ascii-to-Zenkaku - * ¡Ö¢£¡×¤ÏÆóÇÜÉýƦÉå¤ÎÆâÉô¥³¡¼¥É¤Ë»ÈÍÑ¡£ - */ -static char ascii_to_zenkaku[2*128+1] = "\ -¡¡¡ª¡É¡ô¡ð¡ó¡õ¡Ç¡Ê¡Ë¡ö¡Ü¡¤¡Ý¡¥¡¿\ -£°£±£²£³£´£µ£¶£·£¸£¹¡§¡¨¡ã¡á¡ä¡©\ -¡÷£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï\ -£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡Î¡À¡Ï¡°¡²\ -¡Æ£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï\ -£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡Ð¡Ã¡Ñ¡Á¢£"; -#endif - -/* - * Prepare Bigtile or 2-bytes character attr/char pairs - */ -void bigtile_attr(char *cp, byte *ap, char *cp2, byte *ap2) -{ - if ((*ap & 0x80) && (*cp & 0x80)) - { - *ap2 = 255; - *cp2 = -1; - return; - } - -#ifdef JP - if (isprint(*cp) || *cp == 127) - { - *ap2 = (*ap) | 0xf0; - *cp2 = ascii_to_zenkaku[2*(*cp-' ') + 1]; - *cp = ascii_to_zenkaku[2*(*cp-' ')]; - return; - } -#endif - - *ap2 = TERM_WHITE; - *cp2 = ' '; -} - - /* * Calculate panel colum of a location in the map */ @@ -1674,9 +1633,6 @@ void move_cursor_relative(int row, int col) */ void print_rel(char c, byte a, int y, int x) { - char c2; - byte a2; - /* Only do "legal" locations */ if (panel_contains(y, x)) { @@ -1688,12 +1644,8 @@ void print_rel(char c, byte a, int y, int x) else if (p_ptr->wraith_form) a = TERM_L_DARK; } - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Draw the char using the attr */ - Term_draw(panel_col_of(x), y-panel_row_prt, a, c); - if (use_bigtile) - Term_draw(panel_col_of(x)+1, y-panel_row_prt, a2, c2); + Term_queue_bigchar(panel_col_of(x), y-panel_row_prt, a, c, 0, 0); } } @@ -1922,22 +1874,8 @@ void lite_spot(int y, int x) else if (p_ptr->wraith_form) a = TERM_L_DARK; } -#ifdef JP - if (use_bigtile && is_ascii_graphics(a) && (isprint(c) || c == 127)) - { - /* Term_queue_chars ¤ÏÁ´³ÑASCIIÃÏ·Á¤òÀµ¤·¤¯update¤¹¤ë¡£ */ - Term_queue_chars(panel_col_of(x), y-panel_row_prt, 2, a, &ascii_to_zenkaku[2*(c-' ')]); - - /* Update sub-windows */ - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - return; - } -#endif - /* Hack -- Queue it */ - Term_queue_char(panel_col_of(x), y-panel_row_prt, a, c, ta, tc); - if (use_bigtile) - Term_queue_char(panel_col_of(x)+1, y-panel_row_prt, 255, -1, 0, 0); + Term_queue_bigchar(panel_col_of(x), y-panel_row_prt, a, c, ta, tc); /* Update sub-windows */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); @@ -2001,8 +1939,8 @@ void prt_map(void) /* Scan the columns of row "y" */ for (x = xmin; x <= xmax; x++) { - byte a, a2; - char c, c2; + byte a; + char c; byte ta; char tc; @@ -2018,11 +1956,8 @@ void prt_map(void) else if (p_ptr->wraith_form) a = TERM_L_DARK; } - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Efficiency -- Redraw that grid of the map */ - Term_queue_char(panel_col_of(x), y-panel_row_prt, a, c, ta, tc); - if (use_bigtile) Term_queue_char(panel_col_of(x)+1, y-panel_row_prt, a2, c2, 0, 0); + Term_queue_bigchar(panel_col_of(x), y-panel_row_prt, a, c, ta, tc); } } @@ -2066,8 +2001,8 @@ void prt_path(int y, int x) if (panel_contains(ny, nx)) { - byte a2, a = default_color; - char c, c2; + byte a = default_color; + char c; byte ta; char tc; @@ -2093,11 +2028,9 @@ void prt_path(int y, int x) } c = '*'; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); /* Hack -- Queue it */ - Term_queue_char(panel_col_of(nx), ny-panel_row_prt, a, c, ta, tc); - if (use_bigtile) Term_queue_char(panel_col_of(nx)+1, ny-panel_row_prt, a2, c2, 0, 0); + Term_queue_bigchar(panel_col_of(nx), ny-panel_row_prt, a, c, ta, tc); } /* Known Wall */ @@ -2214,8 +2147,8 @@ void display_map(int *cy, int *cx) { int i, j, x, y; - byte ta, a2; - char tc, c2; + byte ta; + char tc; byte tp; @@ -2396,8 +2329,7 @@ void display_map(int *cy, int *cx) /* Display each map line in order */ for (y = 0; y < hgt + 2; ++y) { - /* Start a new line */ - Term_gotoxy(COL_MAP, y); + int cx = COL_MAP; /* Display the line */ for (x = 0; x < wid + 2; ++x) @@ -2413,11 +2345,11 @@ void display_map(int *cy, int *cx) else if (p_ptr->wraith_form) ta = TERM_L_DARK; } - if (use_bigtile) bigtile_attr(&tc, &ta, &c2, &a2); - /* Add the character */ - Term_addch(ta, tc); - if (use_bigtile) Term_addch(a2, c2); + Term_queue_bigchar(cx, y, ta, tc, 0, 0); + + if (use_bigtile) cx += 2; + else cx++; } } diff --git a/src/cmd4.c b/src/cmd4.c index 3f71fc0f2..2af013bee 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -3641,6 +3641,7 @@ void do_cmd_visuals(void) if (use_bigtile) empty_symbol = "<< ?? >>"; + /* File type is "TEXT" */ FILE_TYPE(FILE_TYPE_TEXT); @@ -3975,8 +3976,7 @@ void do_cmd_visuals(void) while (1) { monster_race *r_ptr = &r_info[r]; - byte a, a2; - char c, c2; + char c; int t; byte da = (r_ptr->d_attr); @@ -4006,13 +4006,7 @@ void do_cmd_visuals(void) #endif Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); - - a = da; - c = dc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 19, a, c); - if (use_bigtile) Term_putch(43 + 1, 19, a2, c2); + Term_queue_bigchar(43, 19, da, dc, 0, 0); /* Label the Current values */ #ifdef JP @@ -4024,14 +4018,7 @@ void do_cmd_visuals(void) #endif Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); - - a = ca; - c = cc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 20, a, c); - if (use_bigtile) Term_putch(43 + 1, 20, a2, c2); - + Term_queue_bigchar(43, 20, ca, cc, 0, 0); /* Prompt */ #ifdef JP @@ -4088,8 +4075,7 @@ void do_cmd_visuals(void) while (1) { object_kind *k_ptr = &k_info[k]; - byte a, a2; - char c, c2; + char c; int t; byte da = (byte)k_ptr->d_attr; @@ -4119,13 +4105,7 @@ void do_cmd_visuals(void) #endif Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); - a = da; - c = dc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 19, a, c); - if (use_bigtile) Term_putch(43 + 1, 19, a2, c2); - + Term_queue_bigchar(43, 19, da, dc, 0, 0); /* Label the Current values */ #ifdef JP @@ -4137,13 +4117,7 @@ void do_cmd_visuals(void) #endif Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); - a = ca; - c = cc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 20, a, c); - if (use_bigtile) Term_putch(43 + 1, 20, a2, c2); - + Term_queue_bigchar(43, 20, ca, cc, 0, 0); /* Prompt */ #ifdef JP @@ -4200,8 +4174,7 @@ void do_cmd_visuals(void) while (1) { feature_type *f_ptr = &f_info[f]; - byte a, a2; - char c, c2; + char c; int t; byte da = (byte)f_ptr->d_attr; @@ -4231,12 +4204,8 @@ void do_cmd_visuals(void) #endif Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); - a = da; - c = dc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - Term_putch(43, 19, a, c); - if (use_bigtile) Term_putch(43 + 1, 19, a2, c2); + Term_queue_bigchar(43, 19, da, dc, 0, 0); /* Label the Current values */ @@ -4249,13 +4218,7 @@ void do_cmd_visuals(void) #endif Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); - a = ca; - c = cc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 20, a, c); - if (use_bigtile) Term_putch(43 + 1, 20, a2, c2); - + Term_queue_bigchar(43, 20, ca, cc, 0, 0); /* Prompt */ #ifdef JP @@ -7359,13 +7322,8 @@ static void display_visual_list(int col, int row, int height, int width, byte at /* Force correct code for both ASCII character and tile */ if (c & 0x80) a |= 0x80; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Display symbol */ - Term_putch(x, y, a, c); - - /* Second byte */ - if (use_bigtile) Term_putch(x + 1, y, a2, c2); + Term_queue_bigchar(x, y, a, c, 0, 0); } } } @@ -7530,8 +7488,6 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], for (i = 0; i < per_page && mon_idx[mon_top + i]; i++) { byte attr; - byte a, a2; - char c, c2; /* Get the race index */ int r_idx = mon_idx[mon_top + i] ; @@ -7556,15 +7512,9 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], c_prt(attr, format("%d", r_idx), row + i, 60); } - a = r_ptr->x_attr; - c = r_ptr->x_char; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Display symbol */ - Term_putch(70, row + i, a, c); + Term_queue_bigchar(70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0); - /* Second byte */ - if (use_bigtile) Term_putch(70 + 1, row + i, a2, c2); /* Display kills */ if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73); @@ -7802,8 +7752,7 @@ static void display_object_list(int col, int row, int per_page, int object_idx[] for (i = 0; i < per_page && object_idx[object_top + i]; i++) { char o_name[80]; - byte a, a2; - char c, c2; + byte a, c; /* Get the object index */ int k_idx = object_idx[object_top + i]; @@ -7843,13 +7792,8 @@ static void display_object_list(int col, int row, int per_page, int object_idx[] a = TERM_DARK; } - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Display symbol */ - Term_putch(76, row + i, a, c); - - /* Second byte */ - if (use_bigtile) Term_putch(76 + 1, row + i, a2, c2); + Term_queue_bigchar(76, row + i, a, c, 0, 0); } /* Clear remaining lines */ @@ -8123,8 +8067,6 @@ static void display_feature_list(int col, int row, int per_page, int *feat_idx, /* Display lines until done */ for (i = 0; i < per_page && feat_idx[feat_top + i]; i++) { - byte a, a2; - char c, c2; byte attr; /* Get the index */ @@ -8145,16 +8087,8 @@ static void display_feature_list(int col, int row, int per_page, int *feat_idx, c_prt(attr, format("%02x/%02x", f_ptr->x_attr, f_ptr->x_char), row + i, 60); } - a = f_ptr->x_attr; - c = f_ptr->x_char; - - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Display symbol */ - Term_putch(68, row + i, a, c); - - /* Second byte */ - if (use_bigtile) Term_putch(68 + 1, row + i, a2, c2); + Term_queue_bigchar(68, row + i, f_ptr->x_attr, f_ptr->x_char, 0, 0); } /* Clear remaining lines */ diff --git a/src/externs.h b/src/externs.h index 67a63a803..02d44c10c 100644 --- a/src/externs.h +++ b/src/externs.h @@ -555,7 +555,6 @@ extern bool cave_valid_bold(int y, int x); extern bool cave_valid_grid(cave_type *c_ptr); extern bool no_lite(void); extern void map_info(int y, int x, byte *ap, char *cp, byte *tap, char *tcp); -extern void bigtile_attr(char *cp, byte *ap, char *cp2, byte *ap2); extern void move_cursor_relative(int row, int col); extern void print_rel(char c, byte a, int y, int x); extern void note_spot(int y, int x); diff --git a/src/z-term.c b/src/z-term.c index 2b98f5902..1e37c9ad2 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -15,11 +15,13 @@ #include "z-virt.h" +/* Special flags in the attr data */ +#define AF_BIGTILE 0xf0 #ifdef JP -#define KANJI1 0x10 -#define KANJI2 0x20 -#define KANJIC 0x0f +#define AF_KANJI1 0x10 +#define AF_KANJI2 0x20 +#define AF_KANJIC 0x0f /* * Á´³Ñʸ»úÂбþ¡£ * °À­¤ËÁ´³Ñʸ»ú¤Î£±¥Ð¥¤¥ÈÌÜ¡¢£²¥Ð¥¤¥ÈÌܤ⵭²±¡£ @@ -527,12 +529,95 @@ void Term_queue_char(int x, int y, byte a, char c, byte ta, char tc) if (x < Term->x1[y]) Term->x1[y] = x; if (x > Term->x2[y]) Term->x2[y] = x; - if ((scrn->a[y][x] & 0xf0) == 0xf0) + if ((scrn->a[y][x] & AF_BIGTILE) == AF_BIGTILE) if ((x - 1) < Term->x1[y]) Term->x1[y]--; } /* + * Bigtile version of Term_queue_char(). + * + * If use_bigtile is FALSE, simply call Term_queue_char(). + * + * Otherwise, mentally draw a pair of attr/char at a given location. + * + * Assumes given location and values are valid. + */ +void Term_queue_bigchar(int x, int y, byte a, char c, byte ta, char tc) +{ + +#ifdef JP + /* + * A table which relates each ascii character to a multibyte + * character. + * + * ¡Ö¢£¡×¤ÏÆóÇÜÉýƦÉå¤ÎÆâÉô¥³¡¼¥É¤Ë»ÈÍÑ¡£ + */ + static char ascii_to_zenkaku[] = + "¡¡¡ª¡É¡ô¡ð¡ó¡õ¡Ç¡Ê¡Ë¡ö¡Ü¡¤¡Ý¡¥¡¿" + "£°£±£²£³£´£µ£¶£·£¸£¹¡§¡¨¡ã¡á¡ä¡©" + "¡÷£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï" + "£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡Î¡À¡Ï¡°¡²" + "¡Æ£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï" + "£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡Ð¡Ã¡Ñ¡Á¢£"; +#endif + + byte a2; + char c2; + + /* If non bigtile mode, call orginal function */ + if (!use_bigtile) + { + Term_queue_char(x, y, a, c, ta, tc); + return; + } + + /* A tile become a Bigtile */ + if ((a & 0x80) && (c & 0x80)) + { + /* Mark it as a Bigtile */ + a2 = AF_BIGTILE; + + c2 = -1; + + /* Ignore non-tile background */ + if (!((ta & 0x80) && (tc & 0x80))) + { + ta = 0; + tc = 0; + } + } + +#ifdef JP + /* + * Use a multibyte character instead of a dirty pair of ASCII + * characters. + */ + else if (' ' <= c && c <= 127) + { + c = ascii_to_zenkaku[2 * (c - ' ')]; + c2 = ascii_to_zenkaku[2 * (c - ' ') + 1]; + + /* Mark it as a Kanji */ + a2 = a | AF_KANJI2; + a |= AF_KANJI1; + } +#endif + + else + { + /* Dirty pair of ASCII characters */ + a2 = TERM_WHITE; + c2 = ' '; + } + + /* Display pair of attr/char */ + Term_queue_char(x, y, a, c, ta, tc); + Term_queue_char(x + 1, y, a2, c2, 0, 0); +} + + +/* * Mentally draw a string of attr/chars at a given location * * Assumes given location and values are valid. @@ -637,10 +722,10 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s) * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Îº¸Éôʬ¤ò¾Ãµî¡£ * ɽ¼¨³«»Ï°ÌÃÖ¤¬º¸Ã¼¤Ç¤Ê¤¤¤È²¾Äê¡£ */ - if ((scr_aa[x] & KANJI2) && !(scr_aa[x] & 0x80)) + if ((scr_aa[x] & AF_KANJI2) && (scr_aa[x] & AF_BIGTILE) != AF_BIGTILE) { scr_cc[x - 1] = ' '; - scr_aa[x - 1] &= KANJIC; + scr_aa[x - 1] &= AF_KANJIC; x1 = x2 = x - 1; } #endif @@ -656,8 +741,8 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s) char nc1 = *s++; char nc2 = *s; - byte na1 = (a | KANJI1); - byte na2 = (a | KANJI2); + byte na1 = (a | AF_KANJI1); + byte na2 = (a | AF_KANJI2); if((--n == 0) || !nc2) break; @@ -712,10 +797,10 @@ void Term_queue_chars(int x, int y, int n, byte a, cptr s) int w, h; Term_get_size(&w, &h); - if (x != w && !(scr_aa[x] & 0x80) && (scr_aa[x] & KANJI2)) + if (x != w && (scr_aa[x] & AF_BIGTILE) != AF_BIGTILE && (scr_aa[x] & AF_KANJI2)) { scr_cc[x] = ' '; - scr_aa[x] &= KANJIC; + scr_aa[x] &= AF_KANJIC; if (x1 < 0) x1 = x; x2 = x; } @@ -1011,7 +1096,7 @@ static void Term_fresh_row_both(int y, int x1, int x2) old_tcc[x] = ntc; /* 2nd byte of bigtile */ - if ((na & 0xf0) == 0xf0) continue; + if ((na & AF_BIGTILE) == AF_BIGTILE) continue; /* Handle high-bit attr/chars */ if ((na & 0x80) && (nc & 0x80)) @@ -1050,7 +1135,7 @@ static void Term_fresh_row_both(int y, int x1, int x2) /* Notice new color */ #ifdef JP - if (fa != (na & KANJIC)) + if (fa != (na & AF_KANJIC)) #else if (fa != na) #endif @@ -1083,7 +1168,7 @@ static void Term_fresh_row_both(int y, int x1, int x2) /* Save the new color */ #ifdef JP - fa = (na & KANJIC); + fa = (na & AF_KANJIC); #else fa = na; #endif @@ -1247,7 +1332,7 @@ static void Term_fresh_row_text(int y, int x1, int x2) /* Notice new color */ #ifdef JP - if (fa != (na & KANJIC)) + if (fa != (na & AF_KANJIC)) #else if (fa != na) #endif @@ -1280,7 +1365,7 @@ static void Term_fresh_row_text(int y, int x1, int x2) /* Save the new color */ #ifdef JP - fa = (na & KANJIC); + fa = (na & AF_KANJIC); #else fa = na; #endif @@ -1664,11 +1749,11 @@ errr Term_fresh(void) #ifdef JP if ((scr->cx + 1 < w) && - ((old->a[scr->cy][scr->cx + 1] == 255) || + ((old->a[scr->cy][scr->cx + 1] & AF_BIGTILE) == AF_BIGTILE || (!(old->a[scr->cy][scr->cx] & 0x80) && iskanji(old->c[scr->cy][scr->cx])))) #else - if ((scr->cx + 1 < w) && (old->a[scr->cy][scr->cx + 1] == 255)) + if ((scr->cx + 1 < w) && (old->a[scr->cy][scr->cx + 1] & AF_BIGTILE) == AF_BIGTILE) #endif { /* Double width cursor for the Bigtile mode */ @@ -2017,10 +2102,10 @@ errr Term_erase(int x, int y, int n) * Á´³Ñʸ»ú¤Î±¦È¾Ê¬¤«¤éʸ»ú¤òɽ¼¨¤¹¤ë¾ì¹ç¡¢ * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Îº¸Éôʬ¤ò¾Ãµî¡£ */ - if (n > 0 && (((scr_aa[x] & KANJI2) && !(scr_aa[x] & 0x80)) - || ((byte)scr_cc[x] == 255 && scr_aa[x] == 255))) + if (n > 0 && (((scr_aa[x] & AF_KANJI2) && (scr_aa[x] & AF_BIGTILE) != AF_BIGTILE) + || (scr_aa[x] & AF_BIGTILE) == AF_BIGTILE)) #else - if (n > 0 && (byte)scr_cc[x] == 255 && scr_aa[x] == 255) + if (n > 0 && (scr_aa[x] & AF_BIGTILE) == AF_BIGTILE) #endif { x--; @@ -2044,7 +2129,7 @@ errr Term_erase(int x, int y, int n) * 2001/04/29 -- Habu * ¹Ô¤Î±¦Ã¼¤Î¾ì¹ç¤Ï¤³¤Î½èÍý¤ò¤·¤Ê¤¤¤è¤¦¤Ë½¤Àµ¡£ */ - if ((oa & KANJI1) && (i + 1) == n && x != w - 1) + if ((oa & AF_KANJI1) && (i + 1) == n && x != w - 1) n++; #endif /* Save the "literal" information */ @@ -2182,12 +2267,12 @@ errr Term_redraw_section(int x1, int y1, int x2, int y2) if (x1j > 0) { - if (Term->scr->a[i][x1j] & KANJI2) x1j--; + if (Term->scr->a[i][x1j] & AF_KANJI2) x1j--; } if (x2j < Term->wid - 1) { - if (Term->scr->a[i][x2j] & KANJI1) x2j++; + if (Term->scr->a[i][x2j] & AF_KANJI1) x2j++; } Term->x1[i] = x1j; diff --git a/src/z-term.h b/src/z-term.h index ec9d28cd9..333af55ea 100644 --- a/src/z-term.h +++ b/src/z-term.h @@ -274,6 +274,7 @@ extern errr Term_user(int n); extern errr Term_xtra(int n, int v); extern void Term_queue_char(int x, int y, byte a, char c, byte ta, char tc); +extern void Term_queue_bigchar(int x, int y, byte a, char c, byte ta, char tc); extern void Term_queue_line(int x, int y, int n, byte *a, char *c, byte *ta, char *tc); -- 2.11.0