OSDN Git Service

[Refactor] #37353 alloc_entry 構造体定義を util.h に移動して関連変数を整理.
authordeskull <deskull@users.sourceforge.jp>
Thu, 2 May 2019 10:35:42 +0000 (19:35 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 2 May 2019 11:19:25 +0000 (20:19 +0900)
src/externs.h
src/monsterrace.c
src/monsterrace.h
src/objectkind.c
src/objectkind.h
src/types.h
src/util.h
src/variable.c

index d746684..45c66ee 100644 (file)
@@ -211,10 +211,6 @@ extern const concptr angband_sound_name[SOUND_MAX];
 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
 extern FLOOR_IDX max_floor_id;
 extern u32b saved_floor_file_sign;
-extern s16b alloc_kind_size;
-extern alloc_entry *alloc_kind_table;
-extern s16b alloc_race_size;
-extern alloc_entry *alloc_race_table;
 extern TERM_COLOR misc_to_attr[256];
 extern SYMBOL_CODE misc_to_char[256];
 extern TERM_COLOR tval_to_attr[128];
index 4bdc276..4a5c177 100644 (file)
@@ -1,6 +1,18 @@
 #include "angband.h"
 #include "monsterrace.h"
+#include "util.h"
 
 extern monster_race *r_info;
 extern char *r_name;
 extern char *r_text;
+
+/*
+ * The size of "alloc_race_table" (at most max_r_idx)
+ */
+s16b alloc_race_size;
+
+/*
+ * The entries in the "race allocator table"
+ */
+alloc_entry *alloc_race_table;
+
index dcaff89..feb543b 100644 (file)
@@ -1,4 +1,5 @@
 #pragma once
+#include "util.h"
 
 /*
  * Monster blow structure
@@ -443,4 +444,7 @@ struct monster_race
  */
 monster_race *r_info;
 char *r_name;
-char *r_text;
\ No newline at end of file
+char *r_text;
+
+extern s16b alloc_race_size;
+extern alloc_entry *alloc_race_table;
index e895d59..fdc7541 100644 (file)
@@ -1,4 +1,5 @@
 #include "angband.h"
+#include "util.h"
 #include "objectkind.h"
 
 /*
@@ -7,3 +8,14 @@
 object_kind *k_info;
 char *k_name;
 char *k_text;
+
+/*
+ * The size of "alloc_kind_table" (at most max_k_idx * 4)
+ */
+s16b alloc_kind_size;
+
+/*
+ * The entries in the "kind allocator table"
+ */
+alloc_entry *alloc_kind_table;
+
index 89a2d66..f6c4a82 100644 (file)
@@ -1,4 +1,5 @@
 #pragma once
+#include "util.h"
 
 /*!
  * @struct object_kind
@@ -63,4 +64,7 @@ struct object_kind
 
 extern object_kind *k_info;
 extern char *k_name;
-extern char *k_text;
\ No newline at end of file
+extern char *k_text;
+
+extern s16b alloc_kind_size;
+extern alloc_entry *alloc_kind_table;
index 3b6a145..a29e45d 100644 (file)
@@ -63,30 +63,6 @@ struct mbe_info_type
 
 
 /*
- * An entry for the object/monster allocation functions
- *
- * Pass 1 is determined from allocation information
- * Pass 2 is determined from allocation restriction
- * Pass 3 is determined from allocation calculation
- */
-
-typedef struct alloc_entry alloc_entry;
-
-struct alloc_entry
-{
-       KIND_OBJECT_IDX index;          /* The actual index */
-
-       DEPTH level;            /* Base dungeon level */
-       PROB prob1;             /* Probability, pass 1 */
-       PROB prob2;             /* Probability, pass 2 */
-       PROB prob3;             /* Probability, pass 3 */
-
-       u16b total;             /* Unused for now */
-};
-
-
-
-/*
  * A store, with an owner, various state flags, a current stock
  * of items, and a table of items that are often purchased.
  */
index 7038576..417e6b9 100644 (file)
@@ -11,6 +11,28 @@ struct tag_type
        int index;
 };
 
+/*
+ * An entry for the object/monster allocation functions
+ *
+ * Pass 1 is determined from allocation information
+ * Pass 2 is determined from allocation restriction
+ * Pass 3 is determined from allocation calculation
+ */
+
+typedef struct alloc_entry alloc_entry;
+
+struct alloc_entry
+{
+       KIND_OBJECT_IDX index;          /* The actual index */
+
+       DEPTH level;            /* Base dungeon level */
+       PROB prob1;             /* Probability, pass 1 */
+       PROB prob2;             /* Probability, pass 2 */
+       PROB prob3;             /* Probability, pass 3 */
+
+       u16b total;             /* Unused for now */
+};
+
 /* util.c */
 extern errr path_parse(char *buf, int max, concptr file);
 extern errr path_build(char *buf, int max, concptr path, concptr file);
index 66531ec..5d01030 100644 (file)
@@ -413,28 +413,6 @@ FLOOR_IDX max_floor_id;
 u32b saved_floor_file_sign;
 
 /*
- * The size of "alloc_kind_table" (at most max_k_idx * 4)
- */
-s16b alloc_kind_size;
-
-/*
- * The entries in the "kind allocator table"
- */
-alloc_entry *alloc_kind_table;
-
-
-/*
- * The size of "alloc_race_table" (at most max_r_idx)
- */
-s16b alloc_race_size;
-
-/*
- * The entries in the "race allocator table"
- */
-alloc_entry *alloc_race_table;
-
-
-/*
  * Specify attr/char pairs for visual special effects
  * Be sure to use "index & 0x7F" to avoid illegal access
  */