OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / cmd4.c
index 66657c8..8b500d3 100644 (file)
@@ -369,7 +369,7 @@ errr do_cmd_write_nikki(int type, int num, cptr note)
        cptr note_level = "";
        bool do_level = TRUE;
        char note_level_buf[40];
-       int q_idx;
+       QUEST_IDX q_idx;
 
        static bool disable_nikki = FALSE;
 
@@ -1401,7 +1401,7 @@ static void do_cmd_options_cheat(cptr info)
        /* Interact with the player */
        while (TRUE)
        {
-               int dir;
+               DIRECTION dir;
 
                /* Prompt XXX XXX XXX */
                sprintf(buf, _("%s ( リターンで次へ, y/n でセット, ESC で決定 )", "%s (RET to advance, y/n to set, ESC to accept) "), info);
@@ -1685,7 +1685,7 @@ void do_cmd_options_aux(int page, cptr info)
        /* Interact with the player */
        while (TRUE)
        {
-               int dir;
+               DIRECTION dir;
 
                /* Prompt XXX XXX XXX */
                sprintf(buf, _("%s (リターン:次, %sESC:終了, ?:ヘルプ) ", "%s (RET:next, %s, ?:help) "),
@@ -1810,8 +1810,8 @@ void do_cmd_options_aux(int page, cptr info)
 static void do_cmd_options_win(void)
 {
        int i, j, d;
-       TERM_POSITION y = 0;
-       TERM_POSITION x = 0;
+       TERM_LEN y = 0;
+       TERM_LEN x = 0;
        char ch;
        bool go = TRUE;
        u32b old_flag[8];
@@ -3194,7 +3194,7 @@ void do_cmd_visuals(void)
                case '2':
                {
                        static cptr mark = "Object attr/chars";
-                       IDX k_idx;
+                       KIND_OBJECT_IDX k_idx;
 
                        /* Prompt */
                        prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
@@ -3330,9 +3330,9 @@ void do_cmd_visuals(void)
                                int c;
                                IDX t;
 
-                               byte da = r_ptr->d_attr;
+                               TERM_COLOR da = r_ptr->d_attr;
                                byte dc = r_ptr->d_char;
-                               byte ca = r_ptr->x_attr;
+                               TERM_COLOR ca = r_ptr->x_attr;
                                byte cc = r_ptr->x_char;
 
                                /* Label the object */
@@ -3422,9 +3422,9 @@ void do_cmd_visuals(void)
                                int c;
                                IDX t;
 
-                               SYMBOL_COLOR da = k_ptr->d_attr;
+                               TERM_COLOR da = k_ptr->d_attr;
                                SYMBOL_CODE dc = k_ptr->d_char;
-                               SYMBOL_COLOR ca = k_ptr->x_attr;
+                               TERM_COLOR ca = k_ptr->x_attr;
                                SYMBOL_CODE cc = k_ptr->x_char;
 
                                /* Label the object */
@@ -3516,9 +3516,9 @@ void do_cmd_visuals(void)
                                int c;
                                IDX t;
 
-                               byte da = f_ptr->d_attr[lighting_level];
+                               TERM_COLOR da = f_ptr->d_attr[lighting_level];
                                byte dc = f_ptr->d_char[lighting_level];
-                               byte ca = f_ptr->x_attr[lighting_level];
+                               TERM_COLOR ca = f_ptr->x_attr[lighting_level];
                                byte cc = f_ptr->x_char[lighting_level];
 
                                /* Label the object */
@@ -4668,7 +4668,7 @@ void do_cmd_load_screen(void)
 {
        int i, y, x;
 
-       byte a = 0;
+       TERM_COLOR a = 0;
        char c = ' ';
 
        bool okay = TRUE;
@@ -4798,10 +4798,10 @@ cptr inven_res_label = _("                               酸電火冷毒光闇
 
 
 /* XTRA HACK RESLIST */
-static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, byte tval, char *where)
+static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, OBJECT_TYPE_VALUE tval, char *where)
 {
        char o_name[MAX_NLEN];
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
 
        if (!o_ptr->k_idx) return;
        if (o_ptr->tval != tval) return;
@@ -4902,7 +4902,7 @@ static void do_cmd_knowledge_inven(void)
 
        store_type  *st_ptr;
 
-       byte tval;
+       OBJECT_TYPE_VALUE tval;
        int i = 0;
        int j = 0;
 
@@ -4960,7 +4960,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
 {
        int y, x, i;
 
-       byte a = 0, old_a = 0;
+       TERM_COLOR a = 0, old_a = 0;
        char c = ' ';
 
        FILE *fff, *tmpfff;
@@ -5195,7 +5195,7 @@ void do_cmd_save_screen(void)
        {
                int y, x;
 
-               byte a = 0;
+               TERM_COLOR a = 0;
                char c = ' ';
 
                FILE *fff;
@@ -6382,7 +6382,7 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
 /*
  * Display visuals.
  */
-static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
+static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left)
 {
        int i, j;
 
@@ -6403,8 +6403,8 @@ static void display_visual_list(int col, int row, int height, int width, byte at
                {
                        byte a;
                        char c;
-                       TERM_POSITION x = col + j;
-                       TERM_POSITION y = row + i;
+                       TERM_LEN x = col + j;
+                       TERM_LEN y = row + i;
                        int ia, ic;
 
                        /* Bigtile mode uses double width */
@@ -6434,13 +6434,13 @@ static void display_visual_list(int col, int row, int height, int width, byte at
 /*
  * Place the cursor at the collect position for visual mode
  */
-static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
+static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, byte c, TERM_COLOR attr_top, byte char_left)
 {
        int i = (a & 0x7f) - attr_top;
        int j = c - char_left;
 
-       int x = col + j;
-       int y = row + i;
+       TERM_LEN x = col + j;
+       TERM_LEN y = row + i;
 
        /* Bigtile mode uses double width */
        if (use_bigtile) x += j;
@@ -6453,11 +6453,11 @@ static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr
 /*
  *  Clipboard variables for copy&paste in visual mode
  */
-static byte attr_idx = 0;
+static TERM_COLOR attr_idx = 0;
 static byte char_idx = 0;
 
 /* Hack -- for feature lighting */
-static byte attr_idx_feat[F_LIT_MAX];
+static TERM_COLOR attr_idx_feat[F_LIT_MAX];
 static byte char_idx_feat[F_LIT_MAX];
 
 /*
@@ -6465,10 +6465,11 @@ static byte char_idx_feat[F_LIT_MAX];
  */
 static bool visual_mode_command(char ch, bool *visual_list_ptr,
                                int height, int width,
-                               byte *attr_top_ptr, byte *char_left_ptr,
-                               byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
+                               TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
+                               TERM_COLOR *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
 {
-       static byte attr_old = 0, char_old = 0;
+       static TERM_COLOR attr_old = 0;
+       static byte char_old = 0;
 
        switch (ch)
        {
@@ -6671,10 +6672,11 @@ static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX d
        bool redraw;
 
        bool visual_list = FALSE;
-       byte attr_top = 0, char_left = 0;
+       TERM_COLOR attr_top = 0;
+       byte char_left = 0;
 
        int browser_rows;
-       TERM_POSITION wid, hgt;
+       TERM_LEN wid, hgt;
 
        BIT_FLAGS8 mode;
 
@@ -6926,7 +6928,8 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[]
        for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
        {
                char o_name[80];
-               byte a, c;
+               TERM_COLOR a;
+               byte c;
                object_kind *flavor_k_ptr;
 
                /* Get the object index */
@@ -6996,7 +6999,7 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[]
 /*
  * Describe fake object
  */
-static void desc_obj_fake(IDX k_idx)
+static void desc_obj_fake(KIND_OBJECT_IDX k_idx)
 {
        object_type *o_ptr;
        object_type object_type_body;
@@ -7050,7 +7053,8 @@ static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX di
        bool redraw;
 
        bool visual_list = FALSE;
-       byte attr_top = 0, char_left = 0;
+       TERM_COLOR attr_top = 0;
+       byte char_left = 0;
 
        int browser_rows;
        int wid, hgt;
@@ -7411,14 +7415,16 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
        bool redraw;
 
        bool visual_list = FALSE;
-       byte attr_top = 0, char_left = 0;
+       TERM_COLOR attr_top = 0;
+       byte char_left = 0;
 
        int browser_rows;
        int wid, hgt;
 
-       byte attr_old[F_LIT_MAX];
+       TERM_COLOR attr_old[F_LIT_MAX];
        byte char_old[F_LIT_MAX];
-       byte *cur_attr_ptr, *cur_char_ptr;
+       TERM_COLOR *cur_attr_ptr;
+       byte *cur_char_ptr;
 
        (void)C_WIPE(attr_old, F_LIT_MAX, byte);
        (void)C_WIPE(char_old, F_LIT_MAX, byte);
@@ -7639,7 +7645,7 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
 
                else if ((ch == 'D') || (ch == 'd'))
                {
-                       byte prev_x_attr = f_ptr->x_attr[*lighting_level];
+                       TERM_COLOR prev_x_attr = f_ptr->x_attr[*lighting_level];
                        byte prev_x_char = f_ptr->x_char[*lighting_level];
 
                        apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
@@ -8012,7 +8018,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
                                                        artifact_type *a_ptr = &a_info[quest[i].k_idx];
                                                        object_type forge;
                                                        object_type *q_ptr = &forge;
-                                                       IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
+                                                       KIND_OBJECT_IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
                                                        object_prep(q_ptr, k_idx);
                                                        q_ptr->name1 = quest[i].k_idx;
                                                        q_ptr->ident = IDENT_STORE;
@@ -8361,7 +8367,7 @@ static void do_cmd_knowledge_home(void)
                if (st_ptr->stock_num)
                {
 #ifdef JP
-                       int x = 1;
+                       TERM_LEN x = 1;
 #endif
                        /* Header with name of the town */
                        fprintf(fff, _("  [ 我が家のアイテム ]\n", "  [Home Inventory]\n"));