This commit is contained in:
parent
3a6aad09b2
commit
506a10221d
2 changed files with 113 additions and 136 deletions
|
@ -588,7 +588,10 @@ void CLevel::shutdown()
|
|||
}
|
||||
|
||||
CSoundMediator::stopAllSound();
|
||||
for(int i=0;i<5;i++)
|
||||
{
|
||||
VSync(0);CSoundMediator::think(1); // This is needed to let xmplay kill off the sounds properly (pkg)
|
||||
}
|
||||
|
||||
if (ActorList) MemFree(ActorList);
|
||||
if (PlatformList) MemFree(PlatformList);
|
||||
|
|
|
@ -170,22 +170,23 @@ void CXMPlaySound::think()
|
|||
case SILENT:
|
||||
if(!ch->m_locked)
|
||||
{
|
||||
if(XM_GetFeedback(ch->m_internalId,&fb))
|
||||
{
|
||||
///PAUL_DBGMSG("freeing channels:");
|
||||
///int j=i;
|
||||
do
|
||||
{
|
||||
//PAUL_DBGMSG("freed channel %d ( %d )",i,ch->m_playingId);
|
||||
///PAUL_DBGMSG(" %d (%d)",j++,ch->m_playingId);
|
||||
ch->m_useType=FREE;
|
||||
#ifdef __VERSION_DEBUG__
|
||||
ch->m_internalId=0;
|
||||
ch->m_playingId=NOT_PLAYING;
|
||||
ch->m_priority=0;
|
||||
ch->m_locked=false;
|
||||
ch->m_vol=MIN_VOLUME;
|
||||
ch->m_pan=PAN_CENTRE;
|
||||
#endif
|
||||
ch++;
|
||||
}
|
||||
while(ch->m_useType==CONTINUE);
|
||||
}
|
||||
/// else
|
||||
///{
|
||||
/// PAUL_DBGMSG("channel %d not stopped",i);
|
||||
///}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
@ -193,14 +194,13 @@ void CXMPlaySound::think()
|
|||
case SONG:
|
||||
case SFX:
|
||||
if(XM_GetFeedback(ch->m_internalId,&fb))
|
||||
{
|
||||
do
|
||||
{
|
||||
// Just mark it as silent, if it's unlocked then it'll die next frame
|
||||
ch->m_useType=SILENT;
|
||||
ch++;
|
||||
}
|
||||
while(ch->m_useType==CONTINUE);
|
||||
|
||||
// And kill it in the player
|
||||
XM_Quit(ch->m_internalId);
|
||||
///PAUL_DBGMSG("marked %d (%d) as silent",i,ch->m_internalId);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -435,13 +435,10 @@ void CXMPlaySound::setStereo(int _stereo)
|
|||
---------------------------------------------------------------------- */
|
||||
void CXMPlaySound::setVolume(xmPlayingId _playingId,unsigned char _volume)
|
||||
{
|
||||
// int i;
|
||||
spuChannelUse *ch;
|
||||
int vol;
|
||||
|
||||
ch=&m_spuChannelUse[_playingId&0xff];
|
||||
// for(i=0;i<NUM_SPU_CHANNELS;i++,ch++)
|
||||
{
|
||||
if(ch->m_playingId==_playingId)
|
||||
{
|
||||
ASSERT(ch->m_locked!=false); // Cant alter unlocked channels!
|
||||
|
@ -472,7 +469,7 @@ void CXMPlaySound::setVolume(xmPlayingId _playingId,unsigned char _volume)
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(0); // Couldn't find the sound to unlock it!
|
||||
}
|
||||
|
||||
|
@ -485,12 +482,9 @@ void CXMPlaySound::setVolume(xmPlayingId _playingId,unsigned char _volume)
|
|||
---------------------------------------------------------------------- */
|
||||
void CXMPlaySound::setPanning(xmPlayingId _playingId,char _pan)
|
||||
{
|
||||
// int i;
|
||||
spuChannelUse *ch;
|
||||
|
||||
ch=&m_spuChannelUse[_playingId&0xff];
|
||||
// for(i=0;i<NUM_SPU_CHANNELS;i++,ch++)
|
||||
{
|
||||
if(ch->m_playingId==_playingId)
|
||||
{
|
||||
ASSERT(ch->m_locked!=false); // Cant alter unlocked channels!
|
||||
|
@ -519,7 +513,7 @@ void CXMPlaySound::setPanning(xmPlayingId _playingId,char _pan)
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(0); // Couldn't find the sound to unlock it!
|
||||
}
|
||||
|
||||
|
@ -572,7 +566,6 @@ void CXMPlaySound::stopAndUnlockAllSound()
|
|||
ch->m_useType==LOOPINGSFX)
|
||||
{
|
||||
ch->m_locked=true; // hmm.. not too ugly I suppose
|
||||
// setVolume(ch->m_playingId,0);
|
||||
stopPlayingId(ch->m_playingId);
|
||||
|
||||
// Need to unlock too
|
||||
|
@ -636,12 +629,9 @@ xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId,int _star
|
|||
---------------------------------------------------------------------- */
|
||||
void CXMPlaySound::unlockPlayingId(xmPlayingId _playingId)
|
||||
{
|
||||
// int i;
|
||||
spuChannelUse *ch;
|
||||
|
||||
ch=&m_spuChannelUse[_playingId&0xff];
|
||||
// for(i=0;i<NUM_SPU_CHANNELS;i++,ch++)
|
||||
{
|
||||
if(ch->m_playingId==_playingId)
|
||||
{
|
||||
//PAUL_DBGMSG("unlocking %d",_playingId);
|
||||
|
@ -654,7 +644,7 @@ void CXMPlaySound::unlockPlayingId(xmPlayingId _playingId)
|
|||
while(ch->m_useType==CONTINUE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(0); // Couldn't find the sound to unlock it!
|
||||
}
|
||||
|
||||
|
@ -667,12 +657,9 @@ void CXMPlaySound::unlockPlayingId(xmPlayingId _playingId)
|
|||
---------------------------------------------------------------------- */
|
||||
void CXMPlaySound::stopPlayingId(xmPlayingId _playingId)
|
||||
{
|
||||
// int i;
|
||||
spuChannelUse *ch;
|
||||
|
||||
ch=&m_spuChannelUse[_playingId&0xff];
|
||||
// for(i=0;i<NUM_SPU_CHANNELS;i++,ch++)
|
||||
{
|
||||
if(ch->m_playingId==_playingId)
|
||||
{
|
||||
ASSERT(ch->m_locked!=false); // Cant stop unlocked channels!
|
||||
|
@ -681,13 +668,13 @@ void CXMPlaySound::stopPlayingId(xmPlayingId _playingId)
|
|||
case SONG:
|
||||
case SFX:
|
||||
{
|
||||
XM_Feedback fb;
|
||||
do
|
||||
{
|
||||
// XM_Feedback fb;
|
||||
// do
|
||||
// {
|
||||
XM_PlayStop(ch->m_internalId);
|
||||
XM_GetFeedback(ch->m_internalId,&fb);
|
||||
}
|
||||
while(fb.Status!=XM_STOPPED);
|
||||
// XM_GetFeedback(ch->m_internalId,&fb);
|
||||
// }
|
||||
// while(fb.Status!=XM_STOPPED);
|
||||
XM_Quit(ch->m_internalId);
|
||||
}
|
||||
break;
|
||||
|
@ -705,15 +692,10 @@ void CXMPlaySound::stopPlayingId(xmPlayingId _playingId)
|
|||
break;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
ch->m_useType=SILENT;
|
||||
ch++;
|
||||
}
|
||||
while(ch->m_useType==CONTINUE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(0); // Couldn't find the sound to stop it!
|
||||
}
|
||||
|
||||
|
@ -897,14 +879,6 @@ void CXMPlaySound::markChannelsAsActive(int _baseChannel,int _channelCount,CHANN
|
|||
for(i=_baseChannel;i<_baseChannel+_channelCount-1;i++,ch++)
|
||||
{
|
||||
ch->m_useType=CONTINUE;
|
||||
#ifdef __VERSION_DEBUG__
|
||||
ch->m_internalId=0;
|
||||
ch->m_playingId=NOT_PLAYING;
|
||||
ch->m_priority=0;
|
||||
ch->m_locked=false;
|
||||
ch->m_vol=MIN_VOLUME;
|
||||
ch->m_pan=PAN_CENTRE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue