diff --git a/src/menu.c b/src/menu.c
index 3d797fc944cbf019c0df7addc2153ce89118fbf9..7f44950493624f25d6ab8ccd6b67e21009d718e6 100644 (file)
--- a/src/menu.c
+++ b/src/menu.c
static int movsndt=0;
static byte cbuf[32];
static int movsndt=0;
static byte cbuf[32];
-static snd_t *voc=NULL;
-static int voc_ch=0;
+static snd_t *voc;
+static int voc_ch;
static void GMV_stop (void) {
static void GMV_stop (void) {
- if(voc) {
- if(voc_ch) {S_stop(voc_ch);voc_ch=0;}
- free(voc);voc=NULL;
+ if (voc != NULL) {
+ if (voc_ch) {
+ S_stop(voc_ch);
+ voc_ch = 0;
+ }
+ S_free(voc);
+ voc = NULL;
}
}
}
}
-void GMV_say (char *nm) {
- int r,len;
- snd_t *p;
- byte *d;
-
- if((r=F_findres(nm))==-1) return;
- if(!(p=malloc((len=F_getreslen(r))+16))) return;
- p->len=len;p->rate=11000;
- p->lstart=p->llen=0;
- GMV_stop();
- F_loadres(r,p+1,0,len);
- for(d=(byte*)(p+1);len;--len,++d) *d^=128;
- voc=p;
- voc_ch=S_play(voc,-1,1024,255);
+void GMV_say (const char nm[8]) {
+ snd_t *snd = S_load(nm);
+ if (snd) {
+ GMV_stop();
+ voc = S_load(nm);
+ voc_ch = S_play(voc, 0, 255);
+ }
}
static void GM_set (menu_t *m) {
}
static void GM_set (menu_t *m) {
F_freemus();
GMV_stop();
#ifndef DEMO
F_freemus();
GMV_stop();
#ifndef DEMO
- c=Z_sound(M_lock(qsnd[myrand(QSND_NUM)]),256);//for(c=(Z_sound(M_lock(qsnd[random2(QSND_NUM)]),256)+9)<<16,timer=0;timer<c;);
- S_wait();
+ c = Z_sound(S_get(qsnd[myrand(QSND_NUM)]), 255);
+ S_wait();
#endif
ERR_quit();break;
case ENDGM:
#endif
ERR_quit();break;
case ENDGM:
msnd4=Z_getsnd("SWTCHX");
msnd5=Z_getsnd("SUDI");
msnd6=Z_getsnd("TUDI");
msnd4=Z_getsnd("SWTCHX");
msnd5=Z_getsnd("SUDI");
msnd6=Z_getsnd("TUDI");
+ F_loadmus("MENU");
+ S_startmusic(0);
}
}