From 47c0b5207ed5bc077f1d9d59f94c12c522f2a0b9 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 17 Sep 2008 19:10:54 +0000 Subject: Split sound code out of Heretic's i_ibm.c into s_sound.c. Rename soundst.h to s_sound.h to fit. Reformat sounds.c files to declare sounds through macros and harmonise on the common sfxinfo_t. Fix up Heretic sound code to use common sound API. Subversion-branch: /branches/raven-branch Subversion-revision: 1236 --- src/doom/sounds.c | 362 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 185 insertions(+), 177 deletions(-) (limited to 'src/doom/sounds.c') diff --git a/src/doom/sounds.c b/src/doom/sounds.c index 37f3e404..55bda724 100644 --- a/src/doom/sounds.c +++ b/src/doom/sounds.c @@ -36,76 +36,79 @@ // Information about all the music // +#define MUSIC(name) \ + { name, 0, NULL, NULL } + musicinfo_t S_music[] = { - { NULL, 0, 0, 0 }, - { "e1m1", 0, 0, 0 }, - { "e1m2", 0, 0, 0 }, - { "e1m3", 0, 0, 0 }, - { "e1m4", 0, 0, 0 }, - { "e1m5", 0, 0, 0 }, - { "e1m6", 0, 0, 0 }, - { "e1m7", 0, 0, 0 }, - { "e1m8", 0, 0, 0 }, - { "e1m9", 0, 0, 0 }, - { "e2m1", 0, 0, 0 }, - { "e2m2", 0, 0, 0 }, - { "e2m3", 0, 0, 0 }, - { "e2m4", 0, 0, 0 }, - { "e2m5", 0, 0, 0 }, - { "e2m6", 0, 0, 0 }, - { "e2m7", 0, 0, 0 }, - { "e2m8", 0, 0, 0 }, - { "e2m9", 0, 0, 0 }, - { "e3m1", 0, 0, 0 }, - { "e3m2", 0, 0, 0 }, - { "e3m3", 0, 0, 0 }, - { "e3m4", 0, 0, 0 }, - { "e3m5", 0, 0, 0 }, - { "e3m6", 0, 0, 0 }, - { "e3m7", 0, 0, 0 }, - { "e3m8", 0, 0, 0 }, - { "e3m9", 0, 0, 0 }, - { "inter", 0, 0, 0 }, - { "intro", 0, 0, 0 }, - { "bunny", 0, 0, 0 }, - { "victor", 0, 0, 0 }, - { "introa", 0, 0, 0 }, - { "runnin", 0, 0, 0 }, - { "stalks", 0, 0, 0 }, - { "countd", 0, 0, 0 }, - { "betwee", 0, 0, 0 }, - { "doom", 0, 0, 0 }, - { "the_da", 0, 0, 0 }, - { "shawn", 0, 0, 0 }, - { "ddtblu", 0, 0, 0 }, - { "in_cit", 0, 0, 0 }, - { "dead", 0, 0, 0 }, - { "stlks2", 0, 0, 0 }, - { "theda2", 0, 0, 0 }, - { "doom2", 0, 0, 0 }, - { "ddtbl2", 0, 0, 0 }, - { "runni2", 0, 0, 0 }, - { "dead2", 0, 0, 0 }, - { "stlks3", 0, 0, 0 }, - { "romero", 0, 0, 0 }, - { "shawn2", 0, 0, 0 }, - { "messag", 0, 0, 0 }, - { "count2", 0, 0, 0 }, - { "ddtbl3", 0, 0, 0 }, - { "ampie", 0, 0, 0 }, - { "theda3", 0, 0, 0 }, - { "adrian", 0, 0, 0 }, - { "messg2", 0, 0, 0 }, - { "romer2", 0, 0, 0 }, - { "tense", 0, 0, 0 }, - { "shawn3", 0, 0, 0 }, - { "openin", 0, 0, 0 }, - { "evil", 0, 0, 0 }, - { "ultima", 0, 0, 0 }, - { "read_m", 0, 0, 0 }, - { "dm2ttl", 0, 0, 0 }, - { "dm2int", 0, 0, 0 } + MUSIC(NULL), + MUSIC("e1m1"), + MUSIC("e1m2"), + MUSIC("e1m3"), + MUSIC("e1m4"), + MUSIC("e1m5"), + MUSIC("e1m6"), + MUSIC("e1m7"), + MUSIC("e1m8"), + MUSIC("e1m9"), + MUSIC("e2m1"), + MUSIC("e2m2"), + MUSIC("e2m3"), + MUSIC("e2m4"), + MUSIC("e2m5"), + MUSIC("e2m6"), + MUSIC("e2m7"), + MUSIC("e2m8"), + MUSIC("e2m9"), + MUSIC("e3m1"), + MUSIC("e3m2"), + MUSIC("e3m3"), + MUSIC("e3m4"), + MUSIC("e3m5"), + MUSIC("e3m6"), + MUSIC("e3m7"), + MUSIC("e3m8"), + MUSIC("e3m9"), + MUSIC("inter"), + MUSIC("intro"), + MUSIC("bunny"), + MUSIC("victor"), + MUSIC("introa"), + MUSIC("runnin"), + MUSIC("stalks"), + MUSIC("countd"), + MUSIC("betwee"), + MUSIC("doom"), + MUSIC("the_da"), + MUSIC("shawn"), + MUSIC("ddtblu"), + MUSIC("in_cit"), + MUSIC("dead"), + MUSIC("stlks2"), + MUSIC("theda2"), + MUSIC("doom2"), + MUSIC("ddtbl2"), + MUSIC("runni2"), + MUSIC("dead2"), + MUSIC("stlks3"), + MUSIC("romero"), + MUSIC("shawn2"), + MUSIC("messag"), + MUSIC("count2"), + MUSIC("ddtbl3"), + MUSIC("ampie"), + MUSIC("theda3"), + MUSIC("adrian"), + MUSIC("messg2"), + MUSIC("romer2"), + MUSIC("tense"), + MUSIC("shawn3"), + MUSIC("openin"), + MUSIC("evil"), + MUSIC("ultima"), + MUSIC("read_m"), + MUSIC("dm2ttl"), + MUSIC("dm2int") }; @@ -113,117 +116,122 @@ musicinfo_t S_music[] = // Information about all the sfx // +#define SOUND(name, priority) \ + { name, priority, NULL, -1, -1, 0, 0, -1, NULL } +#define SOUND_LINK(name, priority, link_id, pitch, volume) \ + { name, priority, &S_sfx[link_id], pitch, volume, 0, 0, -1, NULL } + sfxinfo_t S_sfx[] = { // S_sfx[0] needs to be a dummy for odd reasons. - { "none", 0, 0, -1, -1, 0, 0, 0, NULL }, - { "pistol", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "shotgn", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "sgcock", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "dshtgn", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "dbopn", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "dbcls", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "dbload", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "plasma", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "bfg", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "sawup", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "sawidl", 118, 0, -1, -1, 0, 0, 0, NULL }, - { "sawful", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "sawhit", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "rlaunc", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "rxplod", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "firsht", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "firxpl", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "pstart", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "pstop", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "doropn", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "dorcls", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "stnmov", 119, 0, -1, -1, 0, 0, 0, NULL }, - { "swtchn", 78, 0, -1, -1, 0, 0, 0, NULL }, - { "swtchx", 78, 0, -1, -1, 0, 0, 0, NULL }, - { "plpain", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "dmpain", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "popain", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "vipain", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "mnpain", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "pepain", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "slop", 78, 0, -1, -1, 0, 0, 0, NULL }, - { "itemup", 78, 0, -1, -1, 0, 0, 0, NULL }, - { "wpnup", 78, 0, -1, -1, 0, 0, 0, NULL }, - { "oof", 96, 0, -1, -1, 0, 0, 0, NULL }, - { "telept", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "posit1", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "posit2", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "posit3", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "bgsit1", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "bgsit2", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "sgtsit", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "cacsit", 98, 0, -1, -1, 0, 0, 0, NULL }, - { "brssit", 94, 0, -1, -1, 0, 0, 0, NULL }, - { "cybsit", 92, 0, -1, -1, 0, 0, 0, NULL }, - { "spisit", 90, 0, -1, -1, 0, 0, 0, NULL }, - { "bspsit", 90, 0, -1, -1, 0, 0, 0, NULL }, - { "kntsit", 90, 0, -1, -1, 0, 0, 0, NULL }, - { "vilsit", 90, 0, -1, -1, 0, 0, 0, NULL }, - { "mansit", 90, 0, -1, -1, 0, 0, 0, NULL }, - { "pesit", 90, 0, -1, -1, 0, 0, 0, NULL }, - { "sklatk", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "sgtatk", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "skepch", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "vilatk", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "claw", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "skeswg", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "pldeth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "pdiehi", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "podth1", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "podth2", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "podth3", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "bgdth1", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "bgdth2", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "sgtdth", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "cacdth", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "skldth", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "brsdth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "cybdth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "spidth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "bspdth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "vildth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "kntdth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "pedth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "skedth", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "posact", 120, 0, -1, -1, 0, 0, 0, NULL }, - { "bgact", 120, 0, -1, -1, 0, 0, 0, NULL }, - { "dmact", 120, 0, -1, -1, 0, 0, 0, NULL }, - { "bspact", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "bspwlk", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "vilact", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "noway", 78, 0, -1, -1, 0, 0, 0, NULL }, - { "barexp", 60, 0, -1, -1, 0, 0, 0, NULL }, - { "punch", 64, 0, -1, -1, 0, 0, 0, NULL }, - { "hoof", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "metal", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "chgun", 64, &S_sfx[sfx_pistol], 150, 0, 0, 0, 0, NULL }, - { "tink", 60, 0, -1, -1, 0, 0, 0, NULL }, - { "bdopn", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "bdcls", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "itmbk", 100, 0, -1, -1, 0, 0, 0, NULL }, - { "flame", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "flamst", 32, 0, -1, -1, 0, 0, 0, NULL }, - { "getpow", 60, 0, -1, -1, 0, 0, 0, NULL }, - { "bospit", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "boscub", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "bossit", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "bospn", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "bosdth", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "manatk", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "mandth", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "sssit", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "ssdth", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "keenpn", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "keendt", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "skeact", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "skesit", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "skeatk", 70, 0, -1, -1, 0, 0, 0, NULL }, - { "radio", 60, 0, -1, -1, 0, 0, 0, NULL } + SOUND("none", 0), + SOUND("pistol", 64), + SOUND("shotgn", 64), + SOUND("sgcock", 64), + SOUND("dshtgn", 64), + SOUND("dbopn", 64), + SOUND("dbcls", 64), + SOUND("dbload", 64), + SOUND("plasma", 64), + SOUND("bfg", 64), + SOUND("sawup", 64), + SOUND("sawidl", 118), + SOUND("sawful", 64), + SOUND("sawhit", 64), + SOUND("rlaunc", 64), + SOUND("rxplod", 70), + SOUND("firsht", 70), + SOUND("firxpl", 70), + SOUND("pstart", 100), + SOUND("pstop", 100), + SOUND("doropn", 100), + SOUND("dorcls", 100), + SOUND("stnmov", 119), + SOUND("swtchn", 78), + SOUND("swtchx", 78), + SOUND("plpain", 96), + SOUND("dmpain", 96), + SOUND("popain", 96), + SOUND("vipain", 96), + SOUND("mnpain", 96), + SOUND("pepain", 96), + SOUND("slop", 78), + SOUND("itemup", 78), + SOUND("wpnup", 78), + SOUND("oof", 96), + SOUND("telept", 32), + SOUND("posit1", 98), + SOUND("posit2", 98), + SOUND("posit3", 98), + SOUND("bgsit1", 98), + SOUND("bgsit2", 98), + SOUND("sgtsit", 98), + SOUND("cacsit", 98), + SOUND("brssit", 94), + SOUND("cybsit", 92), + SOUND("spisit", 90), + SOUND("bspsit", 90), + SOUND("kntsit", 90), + SOUND("vilsit", 90), + SOUND("mansit", 90), + SOUND("pesit", 90), + SOUND("sklatk", 70), + SOUND("sgtatk", 70), + SOUND("skepch", 70), + SOUND("vilatk", 70), + SOUND("claw", 70), + SOUND("skeswg", 70), + SOUND("pldeth", 32), + SOUND("pdiehi", 32), + SOUND("podth1", 70), + SOUND("podth2", 70), + SOUND("podth3", 70), + SOUND("bgdth1", 70), + SOUND("bgdth2", 70), + SOUND("sgtdth", 70), + SOUND("cacdth", 70), + SOUND("skldth", 70), + SOUND("brsdth", 32), + SOUND("cybdth", 32), + SOUND("spidth", 32), + SOUND("bspdth", 32), + SOUND("vildth", 32), + SOUND("kntdth", 32), + SOUND("pedth", 32), + SOUND("skedth", 32), + SOUND("posact", 120), + SOUND("bgact", 120), + SOUND("dmact", 120), + SOUND("bspact", 100), + SOUND("bspwlk", 100), + SOUND("vilact", 100), + SOUND("noway", 78), + SOUND("barexp", 60), + SOUND("punch", 64), + SOUND("hoof", 70), + SOUND("metal", 70), + SOUND_LINK("chgun", 64, sfx_pistol, 150, 0), + SOUND("tink", 60), + SOUND("bdopn", 100), + SOUND("bdcls", 100), + SOUND("itmbk", 100), + SOUND("flame", 32), + SOUND("flamst", 32), + SOUND("getpow", 60), + SOUND("bospit", 70), + SOUND("boscub", 70), + SOUND("bossit", 70), + SOUND("bospn", 70), + SOUND("bosdth", 70), + SOUND("manatk", 70), + SOUND("mandth", 70), + SOUND("sssit", 70), + SOUND("ssdth", 70), + SOUND("keenpn", 70), + SOUND("keendt", 70), + SOUND("skeact", 70), + SOUND("skesit", 70), + SOUND("skeatk", 70), + SOUND("radio", 60), }; -- cgit v1.2.3