OSDN Git Service

[Refactor] #40624 Separated monster-lite-util.c/h from floor-events.c
authorHourier <hourier@users.sourceforge.jp>
Sun, 9 Aug 2020 04:13:00 +0000 (13:13 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 14 Aug 2020 14:34:20 +0000 (23:34 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/floor/floor-events.c
src/monster-floor/monster-lite-util.c [new file with mode: 0644]
src/monster-floor/monster-lite-util.h [new file with mode: 0644]

index 2543221..040f3a5 100644 (file)
     <ClCompile Include="..\..\src\mind\mind-monk.c" />\r
     <ClCompile Include="..\..\src\mind\mind-power-getter.c" />\r
     <ClCompile Include="..\..\src\mind\mind-weaponsmith.c" />\r
+    <ClCompile Include="..\..\src\monster-floor\monster-lite-util.c" />\r
     <ClCompile Include="..\..\src\mspell\element-resistance-checker.c" />\r
     <ClCompile Include="..\..\src\mspell\high-resistance-checker.c" />\r
     <ClCompile Include="..\..\src\mspell\improper-mspell-remover.c" />\r
     <ClInclude Include="..\..\src\mind\mind-power-getter.h" />\r
     <ClInclude Include="..\..\src\mind\mind-types.h" />\r
     <ClInclude Include="..\..\src\mind\mind-weaponsmith.h" />\r
+    <ClInclude Include="..\..\src\monster-floor\monster-lite-util.h" />\r
     <ClInclude Include="..\..\src\mspell\element-resistance-checker.h" />\r
     <ClInclude Include="..\..\src\mspell\high-resistance-checker.h" />\r
     <ClInclude Include="..\..\src\mspell\improper-mspell-remover.h" />\r
index c0eae42..82698b2 100644 (file)
     <ClCompile Include="..\..\src\action\throw-util.c">
       <Filter>action</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\monster-floor\monster-lite-util.c">
+      <Filter>monster-floor</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\combat\shoot.h">
     <ClInclude Include="..\..\src\action\throw-util.h">
       <Filter>action</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\monster-floor\monster-lite-util.h">
+      <Filter>monster-floor</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index a37d947..d289415 100644 (file)
@@ -461,6 +461,7 @@ hengband_SOURCES = \
        monster-floor/monster-safety-hiding.c monster-floor/monster-safety-hiding.h \
        monster-floor/monster-summon.c monster-floor/monster-summon.h \
        monster-floor/monster-sweep-grid.c monster-floor/monster-sweep-grid.h \
+       monster-floor/monster-lite-util.c monster-floor/monster-lite-util.h \
        monster-floor/one-monster-placer.c monster-floor/one-monster-placer.h \
        monster-floor/place-monster-types.h \
        monster-floor/quantum-effect.c monster-floor/quantum-effect.h \
index c458d41..726edca 100644 (file)
@@ -17,6 +17,7 @@
 #include "grid/grid.h"
 #include "main/sound-of-music.h"
 #include "mind/mind-ninja.h"
+#include "monster-floor/monster-lite-util.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags1.h"
 #include "monster-race/race-flags7.h"
 #include "view/display-messages.h"
 #include "world/world.h"
 
-typedef struct monster_lite_type {
-    bool mon_invis;
-    POSITION mon_fy, mon_fx;
-} monster_lite_type;
-
-monster_lite_type *initialize_monster_lite_type(floor_type *floor_ptr, monster_lite_type *ml_ptr, monster_type *m_ptr)
-{
-    ml_ptr->mon_fx = m_ptr->fx;
-    ml_ptr->mon_fy = m_ptr->fy;
-    ml_ptr->mon_invis = !(floor_ptr->grid_array[ml_ptr->mon_fy][ml_ptr->mon_fx].info & CAVE_VIEW);
-    return ml_ptr;
-}
-
 void day_break(player_type *subject_ptr)
 {
     msg_print(_("夜が明けた。", "The sun has risen."));
diff --git a/src/monster-floor/monster-lite-util.c b/src/monster-floor/monster-lite-util.c
new file mode 100644 (file)
index 0000000..d92b365
--- /dev/null
@@ -0,0 +1,12 @@
+#include "monster-floor/monster-lite-util.h"
+#include "grid/grid.h"
+#include "system/floor-type-definition.h"
+#include "system/monster-type-definition.h"
+
+monster_lite_type *initialize_monster_lite_type(floor_type *floor_ptr, monster_lite_type *ml_ptr, monster_type *m_ptr)
+{
+    ml_ptr->mon_fx = m_ptr->fx;
+    ml_ptr->mon_fy = m_ptr->fy;
+    ml_ptr->mon_invis = !(floor_ptr->grid_array[ml_ptr->mon_fy][ml_ptr->mon_fx].info & CAVE_VIEW);
+    return ml_ptr;
+}
diff --git a/src/monster-floor/monster-lite-util.h b/src/monster-floor/monster-lite-util.h
new file mode 100644 (file)
index 0000000..30bf950
--- /dev/null
@@ -0,0 +1,12 @@
+#pragma once
+
+#include "system/angband.h"
+
+typedef struct monster_lite_type {
+    bool mon_invis;
+    POSITION mon_fy;
+    POSITION mon_fx;
+} monster_lite_type;
+
+typedef struct monster_type monster_type;
+monster_lite_type *initialize_monster_lite_type(floor_type *floor_ptr, monster_lite_type *ml_ptr, monster_type *m_ptr);