OSDN Git Service

[Refactor] #37353 cave_template_type を grid_template_type に改名して grid.h へ移動.
authordeskull <deskull@users.sourceforge.jp>
Wed, 1 May 2019 04:45:17 +0000 (13:45 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 1 May 2019 04:47:24 +0000 (13:47 +0900)
src/grid.h
src/load.c
src/save.c
src/sort.c
src/types.h

index ad5580f..75ebe76 100644 (file)
@@ -65,6 +65,18 @@ struct grid_type
        byte when;              /* Hack -- when cost was computed */
 };
 
+/*
+ *  A structure type for terrain template of saving dungeon floor
+ */
+typedef struct
+{
+       BIT_FLAGS info;
+       FEAT_IDX feat;
+       FEAT_IDX mimic;
+       s16b special;
+       u16b occurrence;
+} grid_template_type;
+
 /* Macros */
 
 #define set_cave_feat(Y,X,F)    (current_floor_ptr->grid_array[(Y)][(X)].feat = (F))
index b63f281..a6d8331 100644 (file)
@@ -2992,7 +2992,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        u32b tmp32u;
        u16b limit;
 
-       cave_template_type *templates;
+       grid_template_type *templates;
 
 
        /*** Wipe all current_floor_ptr->grid_array ***/
@@ -3064,12 +3064,12 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        rd_u16b(&limit);
 
        /* Allocate the "template" array */
-       C_MAKE(templates, limit, cave_template_type);
+       C_MAKE(templates, limit, grid_template_type);
 
        /* Read the templates */
        for (i = 0; i < limit; i++)
        {
-               cave_template_type *ct_ptr = &templates[i];
+               grid_template_type *ct_ptr = &templates[i];
 
                /* Read it */
                rd_u16b(&tmp16u);
@@ -3165,7 +3165,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        }
 
        /* Free the "template" array */
-       C_KILL(templates, limit, cave_template_type);
+       C_KILL(templates, limit, grid_template_type);
 
 
        /*** Objects ***/
index 9306dae..e7469ed 100644 (file)
@@ -867,7 +867,7 @@ static void wr_extra(void)
  */
 static void wr_saved_floor(saved_floor_type *sf_ptr)
 {
-       cave_template_type *templates;
+       grid_template_type *templates;
        u16b max_num_temp;
        u16b num_temp = 0;
        int dummy_why;
@@ -930,7 +930,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        max_num_temp = 255;
 
        /* Allocate the "template" array */
-       C_MAKE(templates, max_num_temp, cave_template_type);
+       C_MAKE(templates, max_num_temp, grid_template_type);
 
        /* Extract template array */
        for (y = 0; y < current_floor_ptr->height; y++)
@@ -958,12 +958,12 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
                        /* If the max_num_temp is too small, increase it. */
                        if (num_temp >= max_num_temp)
                        {
-                               cave_template_type *old_template = templates;
+                               grid_template_type *old_template = templates;
 
                                /* Re-allocate the "template" array */
-                               C_MAKE(templates, max_num_temp + 255, cave_template_type);
-                               (void)C_COPY(templates, old_template, max_num_temp, cave_template_type);
-                               C_KILL(old_template, max_num_temp, cave_template_type);
+                               C_MAKE(templates, max_num_temp + 255, grid_template_type);
+                               (void)C_COPY(templates, old_template, max_num_temp, grid_template_type);
+                               C_KILL(old_template, max_num_temp, grid_template_type);
                                max_num_temp += 255;
                        }
 
@@ -990,7 +990,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        /* Dump the templates */
        for (i = 0; i < num_temp; i++)
        {
-               cave_template_type *ct_ptr = &templates[i];
+               grid_template_type *ct_ptr = &templates[i];
 
                /* Dump it */
                wr_u16b((u16b)ct_ptr->info);
@@ -1067,7 +1067,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
 
 
        /* Free the "template" array */
-       C_KILL(templates, max_num_temp, cave_template_type);
+       C_KILL(templates, max_num_temp, grid_template_type);
 
 
        /*** Dump objects ***/
index 44f216a..b7f4018 100644 (file)
@@ -530,7 +530,7 @@ bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
  */
 bool ang_sort_comp_cave_temp(vptr u, vptr v, int a, int b)
 {
-       cave_template_type *who = (cave_template_type *)(u);
+       grid_template_type *who = (grid_template_type *)(u);
 
        u16b o1 = who[a].occurrence;
        u16b o2 = who[b].occurrence;
@@ -552,9 +552,9 @@ bool ang_sort_comp_cave_temp(vptr u, vptr v, int a, int b)
  */
 void ang_sort_swap_cave_temp(vptr u, vptr v, int a, int b)
 {
-       cave_template_type *who = (cave_template_type *)(u);
+       grid_template_type *who = (grid_template_type *)(u);
 
-       cave_template_type holder;
+       grid_template_type holder;
 
        /* Unused */
        (void)v;
index d8a3d30..59ae8ee 100644 (file)
@@ -406,20 +406,6 @@ typedef struct {
        byte bonus;         /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
 } autopick_type;
 
-
-/*
- *  A structure type for terrain template of saving dungeon floor
- */
-typedef struct
-{
-       BIT_FLAGS info;
-       FEAT_IDX feat;
-       FEAT_IDX mimic;
-       s16b special;
-       u16b occurrence;
-} cave_template_type;
-
-
 typedef struct {
        int flag;
        int type;