OSDN Git Service

[Refactor] #39962 Separated player-status-dump.c from character-dump.c
authorHourier <hourier@users.sourceforge.jp>
Sat, 7 Mar 2020 12:33:00 +0000 (21:33 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 7 Mar 2020 12:33:00 +0000 (21:33 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/character-dump.c
src/io/player-status-dump.c [new file with mode: 0644]
src/io/player-status-dump.h [new file with mode: 0644]

index 3efd88b..e256c2c 100644 (file)
     <ClCompile Include="..\..\src\init.c" />\r
     <ClCompile Include="..\..\src\io\gf-descriptions.c" />\r
     <ClCompile Include="..\..\src\io\interpret-pref-file.c" />\r
+    <ClCompile Include="..\..\src\io\player-status-dump.c" />\r
     <ClCompile Include="..\..\src\io\read-pref-file.c" />\r
     <ClCompile Include="..\..\src\io\special-class-dump.c" />\r
     <ClCompile Include="..\..\src\io\tokenizer.c" />\r
     <ClInclude Include="..\..\src\horror-descriptions.h" />\r
     <ClInclude Include="..\..\src\io\gf-descriptions.h" />\r
     <ClInclude Include="..\..\src\io\interpret-pref-file.h" />\r
+    <ClInclude Include="..\..\src\io\player-status-dump.h" />\r
     <ClInclude Include="..\..\src\io\read-pref-file.h" />\r
     <ClInclude Include="..\..\src\io\special-class-dump.h" />\r
     <ClInclude Include="..\..\src\io\tokenizer.h" />\r
index 5fdf7e8..e17d8eb 100644 (file)
     <ClCompile Include="..\..\src\io\special-class-dump.c">
       <Filter>io</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\io\player-status-dump.c">
+      <Filter>io</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\io\special-class-dump.h">
       <Filter>io</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\io\player-status-dump.h">
+      <Filter>io</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 1d0472a..21d217f 100644 (file)
@@ -30,6 +30,7 @@ hengband_SOURCES = \
        io/gf-descriptions.c io/gf-descriptions.h \
        io/tokenizer.c io/tokenizer.h \
        io/interpret-pref-file.c io/interpret-pref-file.h \
+       io/player-status-dump.c io/player-status-dump.h \
        io/special-class-dump.c io/special-class-dump.h \
        io/read-pref-file.c io/read-pref-file.h \
        io/exit-panic.c io/exit-panic.h \
index 5d7ad11..6d28108 100644 (file)
 #include "object-flavor.h"
 #include "cmd/cmd-dump.h"
 #include "io/special-class-dump.h"
+#include "io/player-status-dump.h"
 #include "avatar.h"
 
 /*!
- * @brief プレイヤーのステータス表示をファイルにダンプする
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @param fff ファイルポインタ
- * @return なし
- */
-static void dump_aux_player_status(player_type *creature_ptr, FILE *fff, display_player_pf display_player, map_name_pf map_name)
-{
-       TERM_COLOR a;
-       char c;
-       char buf[1024];
-       display_player(creature_ptr, 0, map_name);
-
-       for (TERM_LEN y = 1; y < 22; y++)
-       {
-               TERM_LEN x;
-               for (x = 0; x < 79; x++)
-               {
-                       (void)(Term_what(x, y, &a, &c));
-                       buf[x] = c;
-               }
-
-               buf[x] = '\0';
-               while ((x > 0) && (buf[x - 1] == ' '))
-                       buf[--x] = '\0';
-
-               fprintf(fff, _("%s\n", "%s\n"), buf);
-       }
-
-       display_player(creature_ptr, 1, map_name);
-       for (TERM_LEN y = 10; y < 19; y++)
-       {
-               TERM_LEN x;
-               for (x = 0; x < 79; x++)
-               {
-                       (void)(Term_what(x, y, &a, &c));
-                       buf[x] = c;
-               }
-
-               buf[x] = '\0';
-               while ((x > 0) && (buf[x - 1] == ' '))
-                       buf[--x] = '\0';
-
-               fprintf(fff, "%s\n", buf);
-       }
-
-       fprintf(fff, "\n");
-       display_player(creature_ptr, 2, map_name);
-       for (TERM_LEN y = 2; y < 22; y++)
-       {
-               TERM_LEN x;
-               for (x = 0; x < 79; x++)
-               {
-                       (void)(Term_what(x, y, &a, &c));
-                       if (a < 128)
-                               buf[x] = c;
-                       else
-                               buf[x] = ' ';
-               }
-
-               buf[x] = '\0';
-               while ((x > 0) && (buf[x - 1] == ' '))
-                       buf[--x] = '\0';
-
-               fprintf(fff, "%s\n", buf);
-       }
-
-       fprintf(fff, "\n");
-       display_player(creature_ptr, 3, map_name);
-       for (TERM_LEN y = 1; y < 22; y++)
-       {
-               TERM_LEN x;
-               for (x = 0; x < 79; x++)
-               {
-                       (void)(Term_what(x, y, &a, &c));
-                       if (a < 128)
-                               buf[x] = c;
-                       else
-                               buf[x] = ' ';
-               }
-
-               buf[x] = '\0';
-               while ((x > 0) && (buf[x - 1] == ' '))
-                       buf[--x] = '\0';
-
-               fprintf(fff, "%s\n", buf);
-       }
-
-       fprintf(fff, "\n");
-}
-
-
-/*!
  * @brief プレイヤーのペット情報をファイルにダンプする
  * @param creature_ptr プレーヤーへの参照ポインタ
  * @param fff ファイルポインタ
diff --git a/src/io/player-status-dump.c b/src/io/player-status-dump.c
new file mode 100644 (file)
index 0000000..73e6c0d
--- /dev/null
@@ -0,0 +1,94 @@
+#include "angband.h"
+#include "files.h"
+#include "io/player-status-dump.h"
+
+/*!
+ * @brief プレイヤーのステータス表示をファイルにダンプする
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+void dump_aux_player_status(player_type *creature_ptr, FILE *fff, display_player_pf display_player, map_name_pf map_name)
+{
+       TERM_COLOR a;
+       char c;
+       char buf[1024];
+       display_player(creature_ptr, 0, map_name);
+
+       for (TERM_LEN y = 1; y < 22; y++)
+       {
+               TERM_LEN x;
+               for (x = 0; x < 79; x++)
+               {
+                       (void)(Term_what(x, y, &a, &c));
+                       buf[x] = c;
+               }
+
+               buf[x] = '\0';
+               while ((x > 0) && (buf[x - 1] == ' '))
+                       buf[--x] = '\0';
+
+               fprintf(fff, _("%s\n", "%s\n"), buf);
+       }
+
+       display_player(creature_ptr, 1, map_name);
+       for (TERM_LEN y = 10; y < 19; y++)
+       {
+               TERM_LEN x;
+               for (x = 0; x < 79; x++)
+               {
+                       (void)(Term_what(x, y, &a, &c));
+                       buf[x] = c;
+               }
+
+               buf[x] = '\0';
+               while ((x > 0) && (buf[x - 1] == ' '))
+                       buf[--x] = '\0';
+
+               fprintf(fff, "%s\n", buf);
+       }
+
+       fprintf(fff, "\n");
+       display_player(creature_ptr, 2, map_name);
+       for (TERM_LEN y = 2; y < 22; y++)
+       {
+               TERM_LEN x;
+               for (x = 0; x < 79; x++)
+               {
+                       (void)(Term_what(x, y, &a, &c));
+                       if (a < 128)
+                               buf[x] = c;
+                       else
+                               buf[x] = ' ';
+               }
+
+               buf[x] = '\0';
+               while ((x > 0) && (buf[x - 1] == ' '))
+                       buf[--x] = '\0';
+
+               fprintf(fff, "%s\n", buf);
+       }
+
+       fprintf(fff, "\n");
+       display_player(creature_ptr, 3, map_name);
+       for (TERM_LEN y = 1; y < 22; y++)
+       {
+               TERM_LEN x;
+               for (x = 0; x < 79; x++)
+               {
+                       (void)(Term_what(x, y, &a, &c));
+                       if (a < 128)
+                               buf[x] = c;
+                       else
+                               buf[x] = ' ';
+               }
+
+               buf[x] = '\0';
+               while ((x > 0) && (buf[x - 1] == ' '))
+                       buf[--x] = '\0';
+
+               fprintf(fff, "%s\n", buf);
+       }
+
+       fprintf(fff, "\n");
+}
diff --git a/src/io/player-status-dump.h b/src/io/player-status-dump.h
new file mode 100644 (file)
index 0000000..4d9de40
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+
+void dump_aux_player_status(player_type *creature_ptr, FILE *fff, display_player_pf display_player, map_name_pf map_name);