示例#1
0
// Play the given sound number.
// Volume is max at F1_0.
void digi_play_sample( int soundno, fix max_volume )
{
	if ( Newdemo_state == ND_STATE_RECORDING )
		newdemo_record_sound( soundno );

	if (!digi_initialised) return;

        if (digi_xlat_sound(soundno) < 0 ) return;

	digi_start_sound(soundno, max_volume, F0_5);
}
示例#2
0
文件: digiobj.c 项目: jihnsius/d2r
void digi_play_sample( int soundno, fix max_volume )
{
	if ( Newdemo_state == ND_STATE_RECORDING )
		newdemo_record_sound( soundno );

	soundno = digi_xlat_sound(soundno);

	if (soundno < 0 ) return;

   // start the sample playing
	digi_start_sound( soundno, max_volume, 0xffff/2, 0, -1, -1, -1 );
}
示例#3
0
文件: digi.c 项目: gameplayer22/d2x-1
// Play the given sound number.
// Volume is max at F1_0.
void digi_play_sample( int soundno, fix max_volume )
{
#ifdef NEWDEMO
	if ( Newdemo_state == ND_STATE_RECORDING )
		newdemo_record_sound( soundno );
#endif
	soundno = digi_xlat_sound(soundno);

	if (!digi_initialised) return;

	if (soundno < 0 ) return;

	digi_start_sound(soundno, max_volume, F0_5, 0, 0, 0, 0);
}
示例#4
0
// Play the given sound number. If the sound is already playing,
// restart it.
void digi_play_sample_once( int soundno, fix max_volume )
{
	int i;

	if ( Newdemo_state == ND_STATE_RECORDING )
		newdemo_record_sound( soundno );

	if (!digi_initialised) return;

        if (digi_xlat_sound(soundno) < 0 ) return;

	LOCK();
        for (i=0; i < MAX_SOUND_SLOTS; i++)
          if (SoundSlots[i].soundno == soundno)
            SoundSlots[i].playing = 0;
	UNLOCK();
	digi_start_sound(soundno, max_volume, F0_5);
}
示例#5
0
文件: digi.c 项目: gameplayer22/d2x-1
// Play the given sound number. If the sound is already playing,
// restart it.
void digi_play_sample_once( int soundno, fix max_volume )
{
	int i;

#ifdef NEWDEMO
	if ( Newdemo_state == ND_STATE_RECORDING )
		newdemo_record_sound( soundno );
#endif
	soundno = digi_xlat_sound(soundno);

	if (!digi_initialised) return;

	if (soundno < 0 ) return;

        for (i=0; i < MAX_SOUND_SLOTS; i++)
          if (SoundSlots[i].soundno == soundno)
            SoundSlots[i].playing = 0;
	digi_start_sound(soundno, max_volume, F0_5, 0, 0, 0, 0);

}
示例#6
0
文件: digi.c 项目: Ringdingcoder/d1x
// Play the given sound number. If the sound is already playing,
// restart it.
void digi_play_sample_once( int soundno, fix max_volume )
{
 int i;

#ifdef NEWDEMO
   if ( Newdemo_state == ND_STATE_RECORDING )
    newdemo_record_sound( soundno );
#endif
   if (!digi_initialised)
    return;
   if (digi_xlat_sound(soundno) < 0 )
    return;

   for (i=0; i < MAX_SOUND_SLOTS; i++)
    if (SoundSlots[i].soundno == soundno)
     {
       DS_release_slot(i,1);
     }

  digi_start_sound(soundno, max_volume, F0_5);
}
示例#7
0
文件: digi.c 项目: osgcc/descent-mac
void digi_play_sample( int sndnum, fix max_volume )
{
	OSErr err;
	int i, vol;

	if (Newdemo_state == ND_STATE_RECORDING)
		newdemo_record_sound(sndnum);

	if (!digi_initialized) return;
	if (digi_paused) {
		digi_resume_all();
		if (digi_paused)
			return;
	}
	if ( sndnum < 0 ) return;

	i = digi_xlat_sound(sndnum);
	if (i == -1) return;

	vol = fixmuldiv(max_volume, digi_volume, F1_0);
	ChangeSoundVolume(i, vol );
	err = BeginSound(i, SOUND_RATE_11k);
	ChangeSoundStereoPosition(i, 0);
}