1 /*
2  * Portions of this file are copyright Rebirth contributors and licensed as
3  * described in COPYING.txt.
4  * Portions of this file are copyright Parallax Software and licensed
5  * according to the Parallax license below.
6  * See COPYING.txt for license details.
7 
8 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
9 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
10 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
11 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
12 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
13 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
14 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
15 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
16 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
17 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
18 */
19 
20 /*
21  *
22  * Numbering system for the sounds.
23  *
24  */
25 
26 
27 #ifndef _SOUNDS_H
28 #define _SOUNDS_H
29 
30 #include <array>
31 
32 #ifdef dsx
33 #if defined(DXX_BUILD_DESCENT_I)
34 #define SOUND_GOOD_SELECTION_PRIMARY    (PCSharePig ? SOUND_ALREADY_SELECTED : SOUND_GOOD_SELECTION_PRIMARY_FULL_DATA)
35 #define SOUND_GOOD_SELECTION_SECONDARY  (PCSharePig ? SOUND_ALREADY_SELECTED : SOUND_GOOD_SELECTION_SECONDARY_FULL_DATA)    //      Adam: New sound number here! MK, 01/30/95
36 #define SOUND_CHEATER                   (PCSharePig ? SOUND_BAD_SELECTION : SOUND_CHEATER_FULL_DATA) // moved by Victor Rachels
37 #elif defined(DXX_BUILD_DESCENT_II)
38 #define SOUND_GOOD_SELECTION_PRIMARY	SOUND_GOOD_SELECTION_PRIMARY_FULL_DATA
39 #define SOUND_GOOD_SELECTION_SECONDARY	SOUND_GOOD_SELECTION_SECONDARY_FULL_DATA
40 #define SOUND_CHEATER	SOUND_CHEATER_FULL_DATA
41 #endif
42 
43 namespace d1x {
44 constexpr std::integral_constant<unsigned, 250> MAX_SOUNDS{};
45 }
46 namespace d2x {
47 //--------------------------------------------------------------
48 // bad to have sound 255!
49 constexpr std::integral_constant<unsigned, 254> MAX_SOUNDS{};
50 }
51 
52 //------------------- List of sound effects --------------------
53 namespace dcx {
54 
55 	/* The games do not use exactly the same sounds, but every sound can
56 	 * be classified as:
57 	 * - Used in both games, with the same value
58 	 * - Used only in Descent 1
59 	 * - Used only in Descent 2
60 	 * Therefore, this can be in dcx without causing ambiguity.  Sounds
61 	 * used only for one game are unnecessarily defined in the other,
62 	 * and then ignored.
63 	 *
64 	 * The values of sound_effect are used to index Sounds.  A uint8_t
65 	 * would be sufficient to hold all values, but unsigned is used
66 	 * since a uint8_t would need to be zero-extended before it could be
67 	 * used in an array lookup.
68 	 */
69 enum sound_effect : unsigned
70 {
71 	SOUND_LASER_FIRED = 10,
72 	SOUND_BADASS_EXPLOSION = 11,  // need something different for this if possible
73 	SOUND_WEAPON_HIT_BLASTABLE = 11,
74 	SOUND_ROBOT_HIT_PLAYER = 17,
75 	SOUND_ROBOT_HIT = 20,
76 	SOUND_VOLATILE_WALL_HIT = 21,
77 	SOUND_DROP_BOMB = 26,
78 	SOUND_WEAPON_HIT_DOOR = 27,
79 	SOUND_CONTROL_CENTER_HIT = 30,
80 	SOUND_LASER_HIT_CLUTTER = 30,
81 	SOUND_CONTROL_CENTER_DESTROYED = 31,
82 	SOUND_EXPLODING_WALL = 31,  // one long sound
83 	SOUND_BIG_ENDLEVEL_EXPLOSION = SOUND_EXPLODING_WALL,
84 	SOUND_TUNNEL_EXPLOSION = SOUND_EXPLODING_WALL,
85 	SOUND_CONTROL_CENTER_WARNING_SIREN = 32,
86 	SOUND_MINE_BLEW_UP = 33,
87 	SOUND_FUSION_WARMUP = 34,
88 	SOUND_REFUEL_STATION_GIVING_FUEL = 62,
89 	SOUND_PLAYER_HIT_WALL = 70,
90 	SOUND_PLAYER_GOT_HIT = 71,
91 	SOUND_HOSTAGE_RESCUED = 91,
92 	SOUND_COUNTDOWN_0_SECS = 100, // countdown 100..114
93 	SOUND_COUNTDOWN_13_SECS = 113,
94 	SOUND_COUNTDOWN_29_SECS = 114,
95 	SOUND_HUD_MESSAGE = 117,
96 	SOUND_HUD_KILL = 118,
97 	SOUND_HOMING_WARNING = 122, // Warning beep: You are being tracked by a missile! Borrowed from old repair center sounds.
98 	SOUND_VOLATILE_WALL_HISS = 151, // need a hiss sound here.
99 	SOUND_GOOD_SELECTION_PRIMARY_FULL_DATA = 153,
100 	SOUND_GOOD_SELECTION_SECONDARY_FULL_DATA = 154, // Adam: New sound number here! MK, 01/30/95
101 	SOUND_ALREADY_SELECTED = 155, // Adam: New sound number here! MK, 01/30/95
102 	SOUND_BAD_SELECTION = 156,
103 	SOUND_CLOAK_OFF = 161, // sound when cloak goes away
104 	SOUND_WALL_CLOAK_OFF = SOUND_CLOAK_OFF,
105 	SOUND_INVULNERABILITY_OFF = 163, // sound when invulnerability goes away
106 	ROBOT_SEE_SOUND_DEFAULT = 170,
107 	ROBOT_ATTACK_SOUND_DEFAULT = 171,
108 	SOUND_BOSS_SHARE_SEE = 183,
109 	SOUND_BOSS_SHARE_DIE = 185,
110 	ROBOT_CLAW_SOUND_DEFAULT = 190,
111 	SOUND_CHEATER_FULL_DATA = 200,
112 
113 	/* if DXX_BUILD_DESCENT_I */
114 	/* Not used even there */
115 #if 0
116 	SOUND_BOSS_SHARE_ATTACK = 184,
117 
118 	SOUND_NASTY_ROBOT_HIT_1 = 190,     //      ding.raw        ; tearing metal 1
119 	SOUND_NASTY_ROBOT_HIT_2 = 191,     //      ding.raw        ; tearing metal 2
120 #endif
121 	/* endif */
122 	/* if DXX_BUILD_DESCENT_II */
123 	SOUND_LASER_HIT_WATER = 232,
124 	SOUND_MISSILE_HIT_WATER = 233,
125 	SOUND_DROP_WEAPON = 39,
126 
127 	SOUND_FORCEFIELD_BOUNCE_PLAYER = 40,
128 	SOUND_FORCEFIELD_BOUNCE_WEAPON = 41,
129 	SOUND_FORCEFIELD_HUM = 42,
130 	SOUND_FORCEFIELD_OFF = 43,
131 
132 	SOUND_MARKER_HIT = 50,
133 	SOUND_BUDDY_MET_GOAL = 51,
134 
135 	SOUND_BRIEFING_HUM = 94,
136 	SOUND_BRIEFING_PRINTING = 95,
137 	SOUND_HUD_JOIN_REQUEST = 123,
138 	SOUND_HUD_BLUE_GOT_FLAG = 124,
139 	SOUND_HUD_RED_GOT_FLAG = 125,
140 	SOUND_HUD_YOU_GOT_FLAG = 126,
141 	SOUND_HUD_BLUE_GOT_GOAL = 127,
142 	SOUND_HUD_RED_GOT_GOAL = 128,
143 	SOUND_HUD_YOU_GOT_GOAL = 129,
144 
145 	SOUND_LAVAFALL_HISS = 150, // under a lavafall
146 	SOUND_SHIP_IN_WATER = 152, // sitting (or moving though) water
147 	SOUND_SHIP_IN_WATERFALL = 158, // under a waterfall
148 
149 	SOUND_CLOAK_ON = 160, // USED FOR WALL CLOAK
150 	SOUND_WALL_CLOAK_ON = SOUND_CLOAK_ON,
151 
152 	SOUND_AMBIENT_LAVA = 222,
153 	SOUND_AMBIENT_WATER = 223,
154 
155 	SOUND_CONVERT_ENERGY = 241,
156 	SOUND_WEAPON_STOLEN = 244,
157 
158 	SOUND_LIGHT_BLOWNUP = 157,
159 
160 	SOUND_WALL_REMOVED = 246, // Wall removed, probably due to a wall switch.
161 	SOUND_AFTERBURNER_IGNITE = 247,
162 	SOUND_AFTERBURNER_PLAY = 248,
163 
164 	SOUND_SECRET_EXIT = 249,
165 
166 	SOUND_SEISMIC_DISTURBANCE_START = 251,
167 
168 	SOUND_YOU_GOT_ORB = 84,
169 	SOUND_FRIEND_GOT_ORB = 85,
170 	SOUND_OPPONENT_GOT_ORB = 86,
171 	SOUND_OPPONENT_HAS_SCORED = 87,
172 	/* endif */
173 };
174 
175 // I think it would be nice to have a scrape sound...
176 //#define SOUND_PLAYER_SCRAPE_WALL                72
177 
178 extern std::array<uint8_t, ::d2x::MAX_SOUNDS> Sounds, AltSounds;
179 }
180 
181 constexpr std::integral_constant<int, -1> sound_none{};
182 #endif
183 
184 #endif /* _SOUNDS_H */
185