OSDN Git Service

[Refactor] #37353 PROJECT_* 定義を新規ファイル projection.h へ移動。 / Move PROJECT_* definition...
[hengband/hengband.git] / src / cave.c
index f56d30b..5a0118f 100644 (file)
@@ -17,6 +17,8 @@
 
 
 #include "angband.h"
+#include "world.h"
+#include "projection.h"
 
 static byte display_autopick; /*!< 自動拾い状態の設定フラグ */
 static int match_autopick;
@@ -67,7 +69,7 @@ POSITION distance (POSITION y1, POSITION x1, POSITION y2, POSITION x2)
  * @param feat 地形情報のID
  * @return 罠持ちの地形ならばTRUEを返す。
  */
-bool is_trap(IDX feat)
+bool is_trap(FEAT_IDX feat)
 {
        return have_flag(f_info[feat].flags, FF_TRAP);
 }
@@ -90,7 +92,7 @@ bool is_known_trap(cave_type *c_ptr)
  * @param feat 地形情報のID
  * @return 閉じたドアのある地形ならばTRUEを返す。
  */
-bool is_closed_door(IDX feat)
+bool is_closed_door(FEAT_IDX feat)
 {
        feature_type *f_ptr = &f_info[feat];
 
@@ -160,22 +162,22 @@ bool los(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
        POSITION dx, dy;
 
        /* Absolute */
-       int ax, ay;
+       POSITION ax, ay;
 
        /* Signs */
-       int sx, sy;
+       POSITION sx, sy;
 
        /* Fractions */
-       int qx, qy;
+       POSITION qx, qy;
 
        /* Scanners */
-       int tx, ty;
+       POSITION tx, ty;
 
        /* Scale factors */
-       int f1, f2;
+       POSITION f1, f2;
 
        /* Slope, or 1/Slope, of LOS */
-       int m;
+       POSITION m;
 
 
        /* Extract the offset */
@@ -1651,13 +1653,13 @@ void lite_spot(POSITION y, POSITION x)
  */
 void prt_map(void)
 {
-       int     x, y;
-       int     v;
+       POSITION x, y;
+       int v;
 
        /* map bounds */
-       s16b xmin, xmax, ymin, ymax;
+       POSITION xmin, xmax, ymin, ymax;
 
-       int wid, hgt;
+       TERM_LEN wid, hgt;
 
        Term_get_size(&wid, &hgt);
 
@@ -1698,10 +1700,10 @@ void prt_map(void)
                for (x = xmin; x <= xmax; x++)
                {
                        TERM_COLOR a;
-                       char c;
+                       SYMBOL_CODE c;
 
                        TERM_COLOR ta;
-                       char tc;
+                       SYMBOL_CODE tc;
 
                        /* Determine what is there */
                        map_info(y, x, &a, &c, &ta, &tc);
@@ -1798,7 +1800,7 @@ void prt_path(POSITION y, POSITION x)
 }
 
 
-static cptr simplify_list[][2] =
+static concptr simplify_list[][2] =
 {
 #ifdef JP
        {"の魔法書", ""},
@@ -1844,7 +1846,7 @@ static void display_shortened_item_name(object_type *o_ptr, int y)
                int i;
                for (i = 0; simplify_list[i][1]; i++)
                {
-                       cptr org_w = simplify_list[i][0];
+                       concptr org_w = simplify_list[i][0];
 
                        if (*org_w == '^')
                        {
@@ -1857,7 +1859,7 @@ static void display_shortened_item_name(object_type *o_ptr, int y)
                        if (!strncmp(c, org_w, strlen(org_w)))
                        {
                                char *s = c;
-                               cptr tmp = simplify_list[i][1];
+                               concptr tmp = simplify_list[i][1];
                                while (*tmp)
                                        *s++ = *tmp++;
                                tmp = c + strlen(org_w);
@@ -2252,8 +2254,6 @@ void do_cmd_view_map(void)
                /* Get any key */
                inkey();
        }
-
-       /* Restore the screen */
        screen_load();
 }
 
@@ -4659,10 +4659,10 @@ FEAT_IDX feat_state(FEAT_IDX feat, int action)
 void cave_alter_feat(POSITION y, POSITION x, int action)
 {
        /* Set old feature */
-       IDX oldfeat = cave[y][x].feat;
+       FEAT_IDX oldfeat = cave[y][x].feat;
 
        /* Get the new feat */
-       IDX newfeat = feat_state(oldfeat, action);
+       FEAT_IDX newfeat = feat_state(oldfeat, action);
 
        /* No change */
        if (newfeat == oldfeat) return;