OSDN Git Service

Merge pull request #41491 (taotao/hengband/fix-impure_calc_num_blow into develop).
[hengband/hengband.git] / src / inventory / item-selection-util.c
1 #include "inventory/item-selection-util.h"
2 #include "io/input-key-requester.h"
3 #include "object/item-use-flags.h"
4
5 fis_type *initialize_fis_type(fis_type *fis_ptr, COMMAND_CODE *cp, BIT_FLAGS mode, tval_type tval)
6 {
7     fis_ptr->cp = cp;
8     fis_ptr->mode = mode;
9     fis_ptr->tval = tval;
10     fis_ptr->n1 = ' ';
11     fis_ptr->n2 = ' ';
12     fis_ptr->which = ' ';
13     fis_ptr->oops = FALSE;
14     fis_ptr->equip = (fis_ptr->mode & USE_EQUIP) != 0;
15     fis_ptr->inven = (fis_ptr->mode & USE_INVEN) != 0;
16     fis_ptr->floor = (fis_ptr->mode & USE_FLOOR) != 0;
17     fis_ptr->force = (fis_ptr->mode & USE_FORCE) != 0;
18     fis_ptr->allow_equip = FALSE;
19     fis_ptr->allow_inven = FALSE;
20     fis_ptr->allow_floor = FALSE;
21     fis_ptr->toggle = FALSE;
22     fis_ptr->floor_top = 0;
23     fis_ptr->min_width = 0;
24     fis_ptr->menu_line = use_menu ? 1 : 0;
25     fis_ptr->max_inven = 0;
26     fis_ptr->max_equip = 0;
27     fis_ptr->cur_tag = '\0';
28     return fis_ptr;
29 }
30
31 item_selection_type *initialize_item_selection_type(item_selection_type *item_selection_ptr, COMMAND_CODE *cp, BIT_FLAGS mode, tval_type tval)
32 {
33     item_selection_ptr->cp = cp;
34     item_selection_ptr->mode = mode;
35     item_selection_ptr->tval = tval;
36     item_selection_ptr->next_o_idx = 0;
37     item_selection_ptr->which = ' ';
38     item_selection_ptr->oops = FALSE;
39     item_selection_ptr->equip = FALSE;
40     item_selection_ptr->inven = FALSE;
41     item_selection_ptr->floor = FALSE;
42     item_selection_ptr->allow_floor = FALSE;
43     item_selection_ptr->toggle = FALSE;
44     item_selection_ptr->menu_line = (use_menu ? 1 : 0);
45     item_selection_ptr->max_inven = 0;
46     item_selection_ptr->max_equip = 0;
47     item_selection_ptr->cur_tag = '\0';
48     return item_selection_ptr;
49 }