From 67796bdd7f7b472524c9f7eb925e375056cd64d6 Mon Sep 17 00:00:00 2001 From: deskull Date: Thu, 10 Sep 2020 01:22:32 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20term=5Fputstr=5Fv()=20=E3=82=92=20z-term?= =?utf8?q?.c=20=E3=81=AB=E7=A7=BB=E5=8B=95=EF=BC=8E=20/=20Move=20term=5Fpu?= =?utf8?q?tstr=5Fv()=20to=20z-term.c.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/player/player-damage.c | 32 -------------------------------- src/term/z-term.c | 32 ++++++++++++++++++++++++++++++++ src/term/z-term.h | 6 ++++++ 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/player/player-damage.c b/src/player/player-damage.c index 7a94a14b8..6a86c434a 100644 --- a/src/player/player-damage.c +++ b/src/player/player-damage.c @@ -317,38 +317,6 @@ HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int return get_damage; } -#ifdef JP -/* - * Move to a location and, using an attr, add a string vertically - */ -static errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s) -{ - errr res; - int y0 = y; - - for (int i = 0; i < n && s[i] != 0; i++) { - /* Move first */ - if ((res = term_gotoxy(x, y0)) != 0) - return (res); - - if (iskanji(s[i])) { - if ((res = term_addstr(2, a, &s[i])) != 0) - return (res); - i++; - y0++; - if (s[i] == 0) - break; - } else { - if ((res = term_addstr(1, a, &s[i])) != 0) - return (res); - y0++; - } - } - - return 0; -} -#endif - /* * Decreases players hit points and sets death flag if necessary * diff --git a/src/term/z-term.c b/src/term/z-term.c index 7996be631..f056992e2 100644 --- a/src/term/z-term.c +++ b/src/term/z-term.c @@ -2267,3 +2267,35 @@ errr term_init(term_type *t, TERM_LEN w, TERM_LEN h, int k) t->pict_hook = term_pict_hack; return 0; } + +#ifdef JP +/* + * Move to a location and, using an attr, add a string vertically + */ +errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s) +{ + errr res; + int y0 = y; + + for (int i = 0; i < n && s[i] != 0; i++) { + /* Move first */ + if ((res = term_gotoxy(x, y0)) != 0) + return (res); + + if (iskanji(s[i])) { + if ((res = term_addstr(2, a, &s[i])) != 0) + return (res); + i++; + y0++; + if (s[i] == 0) + break; + } else { + if ((res = term_addstr(1, a, &s[i])) != 0) + return (res); + y0++; + } + } + + return 0; +} +#endif diff --git a/src/term/z-term.h b/src/term/z-term.h index a2a81d578..1ccf15864 100644 --- a/src/term/z-term.h +++ b/src/term/z-term.h @@ -176,4 +176,10 @@ extern errr term_resize(TERM_LEN w, TERM_LEN h); extern errr term_activate(term_type *t); extern errr term_init(term_type *t, TERM_LEN w, TERM_LEN h, int k); + +#ifdef JP +extern errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s); +#endif + #endif + -- 2.11.0