OSDN Git Service

[Refactor] #40512 Separated wizard-messages.c/h from display-messages.c/h
authorHourier <hourier@users.sourceforge.jp>
Mon, 29 Jun 2020 10:51:36 +0000 (19:51 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 29 Jun 2020 10:51:36 +0000 (19:51 +0900)
22 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/cmd-action/cmd-attack.c
src/cmd/cmd-basic.c
src/combat/shoot.c
src/floor/floor-generate.c
src/floor/floor-object.c
src/floor/floor-streams.c
src/monster-floor/one-monster-placer.c
src/object-enchant/artifact.c
src/player-attack/player-attack.c
src/room/rooms-city.c
src/room/rooms-pit-nest.c
src/room/rooms-special.c
src/room/rooms-trap.c
src/room/rooms-vault.c
src/room/rooms.c
src/view/display-messages.c
src/view/display-messages.h
src/wizard/wizard-messages.c [new file with mode: 0644]
src/wizard/wizard-messages.h [new file with mode: 0644]

index d7fc342..c41672f 100644 (file)
     <ClCompile Include="..\..\src\object\warning.c" />\r
     <ClCompile Include="..\..\src\floor\wild.c" />\r
     <ClCompile Include="..\..\src\view\display-messages.c" />\r
+    <ClCompile Include="..\..\src\wizard\wizard-messages.c" />\r
     <ClCompile Include="..\..\src\wizard\wizard-spells.c" />\r
     <ClCompile Include="..\..\src\wizard\wizard-spoiler.c" />\r
     <ClCompile Include="..\..\src\wizard\wizard-special-process.c" />\r
     <ClInclude Include="..\..\src\view\object-describer.h" />\r
     <ClInclude Include="..\..\src\view\status-bars-table.h" />\r
     <ClInclude Include="..\..\src\wizard\spoiler-table.h" />\r
+    <ClInclude Include="..\..\src\wizard\wizard-messages.h" />\r
     <ClInclude Include="..\..\src\wizard\wizard-spells.h" />\r
     <ClInclude Include="..\..\src\world\world-object.h" />\r
     <ClInclude Include="..\..\src\locale\english.h" />\r
index cff5311..70bec8d 100644 (file)
     <ClCompile Include="..\..\src\status\bad-status-setter.c">
       <Filter>status</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\wizard\wizard-messages.c">
+      <Filter>wizard</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\status\bad-status-setter.h">
       <Filter>status</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\wizard\wizard-messages.h">
+      <Filter>wizard</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 1a1cd92..fba5f33 100644 (file)
@@ -631,6 +631,7 @@ hengband_SOURCES = \
        \
        wizard/spoiler-table.c wizard/spoiler-table.h \
        wizard/tval-descriptions-table.c wizard/tval-descriptions-table.h \
+       wizard/wizard-messages.c wizard/wizard-messages.h \
        wizard/wizard-spells.c wizard/wizard-spells.h \
        wizard/wizard-spoiler.c wizard/wizard-spoiler.h\
        wizard/wizard-special-process.c wizard/wizard-special-process.h \
index 2cb7586..22d762a 100644 (file)
@@ -33,6 +33,7 @@
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*!
  * @brief プレイヤーの変異要素による打撃処理
index c1e06ee..c4ae8de 100644 (file)
@@ -88,6 +88,7 @@
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
 #include "view/object-describer.h"
+#include "wizard/wizard-messages.h"
 #include "world/world.h"
 
 /*!
index 05a3876..f65137d 100644 (file)
@@ -49,6 +49,7 @@
 #include "sv-definition/sv-bow-types.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 #include "world/world-object.h"
 
 /*!
index f5ac388..295c687 100644 (file)
@@ -49,6 +49,7 @@
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
 #include "view/main-window-util.h"
+#include "wizard/wizard-messages.h"
 #include "world/world.h"
 
 int dun_tun_rnd; 
index 45965ec..1c2f329 100644 (file)
@@ -30,7 +30,7 @@
 #include "system/system-variables.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
-#include "view/object-describer.h"
+#include "wizard/wizard-messages.h"
 #include "world/world-object.h"
 #include "world/world.h"
 
index 9b6ef37..8150ec3 100644 (file)
@@ -31,6 +31,7 @@
 #include "spell-kind/spells-floor.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*!
  * @brief 再帰フラクタルアルゴリズムによりダンジョン内に川を配置する /
index c7ee354..2332c3a 100644 (file)
@@ -33,6 +33,7 @@
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 #include "world/world.h"
 
 static bool is_friendly_idx(player_type *player_ptr, MONSTER_IDX m_idx) { return m_idx > 0 && is_friendly(&player_ptr->current_floor_ptr->m_list[(m_idx)]); }
index dfbfa99..5b65659 100644 (file)
@@ -54,6 +54,7 @@
 #include "util/bit-flags-calculator.h"
 #include "util/quarks.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 #include "world/world.h"
 
  /*
index 0793c79..71544e2 100644 (file)
@@ -40,6 +40,7 @@
 #include "sv-definition/sv-weapon-types.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 #include "world/world.h"
 
 static player_attack_type *initialize_player_attack_type(
index b8c0d66..2b6f095 100644 (file)
@@ -9,7 +9,7 @@
 #include "store/store-util.h"
 #include "store/store.h"
 #include "util/bit-flags-calculator.h"
-#include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*
 * Precalculate buildings' location of underground arcade
index 50ede6e..9853d56 100644 (file)
@@ -23,6 +23,7 @@
 #include "rooms.h"
 #include "util/sort.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*!
 * @brief ダンジョン毎に指定されたピット配列を基準にランダムなpit/nestタイプを決める
index 170d612..b6528ea 100644 (file)
@@ -14,7 +14,7 @@
 #include "object/object-kind-hook.h"
 #include "room/rooms.h"
 #include "system/system-variables.h"
-#include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*!
 * @brief タイプ15の部屋…ガラス部屋の生成 / Type 15 -- glass rooms
index ae7dd42..143df26 100644 (file)
@@ -5,7 +5,7 @@
 #include "grid/feature.h"
 #include "grid/grid.h"
 #include "room/rooms.h"
-#include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*!
 * @brief タイプ14の部屋…特殊トラップ部屋の生成 / Type 14 -- trapped rooms
index 2dc57b3..d914cd5 100644 (file)
@@ -20,7 +20,7 @@
 #include "room/rooms.h"
 #include "store/store-util.h"
 #include "store/store.h"
-#include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
 /*
  * The vault generation arrays
index 3780228..6f45073 100644 (file)
@@ -57,6 +57,7 @@
 #include "room/rooms-vault.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
+#include "wizard/wizard-messages.h"
 
  /*!
   * 各部屋タイプの生成比定義
index 1466de3..36ee4c1 100644 (file)
@@ -1,13 +1,10 @@
 #include "view/display-messages.h"
 #include "core/output-updater.h"
-#include "game-option/cheat-options.h"
-#include "game-option/cheat-types.h"
 #include "game-option/input-options.h"
 #include "game-option/map-screen-options.h"
 #include "game-option/option-flags.h"
 #include "io/input-key-acceptor.h"
 #include "io/input-key-processor.h"
-#include "io/write-diary.h"
 #include "main/sound-of-music.h"
 #include "term/gameterm.h"
 #include "term/term-color-types.h"
@@ -425,27 +422,6 @@ void msg_print(concptr msg)
         Term_fresh();
 }
 
-void msg_print_wizard(int cheat_type, concptr msg)
-{
-    if (!cheat_room && cheat_type == CHEAT_DUNGEON)
-        return;
-    if (!cheat_peek && cheat_type == CHEAT_OBJECT)
-        return;
-    if (!cheat_hear && cheat_type == CHEAT_MONSTER)
-        return;
-    if (!cheat_xtra && cheat_type == CHEAT_MISC)
-        return;
-
-    concptr cheat_mes[] = { "ITEM", "MONS", "DUNG", "MISC" };
-    char buf[1024];
-    sprintf(buf, "WIZ-%s:%s", cheat_mes[cheat_type], msg);
-    msg_print(buf);
-
-    if (cheat_diary_output) {
-        exe_write_diary(p_ptr, DIARY_WIZARD_LOG, 0, buf);
-    }
-}
-
 /*
  * Display a formatted message, using "vstrnfmt()" and "msg_print()".
  */
@@ -458,25 +434,3 @@ void msg_format(concptr fmt, ...)
     va_end(vp);
     msg_print(buf);
 }
-
-/*
- * Display a formatted message, using "vstrnfmt()" and "msg_print()".
- */
-void msg_format_wizard(int cheat_type, concptr fmt, ...)
-{
-    if (!cheat_room && cheat_type == CHEAT_DUNGEON)
-        return;
-    if (!cheat_peek && cheat_type == CHEAT_OBJECT)
-        return;
-    if (!cheat_hear && cheat_type == CHEAT_MONSTER)
-        return;
-    if (!cheat_xtra && cheat_type == CHEAT_MISC)
-        return;
-
-    va_list vp;
-    char buf[1024];
-    va_start(vp, fmt);
-    (void)vstrnfmt(buf, 1024, fmt, vp);
-    va_end(vp);
-    msg_print_wizard(cheat_type, buf);
-}
index fb99ee6..d2e7321 100644 (file)
@@ -29,9 +29,4 @@ concptr message_str(int age);
 void message_add(concptr msg);
 void msg_erase(void);
 void msg_print(concptr msg);
-void msg_print_wizard(int cheat_type, concptr msg);
-
-#ifndef SWIG
 void msg_format(concptr fmt, ...);
-void msg_format_wizard(int cheat_type, concptr fmt, ...);
-#endif
diff --git a/src/wizard/wizard-messages.c b/src/wizard/wizard-messages.c
new file mode 100644 (file)
index 0000000..bee7600
--- /dev/null
@@ -0,0 +1,48 @@
+#include "wizard/wizard-messages.h"
+#include "game-option/cheat-options.h"
+#include "game-option/cheat-types.h"
+#include "io/write-diary.h"
+#include "view/display-messages.h"
+
+void msg_print_wizard(int cheat_type, concptr msg)
+{
+    if (!cheat_room && cheat_type == CHEAT_DUNGEON)
+        return;
+    if (!cheat_peek && cheat_type == CHEAT_OBJECT)
+        return;
+    if (!cheat_hear && cheat_type == CHEAT_MONSTER)
+        return;
+    if (!cheat_xtra && cheat_type == CHEAT_MISC)
+        return;
+
+    concptr cheat_mes[] = { "ITEM", "MONS", "DUNG", "MISC" };
+    char buf[1024];
+    sprintf(buf, "WIZ-%s:%s", cheat_mes[cheat_type], msg);
+    msg_print(buf);
+
+    if (cheat_diary_output) {
+        exe_write_diary(p_ptr, DIARY_WIZARD_LOG, 0, buf);
+    }
+}
+
+/*
+ * Display a formatted message, using "vstrnfmt()" and "msg_print()".
+ */
+void msg_format_wizard(int cheat_type, concptr fmt, ...)
+{
+    if (!cheat_room && cheat_type == CHEAT_DUNGEON)
+        return;
+    if (!cheat_peek && cheat_type == CHEAT_OBJECT)
+        return;
+    if (!cheat_hear && cheat_type == CHEAT_MONSTER)
+        return;
+    if (!cheat_xtra && cheat_type == CHEAT_MISC)
+        return;
+
+    va_list vp;
+    char buf[1024];
+    va_start(vp, fmt);
+    (void)vstrnfmt(buf, 1024, fmt, vp);
+    va_end(vp);
+    msg_print_wizard(cheat_type, buf);
+}
diff --git a/src/wizard/wizard-messages.h b/src/wizard/wizard-messages.h
new file mode 100644 (file)
index 0000000..1ef8e86
--- /dev/null
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "system/angband.h"
+
+void msg_print_wizard(int cheat_type, concptr msg);
+void msg_format_wizard(int cheat_type, concptr fmt, ...);