OSDN Git Service

[Refactor] #40460 Separated parse-error-types.h and random-grid-effect-types.h from...
authorHourier <hourier@users.sourceforge.jp>
Sat, 6 Jun 2020 02:23:15 +0000 (11:23 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 6 Jun 2020 02:23:15 +0000 (11:23 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/dungeon/dungeon-file.c
src/dungeon/dungeon-file.h
src/floor/wild.c
src/info-reader/info-reader-util.h
src/info-reader/parse-error-types.h [new file with mode: 0644]
src/info-reader/random-grid-effect-types.h [new file with mode: 0644]
src/main/init.c
src/main/init.h

index 6fb1193..664076e 100644 (file)
     <ClInclude Include="..\..\src\info-reader\dungeon-info-tokens-table.h" />\r
     <ClInclude Include="..\..\src\info-reader\info-reader-util.h" />\r
     <ClInclude Include="..\..\src\info-reader\kind-info-tokens-table.h" />\r
+    <ClInclude Include="..\..\src\info-reader\parse-error-types.h" />\r
     <ClInclude Include="..\..\src\info-reader\race-info-tokens-table.h" />\r
+    <ClInclude Include="..\..\src\info-reader\random-grid-effect-types.h" />\r
     <ClInclude Include="..\..\src\player-attack\attack-chaos-effect.h" />\r
     <ClInclude Include="..\..\src\combat\attack-criticality.h" />\r
     <ClInclude Include="..\..\src\combat\attack-power-table.h" />\r
index d28b3cf..3166530 100644 (file)
     <ClInclude Include="..\..\src\info-reader\info-reader-util.h">
       <Filter>info-reader</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\info-reader\random-grid-effect-types.h">
+      <Filter>dungeon</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\info-reader\parse-error-types.h">
+      <Filter>info-reader</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 51cc58b..d2bf41a 100644 (file)
@@ -155,7 +155,9 @@ hengband_SOURCES = \
        info-reader/dungeon-info-tokens-table.c info-reader/dungeon-info-tokens-table.h \
        info-reader/info-reader-util.c info-reader/info-reader-util.h \
        info-reader/kind-info-tokens-table.c info-reader/kind-info-tokens-table.h \
+       info-reader/parse-error-types.h \
        info-reader/race-info-tokens-table.c info-reader/race-info-tokens-table.h \
+       info-reader/random-grid-effect-types.h \
        \
        inventory/inventory-curse.c inventory/inventory-curse.h \
        inventory/inventory-damage.c inventory/inventory-damage.h \
index 4b39b2d..708f339 100644 (file)
 #include "info-reader/info-reader-util.h"
 #include "info-reader/kind-info-tokens-table.h"
 #include "info-reader/race-info-tokens-table.h"
+#include "info-reader/random-grid-effect-types.h"
 #include "io/files-util.h"
 #include "io/tokenizer.h"
+#include "main/init.c" // f_headが依存している。後で何とかする.
 #include "monster/monster-race.h"
 #include "monster/monster.h"
 #include "object-enchant/apply-magic.h"
index d0db380..bccb36a 100644 (file)
@@ -1,25 +1,8 @@
 #pragma once
 
 #include "system/angband.h"
-#include "main/init.h" // 相互参照、後で何とかする.
-
-/* Random dungeon grid effects */
-#define RANDOM_NONE         0x00000000
-#define RANDOM_FEATURE      0x00000001
-#define RANDOM_MONSTER      0x00000002
-#define RANDOM_OBJECT       0x00000004
-#define RANDOM_EGO          0x00000008
-#define RANDOM_ARTIFACT     0x00000010
-#define RANDOM_TRAP         0x00000020
-
-#define PARSE_ERROR_GENERIC                  1
-#define PARSE_ERROR_INVALID_FLAG             5
-#define PARSE_ERROR_UNDEFINED_DIRECTIVE      6
-#define PARSE_ERROR_OUT_OF_MEMORY            7
-#define PARSE_ERROR_OUT_OF_BOUNDS            8
-#define PARSE_ERROR_TOO_FEW_ARGUMENTS        9
-#define PARSE_ERROR_UNDEFINED_TERRAIN_TAG   10
-#define PARSE_ERROR_MAX                     11
+#include "info-reader/info-reader-util.h"
+#include "info-reader/parse-error-types.h"
 
 extern concptr err_str[PARSE_ERROR_MAX];
 
index a161cfe..1e2f341 100644 (file)
@@ -17,6 +17,7 @@
 #include "floor/floor-town.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
+#include "info-reader/parse-error-types.h"
 #include "io/files-util.h"
 #include "io/tokenizer.h"
 #include "monster/monster-status.h"
index 55f7b19..eb5ff70 100644 (file)
@@ -40,6 +40,9 @@ struct angband_header {
     void (*retouch)(angband_header *head);
 };
 
+extern int error_idx;
+extern int error_line;
+
 bool add_text(u32b *offset, angband_header *head, concptr buf, bool normal_text);
 bool add_name(u32b *offset, angband_header *head, concptr buf);
 bool add_tag(STR_OFFSET *offset, angband_header *head, concptr buf);
diff --git a/src/info-reader/parse-error-types.h b/src/info-reader/parse-error-types.h
new file mode 100644 (file)
index 0000000..975097e
--- /dev/null
@@ -0,0 +1,15 @@
+#pragma once
+
+/*
+ * @details 2 - 4は使われなくなったので欠番
+ */
+typedef enum parse_error_type {
+       PARSE_ERROR_GENERIC = 1,
+    PARSE_ERROR_INVALID_FLAG = 5,
+    PARSE_ERROR_UNDEFINED_DIRECTIVE = 6,
+    PARSE_ERROR_OUT_OF_MEMORY = 7,
+    PARSE_ERROR_OUT_OF_BOUNDS = 8,
+    PARSE_ERROR_TOO_FEW_ARGUMENTS = 9,
+    PARSE_ERROR_UNDEFINED_TERRAIN_TAG = 10,
+    PARSE_ERROR_MAX = 11,
+} parse_error_type;
diff --git a/src/info-reader/random-grid-effect-types.h b/src/info-reader/random-grid-effect-types.h
new file mode 100644 (file)
index 0000000..dbfd2a9
--- /dev/null
@@ -0,0 +1,12 @@
+#pragma once
+
+/* Random dungeon grid effects */
+typedef enum rdge_type {
+       RANDOM_NONE = 0x00000000,
+    RANDOM_FEATURE = 0x00000001,
+    RANDOM_MONSTER = 0x00000002,
+    RANDOM_OBJECT = 0x00000004,
+    RANDOM_EGO = 0x00000008,
+    RANDOM_ARTIFACT = 0x00000010,
+    RANDOM_TRAP = 0x00000020,
+} rdge_type;
index b4da783..0649bb0 100644 (file)
@@ -39,6 +39,7 @@
 #include "floor/wild.h"
 #include "grid/feature.h"
 #include "grid/trap.h"
+#include "info-reader/parse-error-types.h"
 #include "io/files-util.h"
 #include "io/read-pref-file.h"
 #include "io/uid-checker.h"
index 24acd62..9fe4554 100644 (file)
@@ -16,9 +16,6 @@
 #include "system/angband.h"
 #include "info-reader/info-reader-util.h"
 
-extern int error_idx;
-extern int error_line;
-
 extern angband_header f_head;
 
 #endif /* INCLUDED_INIT_H */