32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
static Uint8*volatile wavesound;
static volatile Uint32 wavelen;
static void audio_callback(void*userdata,Uint8*stream,int len) {
if(wavesound) {
if(wavelen<len) {
memset(stream+wavelen,0,len-wavelen);
wavesound=0;
wavelen=0;
} else {
memcpy(stream,wavesound,len);
wavesound+=len;
len-=len;
|
>
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
static Uint8*volatile wavesound;
static volatile Uint32 wavelen;
static void audio_callback(void*userdata,Uint8*stream,int len) {
if(wavesound) {
if(wavelen<len) {
memcpy(stream,wavesound,wavelen);
memset(stream+wavelen,0,len-wavelen);
wavesound=0;
wavelen=0;
} else {
memcpy(stream,wavesound,len);
wavesound+=len;
len-=len;
|
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
return;
}
optionquery[2]=Q_waveVolume;
if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) {
needs_amplify=1;
wavevolume=strtod(v,0);
}
fprintf(stderr,"Done.\n");
wavesound=0;
SDL_PauseAudio(0);
sound_on=1;
}
|
>
>
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
return;
}
optionquery[2]=Q_waveVolume;
if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) {
needs_amplify=1;
wavevolume=strtod(v,0);
}
optionquery[2]=Q_mmlVolume;
if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) mmlvolume=fmin(strtod(v,0)*32767.0,32767.0);
fprintf(stderr,"Done.\n");
wavesound=0;
SDL_PauseAudio(0);
sound_on=1;
}
|