OSDN Git Service

[Fix] 文字2倍幅表示のときにMMマップを表示するとクラッシュ #990
authoriks <iks3@users.noreply.github.com>
Sat, 1 May 2021 02:49:59 +0000 (11:49 +0900)
committeriks <iks3@users.noreply.github.com>
Sat, 1 May 2021 04:48:43 +0000 (13:48 +0900)
描画列数の計算で枠線の幅を半角でのみ計算しているため、use_bigtile時は1本分超過していた。

src/window/main-window-util.cpp

index 39074c3..ab9c9a3 100644 (file)
@@ -184,6 +184,7 @@ static void display_shortened_item_name(player_type *player_ptr, object_type *o_
  * @return なし
  * @details
  * メインウィンドウ('M'コマンド)、サブウィンドウ兼(縮小図)用。
+ * use_bigtile時に横の描画列数は1/2になる。
  */
 void display_map(player_type *player_ptr, int *cy, int *cx)
 {
@@ -196,12 +197,14 @@ void display_map(player_type *player_ptr, int *cy, int *cx)
 
     bool old_view_special_lite = view_special_lite;
     bool old_view_granite_lite = view_granite_lite;
+
+    TERM_LEN border_width = use_bigtile ? 2 : 1; //!< @note 枠線幅
     TERM_LEN hgt, wid, yrat, xrat;
     term_get_size(&wid, &hgt);
     hgt -= 2;
-    wid -= 14;
+    wid -= 12 + border_width * 2; //!< @note 描画桁数(枠線抜)
     if (use_bigtile)
-        wid /= 2;
+        wid = wid / 2 - 1;
 
     floor_type *floor_ptr = player_ptr->current_floor_ptr;
     yrat = (floor_ptr->height + hgt - 1) / hgt;