• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision6b9b216843c7306c8ad76ab6589109ddb0dbac01 (tree)
Time2019-05-03 15:10:53
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 core.h を作成してANGBAND_*定数を移動.

Change Summary

Incremental Difference

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -298,6 +298,7 @@
298298 <ClInclude Include="..\..\src\cmd-quaff.h" />
299299 <ClInclude Include="..\..\src\cmd-read.h" />
300300 <ClInclude Include="..\..\src\cmd-usestaff.h" />
301+ <ClInclude Include="..\..\src\core.h" />
301302 <ClInclude Include="..\..\src\defines.h" />
302303 <ClInclude Include="..\..\src\dungeon-file.h" />
303304 <ClInclude Include="..\..\src\dungeon.h" />
--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
@@ -658,6 +658,7 @@
658658 <ClInclude Include="..\..\src\cmd-dump.h">
659659 <Filter>cmd</Filter>
660660 </ClInclude>
661+ <ClInclude Include="..\..\src\core.h" />
661662 </ItemGroup>
662663 <ItemGroup>
663664 <ResourceCompile Include="..\..\src\angband.rc" />
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,7 +19,7 @@ hengband_SOURCES = \
1919 cmd-usestaff.c cmd-usestaff.h cmd-zaprod.c cmd-zaprod.h cmd-zapwand.c \
2020 cmd-zapwand.h cmd-smith.c cmd-smith.h cmd-hissatsu.c cmd-hissatsu.h\
2121 \
22- core.c defines.h externs.h files.c files.h \
22+ core.c core.h defines.h externs.h files.c files.h \
2323 \
2424 dungeon.c dungeon.h \
2525 floor.c floor.h floor-events.c floor-events.h floor-generate.c floor-generate.h \
--- a/src/chuukei.c
+++ b/src/chuukei.c
@@ -8,6 +8,7 @@
88
99 #include "angband.h"
1010
11+#include "files.h"
1112 #include "util.h"
1213 #include "cmd-dump.h"
1314
--- a/src/core.c
+++ b/src/core.c
@@ -75,6 +75,16 @@
7575 #include "scores.h"
7676 #include "autopick.h"
7777
78+concptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
79+
80+#ifdef JP
81+concptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
82+#else
83+concptr ANGBAND_KEYBOARD = "0";
84+#endif
85+
86+concptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
87+
7888 static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
7989 static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
8090
--- /dev/null
+++ b/src/core.h
@@ -0,0 +1,5 @@
1+#pragma once
2+
3+extern concptr ANGBAND_SYS;
4+extern concptr ANGBAND_KEYBOARD;
5+extern concptr ANGBAND_GRAF;
--- a/src/dungeon-file.c
+++ b/src/dungeon-file.c
@@ -1,7 +1,9 @@
11 
22 #include "angband.h"
33 #include "util.h"
4+#include "core.h"
45
6+#include "files.h"
57 #include "dungeon-file.h"
68 #include "feature.h"
79 #include "grid.h"
--- a/src/externs.h
+++ b/src/externs.h
@@ -211,22 +211,6 @@ extern player_type *p_ptr;
211211 extern char *f_name;
212212 extern char *f_tag;
213213
214-extern concptr ANGBAND_SYS;
215-extern concptr ANGBAND_KEYBOARD;
216-extern concptr ANGBAND_GRAF;
217-extern concptr ANGBAND_DIR;
218-extern concptr ANGBAND_DIR_APEX;
219-extern concptr ANGBAND_DIR_BONE;
220-extern concptr ANGBAND_DIR_DATA;
221-extern concptr ANGBAND_DIR_EDIT;
222-extern concptr ANGBAND_DIR_SCRIPT;
223-extern concptr ANGBAND_DIR_FILE;
224-extern concptr ANGBAND_DIR_HELP;
225-extern concptr ANGBAND_DIR_INFO;
226-extern concptr ANGBAND_DIR_PREF;
227-extern concptr ANGBAND_DIR_SAVE;
228-extern concptr ANGBAND_DIR_USER;
229-extern concptr ANGBAND_DIR_XTRA;
230214 extern OBJECT_TYPE_VALUE item_tester_tval;
231215 extern bool (*item_tester_hook)(object_type *o_ptr);
232216 extern monsterrace_hook_type get_mon_num_hook;
--- a/src/files.c
+++ b/src/files.c
@@ -15,6 +15,8 @@
1515
1616 #include "angband.h"
1717 #include "util.h"
18+#include "files.h"
19+#include "core.h"
1820
1921 #include "birth.h"
2022 #include "files.h"
@@ -60,6 +62,19 @@
6062 #include "objectkind.h"
6163 #include "autopick.h"
6264
65+concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
66+concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
67+concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
68+concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
69+concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
70+concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
71+concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
72+concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
73+concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
74+concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
75+concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary)
76+concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms
77+concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
6378
6479 /*
6580 * You may or may not want to use the following "#undef".
--- a/src/files.h
+++ b/src/files.h
@@ -1,5 +1,19 @@
11 #pragma once
22
3+extern concptr ANGBAND_DIR;
4+extern concptr ANGBAND_DIR_APEX;
5+extern concptr ANGBAND_DIR_BONE;
6+extern concptr ANGBAND_DIR_DATA;
7+extern concptr ANGBAND_DIR_EDIT;
8+extern concptr ANGBAND_DIR_SCRIPT;
9+extern concptr ANGBAND_DIR_FILE;
10+extern concptr ANGBAND_DIR_HELP;
11+extern concptr ANGBAND_DIR_INFO;
12+extern concptr ANGBAND_DIR_PREF;
13+extern concptr ANGBAND_DIR_SAVE;
14+extern concptr ANGBAND_DIR_USER;
15+extern concptr ANGBAND_DIR_XTRA;
16+
317 /* files.c */
418 extern void safe_setuid_drop(void);
519 extern void safe_setuid_grab(void);
--- a/src/inet.c
+++ b/src/inet.c
@@ -2,6 +2,7 @@
22
33 #include "angband.h"
44 #include "util.h"
5+#include "files.h"
56
67
78 #ifdef WORLD_SCORE
--- a/src/init.c
+++ b/src/init.c
@@ -34,6 +34,8 @@
3434
3535 #include "angband.h"
3636 #include "util.h"
37+#include "files.h"
38+#include "core.h"
3739
3840 #include "artifact.h"
3941 #include "bldg.h"
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -108,6 +108,8 @@
108108 #include "files.h"
109109 #include "scores.h"
110110 #include "quest.h"
111+#include "files.h"
112+#include "core.h"
111113
112114 #ifdef WINDOWS
113115 #include <windows.h>
--- a/src/term.c
+++ b/src/term.c
@@ -3,6 +3,7 @@
33
44 #include "term.h"
55 #include "spells.h"
6+#include "core.h"
67
78 /*
89 * Default spell color table (quark index)
--- a/src/variable.c
+++ b/src/variable.c
@@ -448,32 +448,6 @@ player_type p_body;
448448 player_type *p_ptr = &p_body;
449449
450450
451-
452-concptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
453-
454-
455-#ifdef JP
456-concptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
457-#else
458-concptr ANGBAND_KEYBOARD = "0";
459-#endif
460-
461-concptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
462-concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
463-concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
464-concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
465-concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
466-concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
467-concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
468-concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
469-concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
470-concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
471-concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
472-concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary)
473-concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms
474-concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
475-
476-
477451 /*
478452 * Here is a "pseudo-hook" used during calls to "get_item()" and
479453 * "show_inven()" and "show_equip()", and the choice window routines.
--- a/src/wizard1.c
+++ b/src/wizard1.c
@@ -21,6 +21,7 @@
2121 #include "object-hook.h"
2222 #include "objectkind.h"
2323 #include "floor-town.h"
24+#include "files.h"
2425
2526
2627 #ifdef ALLOW_SPOILERS
Show on old repository browser