• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision4b34a5c9681be29ad63b78401592af8d30777d2c (tree)
Time2019-05-02 20:19:25
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 alloc_entry 構造体定義を util.h に移動して関連変数を整理.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -211,10 +211,6 @@ extern const concptr angband_sound_name[SOUND_MAX];
211211 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
212212 extern FLOOR_IDX max_floor_id;
213213 extern u32b saved_floor_file_sign;
214-extern s16b alloc_kind_size;
215-extern alloc_entry *alloc_kind_table;
216-extern s16b alloc_race_size;
217-extern alloc_entry *alloc_race_table;
218214 extern TERM_COLOR misc_to_attr[256];
219215 extern SYMBOL_CODE misc_to_char[256];
220216 extern TERM_COLOR tval_to_attr[128];
--- a/src/monsterrace.c
+++ b/src/monsterrace.c
@@ -1,6 +1,18 @@
11 #include "angband.h"
22 #include "monsterrace.h"
3+#include "util.h"
34
45 extern monster_race *r_info;
56 extern char *r_name;
67 extern char *r_text;
8+
9+/*
10+ * The size of "alloc_race_table" (at most max_r_idx)
11+ */
12+s16b alloc_race_size;
13+
14+/*
15+ * The entries in the "race allocator table"
16+ */
17+alloc_entry *alloc_race_table;
18+
--- a/src/monsterrace.h
+++ b/src/monsterrace.h
@@ -1,4 +1,5 @@
11 #pragma once
2+#include "util.h"
23
34 /*
45 * Monster blow structure
@@ -443,4 +444,7 @@ struct monster_race
443444 */
444445 monster_race *r_info;
445446 char *r_name;
446-char *r_text;
\ No newline at end of file
447+char *r_text;
448+
449+extern s16b alloc_race_size;
450+extern alloc_entry *alloc_race_table;
--- a/src/objectkind.c
+++ b/src/objectkind.c
@@ -1,4 +1,5 @@
11 #include "angband.h"
2+#include "util.h"
23 #include "objectkind.h"
34
45 /*
@@ -7,3 +8,14 @@
78 object_kind *k_info;
89 char *k_name;
910 char *k_text;
11+
12+/*
13+ * The size of "alloc_kind_table" (at most max_k_idx * 4)
14+ */
15+s16b alloc_kind_size;
16+
17+/*
18+ * The entries in the "kind allocator table"
19+ */
20+alloc_entry *alloc_kind_table;
21+
--- a/src/objectkind.h
+++ b/src/objectkind.h
@@ -1,4 +1,5 @@
11 #pragma once
2+#include "util.h"
23
34 /*!
45 * @struct object_kind
@@ -63,4 +64,7 @@ struct object_kind
6364
6465 extern object_kind *k_info;
6566 extern char *k_name;
66-extern char *k_text;
\ No newline at end of file
67+extern char *k_text;
68+
69+extern s16b alloc_kind_size;
70+extern alloc_entry *alloc_kind_table;
--- a/src/types.h
+++ b/src/types.h
@@ -63,30 +63,6 @@ struct mbe_info_type
6363
6464
6565 /*
66- * An entry for the object/monster allocation functions
67- *
68- * Pass 1 is determined from allocation information
69- * Pass 2 is determined from allocation restriction
70- * Pass 3 is determined from allocation calculation
71- */
72-
73-typedef struct alloc_entry alloc_entry;
74-
75-struct alloc_entry
76-{
77- KIND_OBJECT_IDX index; /* The actual index */
78-
79- DEPTH level; /* Base dungeon level */
80- PROB prob1; /* Probability, pass 1 */
81- PROB prob2; /* Probability, pass 2 */
82- PROB prob3; /* Probability, pass 3 */
83-
84- u16b total; /* Unused for now */
85-};
86-
87-
88-
89-/*
9066 * A store, with an owner, various state flags, a current stock
9167 * of items, and a table of items that are often purchased.
9268 */
--- a/src/util.h
+++ b/src/util.h
@@ -11,6 +11,28 @@ struct tag_type
1111 int index;
1212 };
1313
14+/*
15+ * An entry for the object/monster allocation functions
16+ *
17+ * Pass 1 is determined from allocation information
18+ * Pass 2 is determined from allocation restriction
19+ * Pass 3 is determined from allocation calculation
20+ */
21+
22+typedef struct alloc_entry alloc_entry;
23+
24+struct alloc_entry
25+{
26+ KIND_OBJECT_IDX index; /* The actual index */
27+
28+ DEPTH level; /* Base dungeon level */
29+ PROB prob1; /* Probability, pass 1 */
30+ PROB prob2; /* Probability, pass 2 */
31+ PROB prob3; /* Probability, pass 3 */
32+
33+ u16b total; /* Unused for now */
34+};
35+
1436 /* util.c */
1537 extern errr path_parse(char *buf, int max, concptr file);
1638 extern errr path_build(char *buf, int max, concptr path, concptr file);
--- a/src/variable.c
+++ b/src/variable.c
@@ -413,28 +413,6 @@ FLOOR_IDX max_floor_id;
413413 u32b saved_floor_file_sign;
414414
415415 /*
416- * The size of "alloc_kind_table" (at most max_k_idx * 4)
417- */
418-s16b alloc_kind_size;
419-
420-/*
421- * The entries in the "kind allocator table"
422- */
423-alloc_entry *alloc_kind_table;
424-
425-
426-/*
427- * The size of "alloc_race_table" (at most max_r_idx)
428- */
429-s16b alloc_race_size;
430-
431-/*
432- * The entries in the "race allocator table"
433- */
434-alloc_entry *alloc_race_table;
435-
436-
437-/*
438416 * Specify attr/char pairs for visual special effects
439417 * Be sure to use "index & 0x7F" to avoid illegal access
440418 */
Show on old repository browser