OSDN Git Service

[Refactor] #37353 floor.c を作成して floor_type 型整理。
authordeskull <deskull@users.sourceforge.jp>
Wed, 24 Apr 2019 14:11:46 +0000 (23:11 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 24 Apr 2019 14:11:46 +0000 (23:11 +0900)
32 files changed:
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/artifact.c
src/autopick.c
src/cmd-eat.c
src/cmd-quaff.c
src/cmd-read.c
src/cmd-spell.c
src/cmd-usestaff.c
src/cmd-zaprod.c
src/cmd-zapwand.c
src/dungeon-file.c
src/externs.h
src/files.c
src/floor.c [new file with mode: 0644]
src/floor.h
src/init.c
src/main-win.c
src/monsterrace-hook.c
src/mutation.c
src/patron.c
src/player-effects.c
src/realm-life.c
src/rooms-city.c
src/save.c
src/scores.c
src/sort.c
src/spells-summon.c
src/types.h
src/util.c
src/variable.c

index cc01e03..13793ef 100644 (file)
     <ClCompile Include="..\..\src\floor-events.c" />\r
     <ClCompile Include="..\..\src\floor-generate.c" />\r
     <ClCompile Include="..\..\src\floor-save.c" />\r
+    <ClCompile Include="..\..\src\floor.c" />\r
     <ClCompile Include="..\..\src\geometry.c" />\r
     <ClCompile Include="..\..\src\history.c" />\r
     <ClCompile Include="..\..\src\init.c" />\r
index c02aa38..d630c91 100644 (file)
     <ClCompile Include="..\..\src\player-skill.c">
       <Filter>player</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\floor.c">
+      <Filter>floor</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\angband.h" />
index 1074507..1d415b5 100644 (file)
@@ -21,7 +21,7 @@ hengband_SOURCES = \
        \
        defines.h dungeon.c externs.h files.c files.h \
        \
-       floor.h floor-events.c floor-events.h floor-generate.c floor-generate.h \
+       floor.c floor.h floor-events.c floor-events.h floor-generate.c floor-generate.h \
        floor-save.h floor-save.c \
        floor-streams.c floor-streams.h \
        \
index 7c8515d..74c03f6 100644 (file)
@@ -16,6 +16,7 @@
 #include "artifact.h"
 
 #include "avatar.h"
+#include "floor.h"
 #include "cmd-activate.h"
 #include "object-boost.h"
 #include "object-curse.h"
index c77d951..ca3a3a2 100644 (file)
@@ -23,6 +23,7 @@
 #include "object-hook.h"
 
 #include "files.h"
+#include "floor.h"
 
 #define MAX_LINELEN 1024
 
index 576aa64..6046d9c 100644 (file)
@@ -17,6 +17,7 @@
 #include "realm-hex.h"
 #include "player-status.h"
 #include "player-effects.h"
+#include "floor.h"
 
 /*!
  * @brief 食料を食べるコマンドのサブルーチン
index f6978ab..fbe0979 100644 (file)
@@ -22,6 +22,7 @@
 #include "spells-floor.h"
 #include "object-broken.h"
 #include "cmd-basic.h"
+#include "floor.h"
 
 /*!
  * @brief 薬を飲むコマンドのサブルーチン /
index fc4a641..0e32a68 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "cmd-basic.h"
 #include "files.h"
+#include "floor.h"
 
 /*!
  * @brief 巻物を読むコマンドのサブルーチン
index 87de891..f456f97 100644 (file)
@@ -33,6 +33,7 @@
 #include "object-hook.h"
 #include "cmd-basic.h"
 #include "view-mainwindow.h"
+#include "floor.h"
 
 /*!
  * @brief
index 21277ed..ee20ab0 100644 (file)
@@ -10,6 +10,7 @@
 #include "spells-floor.h"
 #include "object-hook.h"
 #include "cmd-basic.h"
+#include "floor.h"
 
 
 
index 6fdfc94..f0f4420 100644 (file)
@@ -9,6 +9,7 @@
 #include "spells-status.h"
 #include "spells-floor.h"
 #include "cmd-basic.h"
+#include "floor.h"
 
 /*!
  * @brief ロッドの効果を発動する
index 3fd90c8..8e2ec27 100644 (file)
@@ -8,6 +8,7 @@
 #include "player-effects.h"
 #include "object-hook.h"
 #include "cmd-basic.h"
+#include "floor.h"
 
 
 /*!
index 0525e49..7275fab 100644 (file)
@@ -9,6 +9,7 @@
 #include "monster.h"
 #include "files.h"
 #include "player-skill.h"
+#include "floor.h"
 
 dungeon_grid letter[255];
 
index 4122203..08c1e03 100644 (file)
@@ -223,7 +223,6 @@ extern const char angband_term_name[8][16];
 extern byte angband_color_table[256][4];
 extern const concptr angband_sound_name[SOUND_MAX];
 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
-extern floor_type *current_floor_ptr;
 extern world_type *current_world_ptr;
 extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
 extern FLOOR_IDX max_floor_id;
index 2f4fc5c..dd903aa 100644 (file)
@@ -47,6 +47,7 @@
 #include "init.h"
 #include "monster-spell.h"
 #include "player-skill.h"
+#include "floor.h"
 
 
 /*
diff --git a/src/floor.c b/src/floor.c
new file mode 100644 (file)
index 0000000..cd3b7d0
--- /dev/null
@@ -0,0 +1,10 @@
+#include "angband.h"
+#include "floor.h"
+
+/*
+ * The array of "current_floor_ptr->grid_array grids" [MAX_WID][MAX_HGT].
+ * Not completely allocated, that would be inefficient
+ * Not completely hardcoded, that would overflow memory
+ */
+floor_type floor_info;
+floor_type *current_floor_ptr = &floor_info;
index 864a5cb..112560f 100644 (file)
@@ -1,4 +1,44 @@
-
+#pragma once
+
+typedef struct {
+       grid_type *grid_array[MAX_HGT];
+       DEPTH dun_level;                /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
+       DEPTH base_level;               /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
+       DEPTH object_level;             /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
+       DEPTH monster_level;    /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
+       POSITION width;                 /* Current dungeon width */
+       POSITION height;                /* Current dungeon height */
+       MONSTER_NUMBER num_repro; /*!< Current reproducer count */
+
+       GAME_TURN generated_turn; /* Turn when level began */
+
+       object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
+       OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
+
+       monster_type *m_list; /*!< The array of dungeon monsters [current_floor_ptr->max_m_idx] */
+       MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
+
+       s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
+       s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
+
+       POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
+       POSITION lite_y[LITE_MAX];
+       POSITION lite_x[LITE_MAX];
+
+       POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
+       POSITION mon_lite_y[MON_LITE_MAX];
+       POSITION mon_lite_x[MON_LITE_MAX];
+
+       POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array")
+       POSITION view_y[VIEW_MAX];
+       POSITION view_x[VIEW_MAX];
+
+       POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "current_floor_ptr->grid_array.c")
+       POSITION redraw_y[REDRAW_MAX];
+       POSITION redraw_x[REDRAW_MAX];
+
+} floor_type;
+
 #define DUNGEON_MODE_NONE       0
 #define DUNGEON_MODE_AND        1
 #define DUNGEON_MODE_NAND       2
 #define permanent_wall(F) \
        (have_flag((F)->flags, FF_WALL) && \
         have_flag((F)->flags, FF_PERMANENT))
+
+extern floor_type *current_floor_ptr;
\ No newline at end of file
index d814689..59cf6ea 100644 (file)
@@ -44,6 +44,7 @@
 #include "dungeon-file.h"
 #include "files.h"
 #include "feature.h"
+#include "floor.h"
 
 #ifndef MACINTOSH
 #ifdef CHECK_MODIFICATION_TIME
index d21c8d1..75a8278 100644 (file)
 #include "util.h"
 
 #include "view-mainwindow.h"
+#include "floor.h"
 #include "floor-events.h"
 #include "init.h"
 #include "files.h"
index 3f56104..63857a6 100644 (file)
@@ -4,6 +4,7 @@
 #include "monsterrace-hook.h"
 #include "monster.h"
 #include "monster-spell.h"
+#include "floor.h"
 
 /*! 通常pit生成時のモンスターの構成条件ID / Race index for "monster pit (clone)" */
 int vault_aux_race;
index d02daf6..a37302f 100644 (file)
@@ -26,6 +26,7 @@
 #include "spells.h"
 #include "cmd-basic.h"
 #include "files.h"
+#include "floor.h"
 
 /*!
  * @brief プレイヤーに突然変異を与える
index 8d6cb4a..41da7f5 100644 (file)
@@ -17,6 +17,7 @@
 #include "spells-summon.h"
 #include "spells-object.h"
 #include "spells-status.h"
+#include "floor.h"
 
 #ifdef JP
 /*!
index a19853a..12473a5 100644 (file)
@@ -15,6 +15,7 @@
 #include "angband.h"
 #include "util.h"
 
+#include "floor.h"
 #include "bldg.h"
 #include "birth.h"
 #include "grid.h"
index c574151..65fdc51 100644 (file)
@@ -5,6 +5,7 @@
 #include "spells.h"
 #include "player-status.h"
 #include "player-effects.h"
+#include "floor.h"
 
 /*!
 * @brief 生命領域魔法の各処理を行う
index 5634d24..fb2f524 100644 (file)
@@ -2,6 +2,7 @@
 #include "util.h"
 
 #include "grid.h"
+#include "floor.h"
 #include "floor-generate.h"
 #include "rooms.h"
 #include "rooms-city.h"
index 3e5fc63..80223ab 100644 (file)
@@ -18,6 +18,7 @@
 #include "quest.h"
 #include "store.h"
 #include "wild.h"
+#include "floor.h"
 #include "floor-events.h"
 #include "floor-save.h"
 #include "files.h"
index c9961cb..1832acd 100644 (file)
@@ -16,6 +16,7 @@
 #include "player-status.h"
 #include "files.h"
 #include "scores.h"
+#include "floor.h"
 
 /*!
  * @brief i番目のスコア情報にバッファ位置をシークする / Seek score 'i' in the highscore file
index 5de5a95..9105ecb 100644 (file)
@@ -1,5 +1,6 @@
 #include "angband.h"
 #include "sort.h"
+#include "floor.h"
 #include "quest.h"
 
 /*
index 6308034..e6031cc 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "spells-summon.h"
 #include "monster-status.h"
+#include "floor.h"
 
 /*!
 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells
index 445c98e..ee8b516 100644 (file)
@@ -2117,45 +2117,6 @@ typedef struct {
 } dragonbreath_type;
 
 typedef struct {
-       grid_type *grid_array[MAX_HGT];
-       DEPTH dun_level;                /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
-       DEPTH base_level;               /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
-       DEPTH object_level;             /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
-       DEPTH monster_level;    /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
-       POSITION width;                 /* Current dungeon width */
-       POSITION height;                /* Current dungeon height */
-       MONSTER_NUMBER num_repro; /*!< Current reproducer count */
-
-       GAME_TURN generated_turn; /* Turn when level began */
-
-       object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
-       OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
-
-       monster_type *m_list; /*!< The array of dungeon monsters [current_floor_ptr->max_m_idx] */
-       MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
-
-       s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
-       s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
-
-       POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
-       POSITION lite_y[LITE_MAX];
-       POSITION lite_x[LITE_MAX];
-
-       POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
-       POSITION mon_lite_y[MON_LITE_MAX];
-       POSITION mon_lite_x[MON_LITE_MAX];
-
-       POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array")
-       POSITION view_y[VIEW_MAX];
-       POSITION view_x[VIEW_MAX];
-
-       POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "current_floor_ptr->grid_array.c")
-       POSITION redraw_y[REDRAW_MAX];
-       POSITION redraw_x[REDRAW_MAX];
-
-} floor_type;
-
-typedef struct {
        POSITION max_wild_x; /*!< Maximum size of the wilderness */
        POSITION max_wild_y; /*!< Maximum size of the wilderness */
        GAME_TURN game_turn;                    /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
index 11f0a45..f681b3a 100644 (file)
@@ -15,6 +15,7 @@
 #include "monsterrace-hook.h"
 #include "view-mainwindow.h"
 #include "quest.h"
+#include "floor.h"
 
 
 static int num_more = 0;
index 8c90397..cff6ebf 100644 (file)
@@ -429,15 +429,6 @@ const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
        "ambush",
 };
 
-
-/*
- * The array of "current_floor_ptr->grid_array grids" [MAX_WID][MAX_HGT].
- * Not completely allocated, that would be inefficient
- * Not completely hardcoded, that would overflow memory
- */
-floor_type floor_info;
-floor_type *current_floor_ptr = &floor_info;
-
 /*
  * The array of saved floors
  */