• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision644d8170b983d08faab4819171b6988e851d4bfe (tree)
Time2019-04-20 16:24:26
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 generate.h を floor-generate.hへ統合。

Change Summary

Incremental Difference

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -296,7 +296,6 @@
296296 <ClInclude Include="..\..\src\floor.h" />
297297 <ClInclude Include="..\..\src\gameoption.h" />
298298 <ClInclude Include="..\..\src\gamevalue.h" />
299- <ClInclude Include="..\..\src\generate.h" />
300299 <ClInclude Include="..\..\src\geometry.h" />
301300 <ClInclude Include="..\..\src\grid.h" />
302301 <ClInclude Include="..\..\src\h-basic.h" />
--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
@@ -317,7 +317,6 @@
317317 <ClInclude Include="..\..\src\externs.h" />
318318 <ClInclude Include="..\..\src\gameoption.h" />
319319 <ClInclude Include="..\..\src\gamevalue.h" />
320- <ClInclude Include="..\..\src\generate.h" />
321320 <ClInclude Include="..\..\src\h-basic.h" />
322321 <ClInclude Include="..\..\src\h-config.h" />
323322 <ClInclude Include="..\..\src\h-define.h" />
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -97,7 +97,7 @@
9797 */
9898
9999 #include "angband.h"
100-#include "generate.h"
100+#include "floor-generate.h"
101101 #include "grid.h"
102102 #include "rooms.h"
103103 #include "floor.h"
--- a/src/floor-generate.h
+++ b/src/floor-generate.h
@@ -1,3 +1,110 @@
11 #pragma once
2+
3+/*!
4+ * @file generate.h
5+ * @brief ダンジョン生成処理のヘッダーファイル
6+ * @date 2014/08/08
7+ * @author
8+ * 不明(変愚蛮怒スタッフ?)
9+ */
10+
11+#define ALLOW_CAVERNS_AND_LAKES
12+
13+#define SAFE_MAX_ATTEMPTS 5000 /*!< 生成処理基本試行回数 */
14+
15+
16+
17+extern int dun_tun_rnd; /*!< ダンジョンの通路方向を掻き回す頻度(一回の試行ごとに%で判定している) */
18+extern int dun_tun_chg; /*!< ダンジョンの通路をクランクさせる頻度(一回の試行ごとに%で判定している) */
19+extern int dun_tun_con; /*!< ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとに%で判定している) */
20+extern int dun_tun_pen; /*!< ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとに%で判定している) */
21+extern int dun_tun_jct; /*!< ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとに%で判定している) */
22+
23+/*
24+ * Hack -- Dungeon allocation "places"
25+ */
26+#define ALLOC_SET_CORR 1 /* Hallway */
27+#define ALLOC_SET_ROOM 2 /* Room */
28+#define ALLOC_SET_BOTH 3 /* Anywhere */
29+
30+ /*
31+ * Hack -- Dungeon allocation "types"
32+ */
33+#define ALLOC_TYP_RUBBLE 1 /* Rubble */
34+#define ALLOC_TYP_TRAP 3 /* Trap */
35+#define ALLOC_TYP_GOLD 4 /* Gold */
36+#define ALLOC_TYP_OBJECT 5 /* Object */
37+#define ALLOC_TYP_INVIS 6 /* Invisible wall */
38+
39+
40+
41+ /*
42+ * The "size" of a "generation block" in grids
43+ */
44+#define BLOCK_HGT 11
45+#define BLOCK_WID 11
46+
47+ /*
48+ * Maximum numbers of rooms along each axis (currently 6x6)
49+ */
50+#define MAX_ROOMS_ROW (MAX_HGT / BLOCK_HGT)
51+#define MAX_ROOMS_COL (MAX_WID / BLOCK_WID)
52+
53+
54+ /*
55+ * Bounds on some arrays used in the "dun_data" structure.
56+ * These bounds are checked, though usually this is a formality.
57+ */
58+#define CENT_MAX 100
59+#define DOOR_MAX 200
60+#define WALL_MAX 500
61+#define TUNN_MAX 900
62+
63+
64+ /*
65+ * Structure to hold all "dungeon generation" data
66+ */
67+
68+typedef struct dun_data dun_data;
69+
70+struct dun_data
71+{
72+ /* Array of centers of rooms */
73+ int cent_n;
74+ coord cent[CENT_MAX];
75+
76+ /* Array of possible door locations */
77+ int door_n;
78+ coord door[DOOR_MAX];
79+
80+ /* Array of wall piercing locations */
81+ int wall_n;
82+ coord wall[WALL_MAX];
83+
84+ /* Array of tunnel grids */
85+ int tunn_n;
86+ coord tunn[TUNN_MAX];
87+
88+ /* Number of blocks along each axis */
89+ int row_rooms;
90+ int col_rooms;
91+
92+ /* Array of which blocks are used */
93+ bool room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL];
94+
95+ /* Various type of dungeon floors */
96+ bool destroyed;
97+ bool empty_level;
98+ bool cavern;
99+ int laketype;
100+};
101+
102+extern dun_data *dun;
103+
104+extern bool place_quest_monsters(void);
105+extern void wipe_generate_random_floor_flags(void);
106+extern void clear_cave(void);
107+extern void generate_random_floor(void);
108+
2109 extern bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2);
3110 extern bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff);
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -13,7 +13,7 @@
1313 #include "angband.h"
1414 #include "floor.h"
1515 #include "floor-events.h"
16-#include "generate.h"
16+#include "floor-generate.h"
1717 #include "grid.h"
1818 #include "monster.h"
1919 #include "quest.h"
--- a/src/floor-streams.c
+++ b/src/floor-streams.c
@@ -16,7 +16,7 @@
1616 */
1717
1818 #include "angband.h"
19-#include "generate.h"
19+#include "floor-generate.h"
2020 #include "floor.h"
2121 #include "floor-streams.h"
2222 #include "grid.h"
--- a/src/generate.h
+++ /dev/null
@@ -1,105 +0,0 @@
1-/*!
2- * @file generate.h
3- * @brief ダンジョン生成処理のヘッダーファイル
4- * @date 2014/08/08
5- * @author
6- * 不明(変愚蛮怒スタッフ?)
7- */
8-
9-#define ALLOW_CAVERNS_AND_LAKES
10-
11-#define SAFE_MAX_ATTEMPTS 5000 /*!< 生成処理基本試行回数 */
12-
13-
14-
15-extern int dun_tun_rnd; /*!< ダンジョンの通路方向を掻き回す頻度(一回の試行ごとに%で判定している) */
16-extern int dun_tun_chg; /*!< ダンジョンの通路をクランクさせる頻度(一回の試行ごとに%で判定している) */
17-extern int dun_tun_con; /*!< ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとに%で判定している) */
18-extern int dun_tun_pen; /*!< ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとに%で判定している) */
19-extern int dun_tun_jct; /*!< ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとに%で判定している) */
20-
21-/*
22- * Hack -- Dungeon allocation "places"
23- */
24-#define ALLOC_SET_CORR 1 /* Hallway */
25-#define ALLOC_SET_ROOM 2 /* Room */
26-#define ALLOC_SET_BOTH 3 /* Anywhere */
27-
28-/*
29- * Hack -- Dungeon allocation "types"
30- */
31-#define ALLOC_TYP_RUBBLE 1 /* Rubble */
32-#define ALLOC_TYP_TRAP 3 /* Trap */
33-#define ALLOC_TYP_GOLD 4 /* Gold */
34-#define ALLOC_TYP_OBJECT 5 /* Object */
35-#define ALLOC_TYP_INVIS 6 /* Invisible wall */
36-
37-
38-
39-/*
40- * The "size" of a "generation block" in grids
41- */
42-#define BLOCK_HGT 11
43-#define BLOCK_WID 11
44-
45-/*
46- * Maximum numbers of rooms along each axis (currently 6x6)
47- */
48-#define MAX_ROOMS_ROW (MAX_HGT / BLOCK_HGT)
49-#define MAX_ROOMS_COL (MAX_WID / BLOCK_WID)
50-
51-
52-/*
53- * Bounds on some arrays used in the "dun_data" structure.
54- * These bounds are checked, though usually this is a formality.
55- */
56-#define CENT_MAX 100
57-#define DOOR_MAX 200
58-#define WALL_MAX 500
59-#define TUNN_MAX 900
60-
61-
62-/*
63- * Structure to hold all "dungeon generation" data
64- */
65-
66-typedef struct dun_data dun_data;
67-
68-struct dun_data
69-{
70- /* Array of centers of rooms */
71- int cent_n;
72- coord cent[CENT_MAX];
73-
74- /* Array of possible door locations */
75- int door_n;
76- coord door[DOOR_MAX];
77-
78- /* Array of wall piercing locations */
79- int wall_n;
80- coord wall[WALL_MAX];
81-
82- /* Array of tunnel grids */
83- int tunn_n;
84- coord tunn[TUNN_MAX];
85-
86- /* Number of blocks along each axis */
87- int row_rooms;
88- int col_rooms;
89-
90- /* Array of which blocks are used */
91- bool room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL];
92-
93- /* Various type of dungeon floors */
94- bool destroyed;
95- bool empty_level;
96- bool cavern;
97- int laketype;
98-};
99-
100-extern dun_data *dun;
101-
102-extern bool place_quest_monsters(void);
103-extern void wipe_generate_random_floor_flags(void);
104-extern void clear_cave(void);
105-extern void generate_random_floor(void);
--- a/src/grid.c
+++ b/src/grid.c
@@ -22,7 +22,7 @@
2222 #include "world.h"
2323 #include "object-flavor.h"
2424 #include "object-hook.h"
25-#include "generate.h"
25+#include "floor-generate.h"
2626 #include "grid.h"
2727 #include "trap.h"
2828 #include "rooms.h"
--- a/src/load.c
+++ b/src/load.c
@@ -41,7 +41,7 @@
4141 */
4242
4343 #include "angband.h"
44-#include "generate.h"
44+#include "floor-generate.h"
4545 #include "trap.h"
4646 #include "mutation.h"
4747 #include "monster.h"
--- a/src/rooms-city.c
+++ b/src/rooms-city.c
@@ -1,6 +1,6 @@
11 #include "angband.h"
22 #include "grid.h"
3-#include "generate.h"
3+#include "floor-generate.h"
44 #include "rooms.h"
55 #include "rooms-city.h"
66 #include "store.h"
--- a/src/rooms-fractal.c
+++ b/src/rooms-fractal.c
@@ -1,6 +1,6 @@
11 #include "angband.h"
22 #include "grid.h"
3-#include "generate.h"
3+#include "floor-generate.h"
44 #include "rooms.h"
55 #include "rooms-normal.h"
66 #include "floor.h"
--- a/src/rooms-pitnest.c
+++ b/src/rooms-pitnest.c
@@ -1,6 +1,6 @@
11 #include "angband.h"
22 #include "grid.h"
3-#include "generate.h"
3+#include "floor-generate.h"
44 #include "rooms.h"
55 #include "rooms-pitnest.h"
66 #include "monster.h"
--- a/src/rooms-special.c
+++ b/src/rooms-special.c
@@ -1,6 +1,6 @@
11 #include "angband.h"
22 #include "grid.h"
3-#include "generate.h"
3+#include "floor-generate.h"
44 #include "rooms.h"
55 #include "monster.h"
66 #include "monsterrace-hook.h"
--- a/src/rooms-trap.c
+++ b/src/rooms-trap.c
@@ -1,6 +1,6 @@
11 #include "angband.h"
22 #include "grid.h"
3-#include "generate.h"
3+#include "floor-generate.h"
44 #include "rooms.h"
55 #include "floor.h"
66
--- a/src/rooms-vault.c
+++ b/src/rooms-vault.c
@@ -1,5 +1,5 @@
11 #include "angband.h"
2-#include "generate.h"
2+#include "floor-generate.h"
33 #include "grid.h"
44 #include "rooms.h"
55 #include "store.h"
--- a/src/rooms.c
+++ b/src/rooms.c
@@ -38,7 +38,7 @@
3838
3939 #include "angband.h"
4040 #include "floor.h"
41-#include "generate.h"
41+#include "floor-generate.h"
4242 #include "grid.h"
4343 #include "rooms.h"
4444
Show on old repository browser