• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision6f8760e518a4eb69e0eed40645529ed8534dfe19 (tree)
Time2019-05-01 13:47:24
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 cave_template_type を grid_template_type に改名して grid.h へ移動.

Change Summary

Incremental Difference

--- a/src/grid.h
+++ b/src/grid.h
@@ -65,6 +65,18 @@ struct grid_type
6565 byte when; /* Hack -- when cost was computed */
6666 };
6767
68+/*
69+ * A structure type for terrain template of saving dungeon floor
70+ */
71+typedef struct
72+{
73+ BIT_FLAGS info;
74+ FEAT_IDX feat;
75+ FEAT_IDX mimic;
76+ s16b special;
77+ u16b occurrence;
78+} grid_template_type;
79+
6880 /* Macros */
6981
7082 #define set_cave_feat(Y,X,F) (current_floor_ptr->grid_array[(Y)][(X)].feat = (F))
--- a/src/load.c
+++ b/src/load.c
@@ -2992,7 +2992,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
29922992 u32b tmp32u;
29932993 u16b limit;
29942994
2995- cave_template_type *templates;
2995+ grid_template_type *templates;
29962996
29972997
29982998 /*** Wipe all current_floor_ptr->grid_array ***/
@@ -3064,12 +3064,12 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
30643064 rd_u16b(&limit);
30653065
30663066 /* Allocate the "template" array */
3067- C_MAKE(templates, limit, cave_template_type);
3067+ C_MAKE(templates, limit, grid_template_type);
30683068
30693069 /* Read the templates */
30703070 for (i = 0; i < limit; i++)
30713071 {
3072- cave_template_type *ct_ptr = &templates[i];
3072+ grid_template_type *ct_ptr = &templates[i];
30733073
30743074 /* Read it */
30753075 rd_u16b(&tmp16u);
@@ -3165,7 +3165,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
31653165 }
31663166
31673167 /* Free the "template" array */
3168- C_KILL(templates, limit, cave_template_type);
3168+ C_KILL(templates, limit, grid_template_type);
31693169
31703170
31713171 /*** Objects ***/
--- a/src/save.c
+++ b/src/save.c
@@ -867,7 +867,7 @@ static void wr_extra(void)
867867 */
868868 static void wr_saved_floor(saved_floor_type *sf_ptr)
869869 {
870- cave_template_type *templates;
870+ grid_template_type *templates;
871871 u16b max_num_temp;
872872 u16b num_temp = 0;
873873 int dummy_why;
@@ -930,7 +930,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
930930 max_num_temp = 255;
931931
932932 /* Allocate the "template" array */
933- C_MAKE(templates, max_num_temp, cave_template_type);
933+ C_MAKE(templates, max_num_temp, grid_template_type);
934934
935935 /* Extract template array */
936936 for (y = 0; y < current_floor_ptr->height; y++)
@@ -958,12 +958,12 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
958958 /* If the max_num_temp is too small, increase it. */
959959 if (num_temp >= max_num_temp)
960960 {
961- cave_template_type *old_template = templates;
961+ grid_template_type *old_template = templates;
962962
963963 /* Re-allocate the "template" array */
964- C_MAKE(templates, max_num_temp + 255, cave_template_type);
965- (void)C_COPY(templates, old_template, max_num_temp, cave_template_type);
966- C_KILL(old_template, max_num_temp, cave_template_type);
964+ C_MAKE(templates, max_num_temp + 255, grid_template_type);
965+ (void)C_COPY(templates, old_template, max_num_temp, grid_template_type);
966+ C_KILL(old_template, max_num_temp, grid_template_type);
967967 max_num_temp += 255;
968968 }
969969
@@ -990,7 +990,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
990990 /* Dump the templates */
991991 for (i = 0; i < num_temp; i++)
992992 {
993- cave_template_type *ct_ptr = &templates[i];
993+ grid_template_type *ct_ptr = &templates[i];
994994
995995 /* Dump it */
996996 wr_u16b((u16b)ct_ptr->info);
@@ -1067,7 +1067,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
10671067
10681068
10691069 /* Free the "template" array */
1070- C_KILL(templates, max_num_temp, cave_template_type);
1070+ C_KILL(templates, max_num_temp, grid_template_type);
10711071
10721072
10731073 /*** Dump objects ***/
--- a/src/sort.c
+++ b/src/sort.c
@@ -530,7 +530,7 @@ bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
530530 */
531531 bool ang_sort_comp_cave_temp(vptr u, vptr v, int a, int b)
532532 {
533- cave_template_type *who = (cave_template_type *)(u);
533+ grid_template_type *who = (grid_template_type *)(u);
534534
535535 u16b o1 = who[a].occurrence;
536536 u16b o2 = who[b].occurrence;
@@ -552,9 +552,9 @@ bool ang_sort_comp_cave_temp(vptr u, vptr v, int a, int b)
552552 */
553553 void ang_sort_swap_cave_temp(vptr u, vptr v, int a, int b)
554554 {
555- cave_template_type *who = (cave_template_type *)(u);
555+ grid_template_type *who = (grid_template_type *)(u);
556556
557- cave_template_type holder;
557+ grid_template_type holder;
558558
559559 /* Unused */
560560 (void)v;
--- a/src/types.h
+++ b/src/types.h
@@ -406,20 +406,6 @@ typedef struct {
406406 byte bonus; /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
407407 } autopick_type;
408408
409-
410-/*
411- * A structure type for terrain template of saving dungeon floor
412- */
413-typedef struct
414-{
415- BIT_FLAGS info;
416- FEAT_IDX feat;
417- FEAT_IDX mimic;
418- s16b special;
419- u16b occurrence;
420-} cave_template_type;
421-
422-
423409 typedef struct {
424410 int flag;
425411 int type;
Show on old repository browser