Game Development Reference
In-Depth Information
Mapping Sound Names to Raw Sound Resources
The name mapping class SoundNames is the critical component that maps a native sound IDs to an
Android raw resource IDs. Wolf 3D uses 86 sounds, which are defined using an array of integers where
the array index represents the native sound ID and the array value represents the Android raw resource
ID (see Listing 6-11). This class is used by the AudioManager . The native sound IDs were extracted from
the native header file audiowl6.h within the native/gp2xwolf3d folder (see the chapter source code for
details).
Listing 6-11. Native Sound Name Mappings
public class SoundNames {
public static final int [] Sounds = new int[86];
/* Native Sound
typedef enum {
HITWALLSNDWL6, // 0
SELECTWPNSNDWL6, // 1
SELECTITEMSNDWL6, // 2
HEARTBEATSNDWL6, // 3
MOVEGUN2SNDWL6, // 4
*** SEE SOUND NAMES CLASS ***
MISSILEFIRESNDWL6, // 85
MISSILEHITSNDWL6, // 86
LASTSOUNDWL6
}
*/
static {
//Sounds[0] = R.raw.noway; // hit wall
Sounds[1] = R.raw.wpnup; // sel wpn
Sounds[2] = R.raw.itemup; // hit wall
Sounds[4] = R.raw.wpnup; // Move gun(weapon up)
// *** SEE SOUND NAMES CLASS ***
Sounds[76] = R.raw.podth2;
Sounds[77] = R.raw.podth3;
Sounds[78] = R.raw.bgdth2;
}
/* Music Indexes
typedef enum {
CORNER_MUS, // 0
DUNGEON_MUSWL6, // 1
WARMARCH_MUS, // 2
Search WWH ::




Custom Search