• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision9c07778d60d8119d7d69c1e4bfe4eb5004c8d3bf (tree)
Time2019-06-15 16:27:41
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #39068 display_inven(), display_equip() の item_tester_tval グローバル参照をローカル引数に収める.

Change Summary

Incremental Difference

--- a/src/object.h
+++ b/src/object.h
@@ -415,8 +415,8 @@ extern concptr mention_use(int i);
415415 extern concptr describe_use(int i);
416416 extern bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VALUE book_sval);
417417 extern bool item_tester_okay(object_type *o_ptr, OBJECT_TYPE_VALUE tval);
418-extern void display_inven(void);
419-extern void display_equip(void);
418+extern void display_inven(OBJECT_TYPE_VALUE tval);
419+extern void display_equip(OBJECT_TYPE_VALUE tval);
420420 extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
421421 extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
422422 extern void toggle_inven_equip(void);
--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -55,7 +55,7 @@ INVENTORY_IDX label_to_equip(int c)
5555 * Choice window "shadow" of the "show_equip()" function
5656 * @return なし
5757 */
58-void display_equip(void)
58+void display_equip(OBJECT_TYPE_VALUE tval)
5959 {
6060 register int i, n;
6161 object_type *o_ptr;
@@ -70,7 +70,7 @@ void display_equip(void)
7070 {
7171 o_ptr = &p_ptr->inventory_list[i];
7272 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
73- if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, item_tester_tval))
73+ if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval))
7474 {
7575 tmp_val[0] = index_to_label(i);
7676 tmp_val[1] = ')';
@@ -2072,7 +2072,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode,
20722072 n2 = I2A(i2);
20732073
20742074 /* Redraw if needed */
2075- if (command_see) get_item_label = show_inven(menu_line, mode, item_tester_tval);
2075+ if (command_see) get_item_label = show_inven(menu_line, mode, tval);
20762076 }
20772077
20782078 /* Equipment screen */
@@ -2083,7 +2083,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode,
20832083 n2 = I2A(e2 - INVEN_RARM);
20842084
20852085 /* Redraw if needed */
2086- if (command_see) get_item_label = show_equip(menu_line, mode, item_tester_tval);
2086+ if (command_see) get_item_label = show_equip(menu_line, mode, tval);
20872087 }
20882088
20892089 /* Floor screen */
@@ -3158,7 +3158,7 @@ void py_pickup_floor(bool pickup)
31583158 * Choice window "shadow" of the "show_inven()" function
31593159 * @return なし
31603160 */
3161-void display_inven(void)
3161+void display_inven(OBJECT_TYPE_VALUE tval)
31623162 {
31633163 register int i, n, z = 0;
31643164 object_type *o_ptr;
@@ -3180,7 +3180,7 @@ void display_inven(void)
31803180 {
31813181 o_ptr = &p_ptr->inventory_list[i];
31823182 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3183- if (item_tester_okay(o_ptr, item_tester_tval))
3183+ if (item_tester_okay(o_ptr, tval))
31843184 {
31853185 tmp_val[0] = index_to_label(i);
31863186 tmp_val[1] = ')';
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -1577,7 +1577,7 @@ static void fix_inven(void)
15771577 Term_activate(angband_term[j]);
15781578
15791579 /* Display p_ptr->inventory_list */
1580- display_inven();
1580+ display_inven(item_tester_tval);
15811581 Term_fresh();
15821582 Term_activate(old);
15831583 }
@@ -1764,7 +1764,7 @@ static void fix_equip(void)
17641764 Term_activate(angband_term[j]);
17651765
17661766 /* Display equipment */
1767- display_equip();
1767+ display_equip(item_tester_tval);
17681768 Term_fresh();
17691769 Term_activate(old);
17701770 }
Show on old repository browser