変愚蛮怒のメインリポジトリです
修订版 | dd14461d9d396d79e1553cae6db99f0df42bcf2b (tree) |
---|---|
时间 | 2020-02-01 13:42:15 |
作者 | Hourier <hourier@user...> |
Commiter | Hourier |
[Refactor] #37353 dungeon-file.c のヘッダー重複除去と、一部のコメント削除 / Removed duplication of including headers and some comments per line
@@ -1,32 +1,4 @@ | ||
1 | - | |
2 | -#include "angband.h" | |
3 | -#include "util.h" | |
4 | -#include "core.h" | |
5 | - | |
6 | -#include "files.h" | |
7 | -#include "dungeon-file.h" | |
8 | -#include "rooms-vault.h" | |
9 | -#include "feature.h" | |
10 | -#include "grid.h" | |
11 | -#include "quest.h" | |
12 | -#include "monster.h" | |
13 | -#include "files.h" | |
14 | -#include "player-skill.h" | |
15 | -#include "player-race.h" | |
16 | -#include "dungeon.h" | |
17 | -#include "floor.h" | |
18 | -#include "bldg.h" | |
19 | -#include "world.h" | |
20 | -#include "rooms-vault.h" | |
21 | -#include "objectkind.h" | |
22 | -#include "object-ego.h" | |
23 | -#include "monsterrace.h" | |
24 | -#include "floor-town.h" | |
25 | -#include "realm.h" | |
26 | - | |
27 | -dungeon_grid letter[255]; | |
28 | - | |
29 | -/*! | |
1 | +/*! | |
30 | 2 | * @file init1.c |
31 | 3 | * @brief ゲームデータ初期化1 / Initialization (part 1) -BEN- |
32 | 4 | * @date 2014/01/28 |
@@ -60,20 +32,42 @@ dungeon_grid letter[255]; | ||
60 | 32 | */ |
61 | 33 | |
62 | 34 | #include "angband.h" |
35 | +#include "util.h" | |
36 | +#include "core.h" | |
37 | + | |
38 | +#include "files.h" | |
63 | 39 | #include "dungeon-file.h" |
64 | -#include "trap.h" | |
40 | +#include "rooms-vault.h" | |
41 | +#include "feature.h" | |
65 | 42 | #include "grid.h" |
43 | +#include "quest.h" | |
66 | 44 | #include "monster.h" |
45 | +#include "files.h" | |
46 | +#include "player-skill.h" | |
47 | +#include "player-race.h" | |
48 | +#include "dungeon.h" | |
49 | +#include "floor.h" | |
50 | +#include "bldg.h" | |
51 | +#include "world.h" | |
52 | +#include "rooms-vault.h" | |
53 | +#include "objectkind.h" | |
54 | +#include "object-ego.h" | |
55 | +#include "monsterrace.h" | |
56 | +#include "floor-town.h" | |
57 | +#include "realm.h" | |
58 | + | |
59 | +#include "trap.h" | |
67 | 60 | #include "artifact.h" |
68 | 61 | #include "cmd-activate.h" |
69 | 62 | #include "term.h" |
70 | 63 | #include "wild.h" |
71 | -#include "quest.h" | |
72 | 64 | #include "view-mainwindow.h" |
73 | 65 | #include "player-class.h" |
74 | 66 | |
75 | 67 | #include "init.h" |
76 | 68 | |
69 | +dungeon_grid letter[255]; | |
70 | + | |
77 | 71 | /*** Helper arrays for parsing ascii template files ***/ |
78 | 72 | |
79 | 73 | /*! |
@@ -926,18 +920,13 @@ static concptr d_info_flags1[] = | ||
926 | 920 | */ |
927 | 921 | static bool add_text(u32b *offset, header *head, concptr buf, bool normal_text) |
928 | 922 | { |
929 | - /* Hack -- Verify space */ | |
930 | 923 | if (head->text_size + strlen(buf) + 8 > FAKE_TEXT_SIZE) |
931 | 924 | return FALSE; |
932 | 925 | |
933 | - /* New text? */ | |
934 | 926 | if (*offset == 0) |
935 | 927 | { |
936 | - /* Advance and save the text index */ | |
937 | 928 | *offset = ++head->text_size; |
938 | 929 | } |
939 | - | |
940 | - /* Additional text */ | |
941 | 930 | else if (normal_text) |
942 | 931 | { |
943 | 932 | /* |
@@ -956,10 +945,7 @@ static bool add_text(u32b *offset, header *head, concptr buf, bool normal_text) | ||
956 | 945 | #endif |
957 | 946 | ) |
958 | 947 | { |
959 | - /* Append a space */ | |
960 | 948 | *(head->text_ptr + head->text_size) = ' '; |
961 | - | |
962 | - /* Advance the index */ | |
963 | 949 | head->text_size++; |
964 | 950 | } |
965 | 951 | } |
@@ -983,24 +969,16 @@ static bool add_text(u32b *offset, header *head, concptr buf, bool normal_text) | ||
983 | 969 | */ |
984 | 970 | static bool add_name(u32b *offset, header *head, concptr buf) |
985 | 971 | { |
986 | - /* Hack -- Verify space */ | |
987 | 972 | if (head->name_size + strlen(buf) + 8 > FAKE_NAME_SIZE) |
988 | 973 | return FALSE; |
989 | 974 | |
990 | - /* New name? */ | |
991 | 975 | if (*offset == 0) |
992 | 976 | { |
993 | - /* Advance and save the name index */ | |
994 | 977 | *offset = ++head->name_size; |
995 | 978 | } |
996 | 979 | |
997 | - /* Append chars to the names */ | |
998 | 980 | strcpy(head->name_ptr + head->name_size, buf); |
999 | - | |
1000 | - /* Advance the index */ | |
1001 | 981 | head->name_size += strlen(buf); |
1002 | - | |
1003 | - /* Success */ | |
1004 | 982 | return TRUE; |
1005 | 983 | } |
1006 | 984 |