From 73f327e5c23b3f856ec032007756f059c330f66c Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 6 Mar 2019 22:31:11 +0900 Subject: [PATCH] [Refactor] #37353 wilderness_type to wild.c. --- src/bldg.c | 1 + src/externs.h | 1 - src/load.c | 1 + src/monster1.c | 1 + src/monster2.c | 1 + src/save.c | 1 + src/types.h | 17 ----------------- src/variable.c | 7 ------- src/wild.c | 7 +++++++ src/wild.h | 17 +++++++++++++++++ 10 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index 4877dc097..4fd884987 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -17,6 +17,7 @@ #include "object-hook.h" #include "monsterrace-hook.h" #include "melee.h" +#include "wild.h" #include "world.h" #include "sort.h" diff --git a/src/externs.h b/src/externs.h index 3a16a0368..3e46c8d85 100644 --- a/src/externs.h +++ b/src/externs.h @@ -307,7 +307,6 @@ extern void (*ang_sort_swap)(vptr u, vptr v, int a, int b); extern monsterrace_hook_type get_mon_num_hook; extern monsterrace_hook_type get_mon_num2_hook; extern bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx); -extern wilderness_type **wilderness; extern building_type building[MAX_BLDG]; extern QUEST_IDX max_q_idx; extern MONRACE_IDX max_r_idx; diff --git a/src/load.c b/src/load.c index 815c4f110..df9b42e9f 100644 --- a/src/load.c +++ b/src/load.c @@ -50,6 +50,7 @@ #include "avatar.h" #include "spells-status.h" #include "object-hook.h" +#include "wild.h" /* diff --git a/src/monster1.c b/src/monster1.c index f6e7003d5..8d48d4dd1 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -20,6 +20,7 @@ #include "quest.h" #include "artifact.h" #include "avatar.h" +#include "wild.h" /* diff --git a/src/monster2.c b/src/monster2.c index 302b44a5b..c825adf9e 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -20,6 +20,7 @@ #include "quest.h" #include "grid.h" #include "player-move.h" +#include "wild.h" #define HORDE_NOGOOD 0x01 /*!< (未実装フラグ)HORDE生成でGOODなモンスターの生成を禁止する? */ #define HORDE_NOEVIL 0x02 /*!< (未実装フラグ)HORDE生成でEVILなモンスターの生成を禁止する? */ diff --git a/src/save.c b/src/save.c index f24e47312..e2bb0d8ee 100644 --- a/src/save.c +++ b/src/save.c @@ -15,6 +15,7 @@ #include "sort.h" #include "quest.h" #include "store.h" +#include "wild.h" diff --git a/src/types.h b/src/types.h index 651713509..56840938e 100644 --- a/src/types.h +++ b/src/types.h @@ -1640,23 +1640,6 @@ struct border_type s16b south_east; }; - -/* - * A structure describing a wilderness area - * with a terrain or a town - */ -typedef struct wilderness_type wilderness_type; -struct wilderness_type -{ - int terrain; - TOWN_IDX town; - int road; - u32b seed; - DEPTH level; - byte entrance; -}; - - /* * A structure describing a town with * stores and buildings diff --git a/src/variable.c b/src/variable.c index c780391aa..7b850bf72 100644 --- a/src/variable.c +++ b/src/variable.c @@ -682,13 +682,6 @@ monsterrace_hook_type get_mon_num2_hook; */ bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx); - -/* - * Wilderness - */ -wilderness_type **wilderness; - - /* * Buildings */ diff --git a/src/wild.c b/src/wild.c index 0cb2a8f66..d5c8f46c6 100644 --- a/src/wild.c +++ b/src/wild.c @@ -11,12 +11,19 @@ */ #include "angband.h" +#include "wild.h" #include "world.h" #include "monster.h" #include "realm-hex.h" #include "player-status.h" #include "grid.h" + /* + * Wilderness + */ +wilderness_type **wilderness; + + /*! * @brief 地形生成確率を決める要素100の配列を確率テーブルから作成する * @param feat_type 非一様確率を再現するための要素数100の配列 diff --git a/src/wild.h b/src/wild.h index f4141af87..c92fac903 100644 --- a/src/wild.h +++ b/src/wild.h @@ -9,3 +9,20 @@ extern void init_wilderness_terrains(void); extern void seed_wilderness(void); extern errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x); extern bool change_wild_mode(void); + +/* + * A structure describing a wilderness area + * with a terrain or a town + */ +typedef struct +{ + int terrain; + TOWN_IDX town; + int road; + u32b seed; + DEPTH level; + byte entrance; +} wilderness_type; + +extern wilderness_type **wilderness; + -- 2.11.0