OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / variable.c
index 66ce32a..420d164 100644 (file)
@@ -16,7 +16,7 @@
  * コピーライト情報 /
  * Hack -- Link a copyright message into the executable
  */
-const cptr copyright[5] =
+const concptr copyright[5] =
 {
        "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke",
        "",
@@ -25,13 +25,12 @@ const cptr copyright[5] =
        "are included in all such copies."
 };
 
-
 int max_macrotrigger = 0; /*!< 現在登録中のマクロ(トリガー)の数 */
-cptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
-cptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
-cptr macro_modifier_name[MAX_MACRO_MOD]; /*!< マクロ上で取り扱う特殊キーを文字列上で表現するためのフォーマットを記録した文字列ポインタ配列 */
-cptr macro_trigger_name[MAX_MACRO_TRIG]; /*!< マクロのトリガーコード */
-cptr macro_trigger_keycode[2][MAX_MACRO_TRIG];  /*!< マクロの内容 */
+concptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
+concptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
+concptr macro_modifier_name[MAX_MACRO_MOD]; /*!< マクロ上で取り扱う特殊キーを文字列上で表現するためのフォーマットを記録した文字列ポインタ配列 */
+concptr macro_trigger_name[MAX_MACRO_TRIG]; /*!< マクロのトリガーコード */
+concptr macro_trigger_keycode[2][MAX_MACRO_TRIG];  /*!< マクロの内容 */
 
 int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
 
@@ -46,7 +45,7 @@ autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体の
 /*
  * Savefile version
  */
-byte h_ver_major;       /* Savefile version for Hengband 1.1.1 and later */
+byte h_ver_major; /* Savefile version for Hengband 1.1.1 and later */
 byte h_ver_minor;
 byte h_ver_patch;
 byte h_ver_extra;
@@ -97,9 +96,7 @@ u32b seed_town;                       /* Hack -- consistent town layout */
 s16b command_cmd;              /* Current "Angband Command" */
 
 COMMAND_ARG command_arg;       /*!< 各種コマンドの汎用的な引数として扱う / Gives argument of current command */
-
 COMMAND_NUM command_rep;       /*!< 各種コマンドの汎用的なリピート数として扱う / Gives repetition of current command */
-
 DIRECTION command_dir;         /*!< 各種コマンドの汎用的な方向値処理として扱う/ Gives direction of current command */
 
 s16b command_see;              /* See "object1.c" */
@@ -117,7 +114,7 @@ GAME_TURN resting;                  /* Current counter for resting, if any */
 POSITION cur_hgt;              /* Current dungeon height */
 POSITION cur_wid;              /* Current dungeon width */
 DEPTH dun_level;               /*!< 現在の実ダンジョン階層、base_levelの参照元となる / Current dungeon level */
-s16b num_repro;                        /* Current reproducer count */
+MONSTER_NUMBER num_repro; /*!< Current reproducer count */
 DEPTH base_level;              /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
 DEPTH object_level;            /*!< アイテムの生成レベル、base_levelを起点に一時変更する時に参照 / Current object creation level */
 DEPTH monster_level;   /*!< モンスターの生成レベル、base_levelを起点に一時変更する時に参照 / Current monster creation level */
@@ -156,14 +153,14 @@ bool repair_objects;      /* Hack -- optimize detect objects */
 bool is_loading_now;   /*!< ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
 bool hack_mutation;
 
-s16b inven_cnt;                        /* Number of items in inventory */
-s16b equip_cnt;                        /* Number of items in equipment */
+s16b inven_cnt; /* Number of items in inventory */
+s16b equip_cnt; /* Number of items in equipment */
 
-s16b o_max = 1;                        /* Number of allocated objects */
-s16b o_cnt = 0;                        /* Number of live objects */
+OBJECT_IDX o_max = 1; /* Number of allocated objects */
+OBJECT_IDX o_cnt = 0; /* Number of live objects */
 
-MONSTER_IDX m_max = 1;                 /* Number of allocated monsters */
-MONSTER_IDX m_cnt = 0;                 /* Number of live monsters */
+MONSTER_IDX m_max = 1; /* Number of allocated monsters */
+MONSTER_IDX m_cnt = 0; /* Number of live monsters */
 
 MONSTER_IDX hack_m_idx = 0;    /* Hack -- see "process_monsters()" */
 MONSTER_IDX hack_m_idx_ii = 0;
@@ -197,7 +194,7 @@ POSITION panel_col_prt, panel_row_prt;
 /*
  * Targetting variables
  */
-IDX target_who;
+MONSTER_IDX target_who;
 POSITION target_col;
 POSITION target_row;
 
@@ -222,38 +219,23 @@ char player_base[32];
 char savefile[1024];
 char savefile_base[40];
 
-/*
- * Array of grids lit by player lite (see "cave.c")
- */
-POSITION_IDX lite_n;
+POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "cave.c")
 POSITION lite_y[LITE_MAX];
 POSITION lite_x[LITE_MAX];
 
-/*
- * Array of grids lit by player lite (see "cave.c")
- */
-POSITION_IDX mon_lite_n;
+POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "cave.c")
 POSITION mon_lite_y[MON_LITE_MAX];
 POSITION mon_lite_x[MON_LITE_MAX];
 
-/*
- * Array of grids viewable to the player (see "cave.c")
- */
-POSITION_IDX view_n;
+POSITION_IDX view_n; //!< Array of grids viewable to the player (see "cave.c")
 POSITION view_y[VIEW_MAX];
 POSITION view_x[VIEW_MAX];
 
-/*
- * Array of grids for use by various functions (see "cave.c")
- */
-POSITION_IDX temp_n;
+POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "cave.c")
 POSITION temp_y[TEMP_MAX];
 POSITION temp_x[TEMP_MAX];
 
-/*
- * Array of grids for delayed visual updating (see "cave.c")
- */
-POSITION_IDX redraw_n = 0;
+POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "cave.c")
 POSITION redraw_y[REDRAW_MAX];
 POSITION redraw_x[REDRAW_MAX];
 
@@ -266,12 +248,12 @@ s16b macro__num;
 /*
  * Array of macro patterns [MACRO_MAX]
  */
-cptr *macro__pat;
+concptr *macro__pat;
 
 /*
  * Array of macro actions [MACRO_MAX]
  */
-cptr *macro__act;
+concptr *macro__act;
 
 /*
  * Array of macro types [MACRO_MAX]
@@ -292,7 +274,7 @@ STR_OFFSET quark__num;
 /*
  * The pointers to the quarks [QUARK_MAX]
  */
-cptr *quark__str;
+concptr *quark__str;
 
 
 /*
@@ -325,27 +307,16 @@ u32b *message__ptr;
  */
 char *message__buf;
 
-
-/*
- * The array of normal options
- */
-u32b option_flag[8];
-u32b option_mask[8];
-
-
-/*
- * The array of window options
- */
-u32b window_flag[8];
-u32b window_mask[8];
-
+BIT_FLAGS option_flag[8]; //!< The array of normal options
+BIT_FLAGS option_mask[8]; //!< The array of normal options
+BIT_FLAGS window_flag[8]; //!< The array of window options
+BIT_FLAGS window_mask[8]; //!< The array of window options
 
 /*
  * The array of window pointers
  */
 term *angband_term[8];
 
-
 /*
  * Standard window names
  */
@@ -389,7 +360,7 @@ byte angband_color_table[256][4] =
 /*
  * Standard sound names
  */
-const cptr angband_sound_name[SOUND_MAX] =
+const concptr angband_sound_name[SOUND_MAX] =
 {
        "dummy",
        "hit",
@@ -463,7 +434,7 @@ const cptr angband_sound_name[SOUND_MAX] =
 /*
  * Standard music names
  */
-const cptr angband_music_basic_name[MUSIC_BASIC_MAX] =
+const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
 {
        "default",
        "gameover",
@@ -506,7 +477,7 @@ saved_floor_type saved_floors[MAX_SAVED_FLOORS];
 /*
  * Number of floor_id used from birth
  */
-s16b max_floor_id;
+FLOOR_IDX max_floor_id;
 
 
 /*
@@ -591,7 +562,7 @@ char tval_to_char[128];
 /*
  * Keymaps for each "mode" associated with each keypress.
  */
-cptr keymap_act[KEYMAP_MODES][256];
+concptr keymap_act[KEYMAP_MODES][256];
 
 
 
@@ -687,114 +658,30 @@ char *d_name;
 char *d_text;
 
 
-/*
- * Hack -- The special Angband "System Suffix"
- * This variable is used to choose an appropriate "pref-xxx" file
- */
-cptr ANGBAND_SYS = "xxx";
+concptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
+
 
-/*
- * Hack -- The special Angband "Keyboard Suffix"
- * This variable is used to choose an appropriate macro-trigger definition
- */
 #ifdef JP
-cptr ANGBAND_KEYBOARD = "JAPAN";
+concptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
 #else
-cptr ANGBAND_KEYBOARD = "0";
+concptr ANGBAND_KEYBOARD = "0";
 #endif
 
-/*
- * Hack -- The special Angband "Graphics Suffix"
- * This variable is used to choose an appropriate "graf-xxx" file
- */
-cptr ANGBAND_GRAF = "ascii";
-
-/*
- * Path name: The main "lib" directory
- * This variable is not actually used anywhere in the code
- */
-cptr ANGBAND_DIR;
-
-/*
- * High score files (binary)
- * These files may be portable between platforms
- */
-cptr ANGBAND_DIR_APEX;
-
-/*
- * Bone files for player ghosts (ascii)
- * These files are portable between platforms
- */
-cptr ANGBAND_DIR_BONE;
-
-/*
- * Binary image files for the "*_info" arrays (binary)
- * These files are not portable between platforms
- */
-cptr ANGBAND_DIR_DATA;
-
-/*
- * Textual template files for the "*_info" arrays (ascii)
- * These files are portable between platforms
- */
-cptr ANGBAND_DIR_EDIT;
+concptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
+concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
+concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
+concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
+concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
+concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
+concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
+concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
+concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
+concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
+concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
+concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary)
+concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms
+concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
 
-/*
- * Script files
- * These files are portable between platforms.
- */
-cptr ANGBAND_DIR_SCRIPT;
-
-/*
- * Various extra files (ascii)
- * These files may be portable between platforms
- */
-cptr ANGBAND_DIR_FILE;
-
-/*
- * Help files (normal) for the online help (ascii)
- * These files are portable between platforms
- */
-cptr ANGBAND_DIR_HELP;
-
-/*
- * Help files (spoilers) for the online help (ascii)
- * These files are portable between platforms
- */
-cptr ANGBAND_DIR_INFO;
-
-/*
- * Default user "preference" files (ascii)
- * These files are rarely portable between platforms
- */
-cptr ANGBAND_DIR_PREF;
-
-/*
- * Savefiles for current characters (binary)
- * These files are portable between platforms
- */
-cptr ANGBAND_DIR_SAVE;
-
-/*
- * User "preference" files (ascii)
- * These files are rarely portable between platforms
- */
-cptr ANGBAND_DIR_USER;
-
-/*
- * Various extra files (binary)
- * These files are rarely portable between platforms
- */
-cptr ANGBAND_DIR_XTRA;
-
-
-/*
- * Total Hack -- allow all items to be listed (even empty ones)
- * This is only used by "do_cmd_inven_e()" and is cleared there.
- */
-bool item_tester_full;
-
-bool item_tester_no_ryoute = FALSE;
 
 /*
  * Here is a "pseudo-hook" used during calls to "get_item()" and
@@ -827,8 +714,8 @@ void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
 /*
  * Hack -- function hooks to restrict "get_mon_num_prep()" function
  */
-monster_hook_type get_mon_num_hook;
-monster_hook_type get_mon_num2_hook;
+monsterrace_hook_type get_mon_num_hook;
+monsterrace_hook_type get_mon_num2_hook;
 
 
 /*
@@ -872,12 +759,12 @@ KIND_OBJECT_IDX max_k_idx;
 /*
  * Maximum number of vaults in v_info.txt
  */
-IDX max_v_idx;
+VAULT_IDX max_v_idx;
 
 /*
  * Maximum number of terrain features in f_info.txt
  */
-IDX max_f_idx;
+FEAT_IDX max_f_idx;
 
 /*
  * Maximum number of artifacts in a_info.txt
@@ -887,7 +774,7 @@ ARTIFACT_IDX max_a_idx;
 /*
  * Maximum number of ego-items in e_info.txt
  */
-IDX max_e_idx;
+EGO_IDX max_e_idx;
 
 /*
  * Maximum number of dungeon in e_info.txt
@@ -946,7 +833,6 @@ int mutant_regenerate_mod = 100;
 bool can_save = FALSE;        /* Game can be saved */
 
 s16b world_monster;
-bool world_player;
 
 int cap_mon;
 int cap_mspeed;
@@ -971,8 +857,6 @@ bool write_level;
 u32b playtime;
 u32b start_time;
 
-int tsuri_dir;
-
 bool sukekaku;
 bool new_mane;
 
@@ -981,7 +865,7 @@ bool mon_fight;
 bool ambush_flag;
 bool generate_encounter;
 
-cptr screen_dump = NULL;
+concptr screen_dump = NULL;
 
 /*** Terrain feature variables ***/
 
@@ -996,9 +880,6 @@ FEAT_IDX feat_glyph;
 FEAT_IDX feat_explosive_rune;
 FEAT_IDX feat_mirror;
 
-/* Doors */
-door_type feat_door[MAX_DOOR_TYPES];
-
 /* Stairs */
 FEAT_IDX feat_up_stair;
 FEAT_IDX feat_down_stair;
@@ -1047,6 +928,14 @@ FEAT_IDX feat_deep_water;
 FEAT_IDX feat_shallow_water;
 FEAT_IDX feat_deep_lava;
 FEAT_IDX feat_shallow_lava;
+FEAT_IDX feat_heavy_cold_zone;
+FEAT_IDX feat_cold_zone;
+FEAT_IDX feat_heavy_electrical_zone;
+FEAT_IDX feat_electrical_zone;
+FEAT_IDX feat_deep_acid_puddle;
+FEAT_IDX feat_shallow_acid_puddle;
+FEAT_IDX feat_deep_poisonous_puddle;
+FEAT_IDX feat_shallow_poisonous_puddle;
 FEAT_IDX feat_dirt;
 FEAT_IDX feat_grass;
 FEAT_IDX feat_flower;
@@ -1067,7 +956,7 @@ DEPTH *max_dlv;
 FEAT_IDX feat_wall_outer;
 FEAT_IDX feat_wall_inner;
 FEAT_IDX feat_wall_solid;
-FEAT_IDX floor_type[100], fill_type[100];
+FEAT_IDX feat_ground_type[100], feat_wall_type[100];
 
 bool now_damaged;
 COMMAND_CODE now_message;