- Changed FMOD init() to allocate some virtual channels.

SVN r1387 (trunk)
This commit is contained in:
Randy Heit 2009-02-01 04:10:36 +00:00
parent b680840073
commit 07a2da40f1
3 changed files with 13 additions and 6 deletions

View file

@ -1,4 +1,5 @@
January 31, 2009
- Changed FMOD init() to allocate some virtual channels.
- Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test.
January 30, 2009

View file

@ -163,7 +163,8 @@ void S_NoiseDebug (void)
screen->DrawText (SmallFont, CR_GOLD, 220, y, "vol", TAG_DONE);
screen->DrawText (SmallFont, CR_GOLD, 260, y, "dist", TAG_DONE);
screen->DrawText (SmallFont, CR_GOLD, 300, y, "chan", TAG_DONE);
screen->DrawText (SmallFont, CR_GOLD, 340, y, "flags", TAG_DONE);
screen->DrawText (SmallFont, CR_GOLD, 340, y, "pri", TAG_DONE);
screen->DrawText (SmallFont, CR_GOLD, 380, y, "flags", TAG_DONE);
y += 8;
if (Channels == NULL)
@ -231,6 +232,10 @@ void S_NoiseDebug (void)
mysnprintf(temp, countof(temp), "%d", chan->EntChannel);
screen->DrawText(SmallFont, color, 300, y, temp, TAG_DONE);
// Priority
mysnprintf(temp, countof(temp), "%d", chan->Priority);
screen->DrawText(SmallFont, color, 340, y, temp, TAG_DONE);
// Flags
mysnprintf(temp, countof(temp), "%s3%sZ%sU%sM%sN%sA%sL%sE",
(chan->ChanFlags & CHAN_IS3D) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
@ -241,7 +246,7 @@ void S_NoiseDebug (void)
(chan->ChanFlags & CHAN_AREA) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
(chan->ChanFlags & CHAN_LOOP) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
(chan->ChanFlags & CHAN_EVICTED) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK);
screen->DrawText(SmallFont, color, 340, y, temp, TAG_DONE);
screen->DrawText(SmallFont, color, 380, y, temp, TAG_DONE);
y += 8;
if (chan->PrevChan == &Channels)
@ -940,7 +945,7 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO
// Select priority.
if (type == SOURCE_None || actor == players[consoleplayer].camera)
{
basepriority = 40;
basepriority = 80;
}
else
{
@ -1664,7 +1669,7 @@ void S_EvictAllChannels()
{
S_StopChannel(chan);
}
assert(chan->NextChan == next);
// assert(chan->NextChan == next);
}
}
}

View file

@ -805,7 +805,7 @@ bool FMODSoundRenderer::Init()
}
for (;;)
{
result = Sys->init(snd_channels + NUM_EXTRA_SOFTWARE_CHANNELS, initflags, 0);
result = Sys->init(MAX(*snd_channels, MAX_CHANNELS), initflags, 0);
if (result == FMOD_ERR_OUTPUT_CREATEBUFFER)
{
// Possible causes of a buffer creation failure:
@ -1435,7 +1435,7 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener *
GDistScale = distscale;
// Experiments indicate that playSound will ignore priorities and always succeed
// as long as the paremeters are set properly. It will first try to kick out sounds
// as long as the parameters are set properly. It will first try to kick out sounds
// with the same priority level but has no problem with kicking out sounds at
// higher priority levels if it needs to.
result = Sys->playSound(FMOD_CHANNEL_FREE, (FMOD::Sound *)sfx.data, true, &chan);
@ -1488,6 +1488,7 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener *
return NULL;
}
chan->setPaused(false);
chan->getPriority(&def_priority);
FISoundChannel *schan = CommonChannelSetup(chan, reuse_chan);
schan->Rolloff = *rolloff;
return schan;