OSDN Git Service

[Refactor] #40274 Unified angband_sound_name[] into main/sound-definitions-table.c/h
authorHourier <hourier@users.sourceforge.jp>
Wed, 22 Apr 2020 08:11:44 +0000 (17:11 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 22 Apr 2020 08:11:44 +0000 (17:11 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/main-gcu.c
src/main-win.c
src/main-x11.c
src/main/sound-definitions-table.c [new file with mode: 0644]
src/main/sound-definitions-table.h [new file with mode: 0644]
src/util.h

index c93aff8..c56586c 100644 (file)
     <ClCompile Include="..\..\src\autopick.c" />\r
     <ClCompile Include="..\..\src\avatar.c" />\r
     <ClCompile Include="..\..\src\birth.c" />\r
+    <ClCompile Include="..\..\src\main\sound-definitions-table.c" />\r
     <ClCompile Include="..\..\src\market\building.c" />\r
     <ClCompile Include="..\..\src\character-dump.c" />\r
     <ClCompile Include="..\..\src\chest.c" />\r
     <ClInclude Include="..\..\src\autopick.h" />\r
     <ClInclude Include="..\..\src\avatar.h" />\r
     <ClInclude Include="..\..\src\birth.h" />\r
+    <ClInclude Include="..\..\src\main\sound-definitions-table.h" />\r
     <ClInclude Include="..\..\src\market\building.h" />\r
     <ClInclude Include="..\..\src\character-dump.h" />\r
     <ClInclude Include="..\..\src\chest.h" />\r
index 26c4913..20d7dc6 100644 (file)
     <ClCompile Include="..\..\src\market\store.c">
       <Filter>market</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\main\sound-definitions-table.c">
+      <Filter>main</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\market\store.h">
       <Filter>market</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\main\sound-definitions-table.h">
+      <Filter>main</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
     <Filter Include="view">
       <UniqueIdentifier>{95a48e4b-b55a-4e99-a3c6-e8badbd1b2cf}</UniqueIdentifier>
     </Filter>
+    <Filter Include="main">
+      <UniqueIdentifier>{e8e836da-e12b-42cc-9c09-17432cb83432}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\..\src\angband.rc" />
index 3fddadf..5e3288f 100644 (file)
@@ -11,6 +11,7 @@ hengband_SOURCES = \
        \
        avatar.h avatar.c birth.c birth.h \
        \
+       main/sound-definitions-table.c main/sound-definitions-table.h \
        market/arena-info-table.c market/arena-info-table.h \
        market/building.c market/building.h \
        market/building-util.c market/building-util.h \
index 6af86a4..18368aa 100644 (file)
  */
 
 #include "angband.h"
+#include "main/sound-definitions-table.h"
 #include "io/exit-panic.h"
 #include "files.h"
 #include "gameterm.h"
@@ -261,80 +262,6 @@ static term_data data[MAX_TERM_DATA];
 /* #define nonl() */
 /* #define nl() */
 
- /*
-  * Standard sound names
-  */
-static const concptr angband_sound_name[SOUND_MAX] =
-{
-       "dummy",
-       "hit",
-       "miss",
-       "flee",
-       "drop",
-       "kill",
-       "level",
-       "death",
-       "study",
-       "teleport",
-       "shoot",
-       "quaff",
-       "zap",
-       "walk",
-       "tpother",
-       "hitwall",
-       "eat",
-       "store1",
-       "store2",
-       "store3",
-       "store4",
-       "dig",
-       "opendoor",
-       "shutdoor",
-       "tplevel",
-       "scroll",
-       "buy",
-       "sell",
-       "warn",
-       "rocket",
-       "n_kill",
-       "u_kill",
-       "quest",
-       "heal",
-       "x_heal",
-       "bite",
-       "claw",
-       "m_spell",
-       "summon",
-       "breath",
-       "ball",
-       "m_heal",
-       "atkspell",
-       "evil",
-       "touch",
-       "sting",
-       "crush",
-       "slime",
-       "wail",
-       "winner",
-       "fire",
-       "acid",
-       "elec",
-       "cold",
-       "illegal",
-       "fail",
-       "wakeup",
-       "invuln",
-       "fall",
-       "pain",
-       "destitem",
-       "moan",
-       "show",
-       "unused",
-       "explode",
-       "glass",
-       "reflect",
-};
-
 static concptr ANGBAND_DIR_XTRA_SOUND;
 
 /*
index 5aaeee8..93cb749 100644 (file)
@@ -91,6 +91,7 @@
 
 #include "angband.h"
 #include "signal-handlers.h"
+#include "main/sound-definitions-table.h"
 #include "util.h"
 #include "inet.h"
 #include "chuukei.h"
 #define MOUSE_SENS 40
 
 /*
- * Standard sound names
- */
-const concptr angband_sound_name[SOUND_MAX] =
-{
-       "dummy",
-       "hit",
-       "miss",
-       "flee",
-       "drop",
-       "kill",
-       "level",
-       "death",
-       "study",
-       "teleport",
-       "shoot",
-       "quaff",
-       "zap",
-       "walk",
-       "tpother",
-       "hitwall",
-       "eat",
-       "store1",
-       "store2",
-       "store3",
-       "store4",
-       "dig",
-       "opendoor",
-       "shutdoor",
-       "tplevel",
-       "scroll",
-       "buy",
-       "sell",
-       "warn",
-       "rocket",
-       "n_kill",
-       "u_kill",
-       "quest",
-       "heal",
-       "x_heal",
-       "bite",
-       "claw",
-       "m_spell",
-       "summon",
-       "breath",
-       "ball",
-       "m_heal",
-       "atkspell",
-       "evil",
-       "touch",
-       "sting",
-       "crush",
-       "slime",
-       "wail",
-       "winner",
-       "fire",
-       "acid",
-       "elec",
-       "cold",
-       "illegal",
-       "fail",
-       "wakeup",
-       "invuln",
-       "fall",
-       "pain",
-       "destitem",
-       "moan",
-       "show",
-       "unused",
-       "explode",
-       "glass",
-       "reflect",
-};
-
-/*
  * Standard music names
  */
 const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
index 4b2f386..771ee42 100644 (file)
@@ -94,6 +94,7 @@
 
 
 #include "angband.h"
+#include "main/sound-definitions-table.h"
 #include "core.h"
 #include "files.h"
 #include "gameterm.h"
@@ -2264,80 +2265,6 @@ static errr CheckEvent(bool wait)
 }
 
 
- /*
-  * Standard sound names
-  */
-static const concptr angband_sound_name[SOUND_MAX] =
-{
-       "dummy",
-       "hit",
-       "miss",
-       "flee",
-       "drop",
-       "kill",
-       "level",
-       "death",
-       "study",
-       "teleport",
-       "shoot",
-       "quaff",
-       "zap",
-       "walk",
-       "tpother",
-       "hitwall",
-       "eat",
-       "store1",
-       "store2",
-       "store3",
-       "store4",
-       "dig",
-       "opendoor",
-       "shutdoor",
-       "tplevel",
-       "scroll",
-       "buy",
-       "sell",
-       "warn",
-       "rocket",
-       "n_kill",
-       "u_kill",
-       "quest",
-       "heal",
-       "x_heal",
-       "bite",
-       "claw",
-       "m_spell",
-       "summon",
-       "breath",
-       "ball",
-       "m_heal",
-       "atkspell",
-       "evil",
-       "touch",
-       "sting",
-       "crush",
-       "slime",
-       "wail",
-       "winner",
-       "fire",
-       "acid",
-       "elec",
-       "cold",
-       "illegal",
-       "fail",
-       "wakeup",
-       "invuln",
-       "fall",
-       "pain",
-       "destitem",
-       "moan",
-       "show",
-       "unused",
-       "explode",
-       "glass",
-       "reflect",
-};
-
 /*
  * An array of sound file names
  */
diff --git a/src/main/sound-definitions-table.c b/src/main/sound-definitions-table.c
new file mode 100644 (file)
index 0000000..99ac852
--- /dev/null
@@ -0,0 +1,73 @@
+#include "angband.h"
+#include "main/sound-definitions-table.h"
+
+const concptr angband_sound_name[SOUND_MAX] =
+{
+       "dummy",
+       "hit",
+       "miss",
+       "flee",
+       "drop",
+       "kill",
+       "level",
+       "death",
+       "study",
+       "teleport",
+       "shoot",
+       "quaff",
+       "zap",
+       "walk",
+       "tpother",
+       "hitwall",
+       "eat",
+       "store1",
+       "store2",
+       "store3",
+       "store4",
+       "dig",
+       "opendoor",
+       "shutdoor",
+       "tplevel",
+       "scroll",
+       "buy",
+       "sell",
+       "warn",
+       "rocket",
+       "n_kill",
+       "u_kill",
+       "quest",
+       "heal",
+       "x_heal",
+       "bite",
+       "claw",
+       "m_spell",
+       "summon",
+       "breath",
+       "ball",
+       "m_heal",
+       "atkspell",
+       "evil",
+       "touch",
+       "sting",
+       "crush",
+       "slime",
+       "wail",
+       "winner",
+       "fire",
+       "acid",
+       "elec",
+       "cold",
+       "illegal",
+       "fail",
+       "wakeup",
+       "invuln",
+       "fall",
+       "pain",
+       "destitem",
+       "moan",
+       "show",
+       "unused",
+       "explode",
+       "glass",
+       "reflect",
+};
diff --git a/src/main/sound-definitions-table.h b/src/main/sound-definitions-table.h
new file mode 100644 (file)
index 0000000..2e979ff
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#define SOUND_MAX 67 /*!< 効果音定義の最大数 / Maximum numbers of sound effect */
+
+extern const concptr angband_sound_name[SOUND_MAX];
index 0bd0a50..b27d7cb 100644 (file)
@@ -265,11 +265,6 @@ extern concptr keymap_act[KEYMAP_MODES][256];
 #define SOUND_GLASS     65 /*!< A glass feature was crashed */
 #define SOUND_REFLECT   66 /*!< A bolt was reflected */
 
- /*
-  * Mega-Hack -- maximum known sounds
-  */
-#define SOUND_MAX 67 /*!< 効果音定義の最大数 */
-
   /*!
    * @brief 銘情報の最大数 / Maximum number of "quarks" (see "io.c")
    * @note