1 #include "load/option-loader.h"
2 #include "cmd-io/cmd-gameoption.h"
3 #include "game-option/cheat-options.h"
4 #include "game-option/option-flags.h"
5 #include "game-option/special-options.h"
6 #include "load/angband-version-comparer.h"
7 #include "load/load-util.h"
8 #include "load/load-zangband.h"
9 #include "system/angband.h"
10 #include "world/world.h"
13 * @brief ゲームオプションを読み込む / Read options (ignore most pre-2.8.0 options)
16 * Note that the normal options are now stored as a set of 256 bit flags,
17 * plus a set of 256 bit masks to indicate which bit flags were defined
18 * at the time the savefile was created. This will allow new options
19 * to be added, and old options to be removed, at any time, without
20 * hurting old savefiles.
22 * The window options are stored in the same way, but note that each
23 * window gets 32 options, and their order is fixed by certain defines.
36 if (h_older_than(1, 7, 0, 0)) {
47 current_world_ptr->wizard = TRUE;
49 cheat_peek = (c & 0x0100) ? TRUE : FALSE;
50 cheat_hear = (c & 0x0200) ? TRUE : FALSE;
51 cheat_room = (c & 0x0400) ? TRUE : FALSE;
52 cheat_xtra = (c & 0x0800) ? TRUE : FALSE;
53 cheat_know = (c & 0x1000) ? TRUE : FALSE;
54 cheat_live = (c & 0x2000) ? TRUE : FALSE;
55 cheat_save = (c & 0x4000) ? TRUE : FALSE;
56 cheat_diary_output = (c & 0x8000) ? TRUE : FALSE;
57 cheat_turn = (c & 0x0080) ? TRUE : FALSE;
58 cheat_sight = (c & 0x0040) ? TRUE : FALSE;
60 rd_byte((byte *)&autosave_l);
61 rd_byte((byte *)&autosave_t);
62 rd_s16b(&autosave_freq);
65 for (int n = 0; n < 8; n++)
69 for (int n = 0; n < 8; n++)
72 for (int n = 0; n < 8; n++) {
73 for (int i = 0; i < 32; i++) {
74 if (!(mask[n] & (1L << i)))
76 if (!(option_mask[n] & (1L << i)))
79 if (flag[n] & (1L << i)) {
80 option_flag[n] |= (1L << i);
82 option_flag[n] &= ~(1L << i);
87 if (z_older_than(10, 4, 5))
88 load_zangband_options();
90 extract_option_vars();
91 for (int n = 0; n < 8; n++)
94 for (int n = 0; n < 8; n++)
97 for (int n = 0; n < 8; n++) {
98 for (int i = 0; i < 32; i++) {
99 if (!(mask[n] & (1L << i)))
101 if (!(window_mask[n] & (1L << i)))
104 if (flag[n] & (1L << i)) {
105 window_flag[n] |= (1L << i);
107 window_flag[n] &= ~(1L << i);