• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision69b81d7a3a8c79139953edf7c34b663bdf114419 (tree)
Time2019-04-24 23:11:46
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 floor.c を作成して floor_type 型整理。

Change Summary

Incremental Difference

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -155,6 +155,7 @@
155155 <ClCompile Include="..\..\src\floor-events.c" />
156156 <ClCompile Include="..\..\src\floor-generate.c" />
157157 <ClCompile Include="..\..\src\floor-save.c" />
158+ <ClCompile Include="..\..\src\floor.c" />
158159 <ClCompile Include="..\..\src\geometry.c" />
159160 <ClCompile Include="..\..\src\history.c" />
160161 <ClCompile Include="..\..\src\init.c" />
--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
@@ -315,6 +315,9 @@
315315 <ClCompile Include="..\..\src\player-skill.c">
316316 <Filter>player</Filter>
317317 </ClCompile>
318+ <ClCompile Include="..\..\src\floor.c">
319+ <Filter>floor</Filter>
320+ </ClCompile>
318321 </ItemGroup>
319322 <ItemGroup>
320323 <ClInclude Include="..\..\src\angband.h" />
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,7 @@ hengband_SOURCES = \
2121 \
2222 defines.h dungeon.c externs.h files.c files.h \
2323 \
24- floor.h floor-events.c floor-events.h floor-generate.c floor-generate.h \
24+ floor.c floor.h floor-events.c floor-events.h floor-generate.c floor-generate.h \
2525 floor-save.h floor-save.c \
2626 floor-streams.c floor-streams.h \
2727 \
--- a/src/artifact.c
+++ b/src/artifact.c
@@ -16,6 +16,7 @@
1616 #include "artifact.h"
1717
1818 #include "avatar.h"
19+#include "floor.h"
1920 #include "cmd-activate.h"
2021 #include "object-boost.h"
2122 #include "object-curse.h"
--- a/src/autopick.c
+++ b/src/autopick.c
@@ -23,6 +23,7 @@
2323 #include "object-hook.h"
2424
2525 #include "files.h"
26+#include "floor.h"
2627
2728 #define MAX_LINELEN 1024
2829
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -17,6 +17,7 @@
1717 #include "realm-hex.h"
1818 #include "player-status.h"
1919 #include "player-effects.h"
20+#include "floor.h"
2021
2122 /*!
2223 * @brief 食料を食べるコマンドのサブルーチン
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -22,6 +22,7 @@
2222 #include "spells-floor.h"
2323 #include "object-broken.h"
2424 #include "cmd-basic.h"
25+#include "floor.h"
2526
2627 /*!
2728 * @brief 薬を飲むコマンドのサブルーチン /
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -26,6 +26,7 @@
2626
2727 #include "cmd-basic.h"
2828 #include "files.h"
29+#include "floor.h"
2930
3031 /*!
3132 * @brief 巻物を読むコマンドのサブルーチン
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -33,6 +33,7 @@
3333 #include "object-hook.h"
3434 #include "cmd-basic.h"
3535 #include "view-mainwindow.h"
36+#include "floor.h"
3637
3738 /*!
3839 * @brief
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -10,6 +10,7 @@
1010 #include "spells-floor.h"
1111 #include "object-hook.h"
1212 #include "cmd-basic.h"
13+#include "floor.h"
1314
1415
1516
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -9,6 +9,7 @@
99 #include "spells-status.h"
1010 #include "spells-floor.h"
1111 #include "cmd-basic.h"
12+#include "floor.h"
1213
1314 /*!
1415 * @brief ロッドの効果を発動する
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -8,6 +8,7 @@
88 #include "player-effects.h"
99 #include "object-hook.h"
1010 #include "cmd-basic.h"
11+#include "floor.h"
1112
1213
1314 /*!
--- a/src/dungeon-file.c
+++ b/src/dungeon-file.c
@@ -9,6 +9,7 @@
99 #include "monster.h"
1010 #include "files.h"
1111 #include "player-skill.h"
12+#include "floor.h"
1213
1314 dungeon_grid letter[255];
1415
--- a/src/externs.h
+++ b/src/externs.h
@@ -223,7 +223,6 @@ extern const char angband_term_name[8][16];
223223 extern byte angband_color_table[256][4];
224224 extern const concptr angband_sound_name[SOUND_MAX];
225225 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
226-extern floor_type *current_floor_ptr;
227226 extern world_type *current_world_ptr;
228227 extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
229228 extern FLOOR_IDX max_floor_id;
--- a/src/files.c
+++ b/src/files.c
@@ -47,6 +47,7 @@
4747 #include "init.h"
4848 #include "monster-spell.h"
4949 #include "player-skill.h"
50+#include "floor.h"
5051
5152
5253 /*
--- /dev/null
+++ b/src/floor.c
@@ -0,0 +1,10 @@
1+#include "angband.h"
2+#include "floor.h"
3+
4+/*
5+ * The array of "current_floor_ptr->grid_array grids" [MAX_WID][MAX_HGT].
6+ * Not completely allocated, that would be inefficient
7+ * Not completely hardcoded, that would overflow memory
8+ */
9+floor_type floor_info;
10+floor_type *current_floor_ptr = &floor_info;
--- a/src/floor.h
+++ b/src/floor.h
@@ -1,4 +1,44 @@
1-
1+#pragma once
2+
3+typedef struct {
4+ grid_type *grid_array[MAX_HGT];
5+ DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
6+ DEPTH base_level; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
7+ DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
8+ DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
9+ POSITION width; /* Current dungeon width */
10+ POSITION height; /* Current dungeon height */
11+ MONSTER_NUMBER num_repro; /*!< Current reproducer count */
12+
13+ GAME_TURN generated_turn; /* Turn when level began */
14+
15+ object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
16+ OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
17+
18+ monster_type *m_list; /*!< The array of dungeon monsters [current_floor_ptr->max_m_idx] */
19+ MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
20+
21+ s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
22+ s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
23+
24+ POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
25+ POSITION lite_y[LITE_MAX];
26+ POSITION lite_x[LITE_MAX];
27+
28+ POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
29+ POSITION mon_lite_y[MON_LITE_MAX];
30+ POSITION mon_lite_x[MON_LITE_MAX];
31+
32+ POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array")
33+ POSITION view_y[VIEW_MAX];
34+ POSITION view_x[VIEW_MAX];
35+
36+ POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "current_floor_ptr->grid_array.c")
37+ POSITION redraw_y[REDRAW_MAX];
38+ POSITION redraw_x[REDRAW_MAX];
39+
40+} floor_type;
41+
242 #define DUNGEON_MODE_NONE 0
343 #define DUNGEON_MODE_AND 1
444 #define DUNGEON_MODE_NAND 2
@@ -257,3 +297,5 @@
257297 #define permanent_wall(F) \
258298 (have_flag((F)->flags, FF_WALL) && \
259299 have_flag((F)->flags, FF_PERMANENT))
300+
301+extern floor_type *current_floor_ptr;
\ No newline at end of file
--- a/src/init.c
+++ b/src/init.c
@@ -44,6 +44,7 @@
4444 #include "dungeon-file.h"
4545 #include "files.h"
4646 #include "feature.h"
47+#include "floor.h"
4748
4849 #ifndef MACINTOSH
4950 #ifdef CHECK_MODIFICATION_TIME
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -101,6 +101,7 @@
101101 #include "util.h"
102102
103103 #include "view-mainwindow.h"
104+#include "floor.h"
104105 #include "floor-events.h"
105106 #include "init.h"
106107 #include "files.h"
--- a/src/monsterrace-hook.c
+++ b/src/monsterrace-hook.c
@@ -4,6 +4,7 @@
44 #include "monsterrace-hook.h"
55 #include "monster.h"
66 #include "monster-spell.h"
7+#include "floor.h"
78
89 /*! 通常pit生成時のモンスターの構成条件ID / Race index for "monster pit (clone)" */
910 int vault_aux_race;
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -26,6 +26,7 @@
2626 #include "spells.h"
2727 #include "cmd-basic.h"
2828 #include "files.h"
29+#include "floor.h"
2930
3031 /*!
3132 * @brief プレイヤーに突然変異を与える
--- a/src/patron.c
+++ b/src/patron.c
@@ -17,6 +17,7 @@
1717 #include "spells-summon.h"
1818 #include "spells-object.h"
1919 #include "spells-status.h"
20+#include "floor.h"
2021
2122 #ifdef JP
2223 /*!
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -15,6 +15,7 @@
1515 #include "angband.h"
1616 #include "util.h"
1717
18+#include "floor.h"
1819 #include "bldg.h"
1920 #include "birth.h"
2021 #include "grid.h"
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -5,6 +5,7 @@
55 #include "spells.h"
66 #include "player-status.h"
77 #include "player-effects.h"
8+#include "floor.h"
89
910 /*!
1011 * @brief 生命領域魔法の各処理を行う
--- a/src/rooms-city.c
+++ b/src/rooms-city.c
@@ -2,6 +2,7 @@
22 #include "util.h"
33
44 #include "grid.h"
5+#include "floor.h"
56 #include "floor-generate.h"
67 #include "rooms.h"
78 #include "rooms-city.h"
--- a/src/save.c
+++ b/src/save.c
@@ -18,6 +18,7 @@
1818 #include "quest.h"
1919 #include "store.h"
2020 #include "wild.h"
21+#include "floor.h"
2122 #include "floor-events.h"
2223 #include "floor-save.h"
2324 #include "files.h"
--- a/src/scores.c
+++ b/src/scores.c
@@ -16,6 +16,7 @@
1616 #include "player-status.h"
1717 #include "files.h"
1818 #include "scores.h"
19+#include "floor.h"
1920
2021 /*!
2122 * @brief i番目のスコア情報にバッファ位置をシークする / Seek score 'i' in the highscore file
--- a/src/sort.c
+++ b/src/sort.c
@@ -1,5 +1,6 @@
11 #include "angband.h"
22 #include "sort.h"
3+#include "floor.h"
34 #include "quest.h"
45
56 /*
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -3,6 +3,7 @@
33
44 #include "spells-summon.h"
55 #include "monster-status.h"
6+#include "floor.h"
67
78 /*!
89 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells
--- a/src/types.h
+++ b/src/types.h
@@ -2117,45 +2117,6 @@ typedef struct {
21172117 } dragonbreath_type;
21182118
21192119 typedef struct {
2120- grid_type *grid_array[MAX_HGT];
2121- DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
2122- DEPTH base_level; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
2123- DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
2124- DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
2125- POSITION width; /* Current dungeon width */
2126- POSITION height; /* Current dungeon height */
2127- MONSTER_NUMBER num_repro; /*!< Current reproducer count */
2128-
2129- GAME_TURN generated_turn; /* Turn when level began */
2130-
2131- object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
2132- OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
2133-
2134- monster_type *m_list; /*!< The array of dungeon monsters [current_floor_ptr->max_m_idx] */
2135- MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
2136-
2137- s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
2138- s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
2139-
2140- POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
2141- POSITION lite_y[LITE_MAX];
2142- POSITION lite_x[LITE_MAX];
2143-
2144- POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
2145- POSITION mon_lite_y[MON_LITE_MAX];
2146- POSITION mon_lite_x[MON_LITE_MAX];
2147-
2148- POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array")
2149- POSITION view_y[VIEW_MAX];
2150- POSITION view_x[VIEW_MAX];
2151-
2152- POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "current_floor_ptr->grid_array.c")
2153- POSITION redraw_y[REDRAW_MAX];
2154- POSITION redraw_x[REDRAW_MAX];
2155-
2156-} floor_type;
2157-
2158-typedef struct {
21592120 POSITION max_wild_x; /*!< Maximum size of the wilderness */
21602121 POSITION max_wild_y; /*!< Maximum size of the wilderness */
21612122 GAME_TURN game_turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
--- a/src/util.c
+++ b/src/util.c
@@ -15,6 +15,7 @@
1515 #include "monsterrace-hook.h"
1616 #include "view-mainwindow.h"
1717 #include "quest.h"
18+#include "floor.h"
1819
1920
2021 static int num_more = 0;
--- a/src/variable.c
+++ b/src/variable.c
@@ -429,15 +429,6 @@ const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
429429 "ambush",
430430 };
431431
432-
433-/*
434- * The array of "current_floor_ptr->grid_array grids" [MAX_WID][MAX_HGT].
435- * Not completely allocated, that would be inefficient
436- * Not completely hardcoded, that would overflow memory
437- */
438-floor_type floor_info;
439-floor_type *current_floor_ptr = &floor_info;
440-
441432 /*
442433 * The array of saved floors
443434 */
Show on old repository browser