/*!
* @brief フォーカスを当てるべきマップ描画の基準座標を指定する
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param y 変更先のフロアY座標
* @param x 変更先のフロアX座標
* @details
* Also used in do_cmd_locate
* @return 実際に再描画が必要だった場合TRUEを返す
*/
-static bool change_panel_xy(POSITION y, POSITION x)
+static bool change_panel_xy(player_type *creature_ptr, POSITION y, POSITION x)
{
POSITION dy = 0, dx = 0;
TERM_LEN wid, hgt;
if (!dy && !dx) return FALSE;
- return change_panel(dy, dx);
+ return change_panel(creature_ptr, dy, dx);
}
x = tmp_pos.x[m];
/* Set forcus */
- change_panel_xy(y, x);
+ change_panel_xy(creature_ptr, y, x);
if (!(mode & TARGET_LOOK)) print_path(floor_ptr, y, x);
while (flag && (i < 0))
{
/* Note the change */
- if (change_panel(ddy[d], ddx[d]))
+ if (change_panel(creature_ptr, ddy[d], ddx[d]))
{
int v = tmp_pos.y[m];
int u = tmp_pos.x[m];
if ((y >= panel_row_min+hgt) || (y < panel_row_min) ||
(x >= panel_col_min+wid) || (x < panel_col_min))
{
- if (change_panel(dy, dx)) target_set_prepare(mode);
+ if (change_panel(creature_ptr, dy, dx)) target_set_prepare(mode);
}
/* Slide into legality */
if ((y >= panel_row_min + hgt) || (y < panel_row_min) ||
(x >= panel_col_min + wid) || (x < panel_col_min))
{
- if (change_panel(dy, dx)) target_set_prepare(mode);
+ if (change_panel(creature_ptr, dy, dx)) target_set_prepare(mode);
}
/* Slide into legality */
dy = 2 * (y - cy) / hgt;
dx = 2 * (x - cx) / wid;
- if (dy || dx) change_panel(dy, dx);
+ if (dy || dx) change_panel(creature_ptr, dy, dx);
}
}
break;
if ((y >= panel_row_min + hgt) || (y < panel_row_min) ||
(x >= panel_col_min + wid) || (x < panel_col_min))
{
- /* if (change_panel(dy, dx)) target_set_prepare(mode); */
- change_panel(dy, dx);
+ change_panel(creature_ptr, dy, dx);
}
/* Slide into legality */
/*!
+ * todo ここにplayer_type を追加するとz-termに影響が行くので保留
* @brief コンソールのリサイズに合わせてマップを再描画する /
* Map resizing whenever the main term changes size
* @return なし
Term_fresh();
}
+
/*!
+ * todo ここにplayer_type を追加するとz-termに影響が行くので保留
* @brief コンソールを再描画する /
* Redraw a term when it is resized
* @return なし
/*!
* @brief フォーカスを当てるべきマップ描画の基準座標を指定する(サブルーチン)
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param dy 変更先のフロアY座標
* @param dx 変更先のフロアX座標
* Handle a request to change the current panel
* Also used in do_cmd_locate
* @return 実際に再描画が必要だった場合TRUEを返す
*/
-bool change_panel(POSITION dy, POSITION dx)
+bool change_panel(player_type *player_ptr, POSITION dy, POSITION dx)
{
POSITION y, x;
TERM_LEN wid, hgt;
x = panel_col_min + dx * wid / 2;
/* Verify the row */
- if (y > p_ptr->current_floor_ptr->height - hgt) y = p_ptr->current_floor_ptr->height - hgt;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if (y > floor_ptr->height - hgt) y = floor_ptr->height - hgt;
if (y < 0) y = 0;
/* Verify the col */
- if (x > p_ptr->current_floor_ptr->width - wid) x = p_ptr->current_floor_ptr->width - wid;
+ if (x > floor_ptr->width - wid) x = floor_ptr->width - wid;
if (x < 0) x = 0;
/* Handle "changes" */
panel_bounds_center();
- p_ptr->update |= (PU_MONSTERS);
- p_ptr->redraw |= (PR_MAP);
- handle_stuff(p_ptr);
+ player_ptr->update |= (PU_MONSTERS);
+ player_ptr->redraw |= (PR_MAP);
+ handle_stuff(player_ptr);
/* Success */
return TRUE;
extern void object_kind_track(KIND_OBJECT_IDX k_idx);
extern void resize_map(void);
extern void redraw_window(void);
-extern bool change_panel(POSITION dy, POSITION dx);
+extern bool change_panel(player_type *player_ptr, POSITION dy, POSITION dx);
extern void window_stuff(player_type *player_ptr);
extern void update_playtime(void);