- Switched sounds local to the listener from head-relative 3D sounds to 2D

sounds so stereo sounds have full separation. I tried using set3DSpread,
  but that still caused some blending of the channels.


SVN r875 (trunk)
This commit is contained in:
Randy Heit 2008-04-03 03:43:41 +00:00
parent d2c275bbb3
commit 799a4ea1bb
2 changed files with 9 additions and 12 deletions

View file

@ -1,4 +1,7 @@
April 2, 2008 April 2, 2008
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name - Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in the same lump name no longer involves any degree of guesswork in

View file

@ -1191,7 +1191,7 @@ FMOD_MODE FMODSoundRenderer::SetChanHeadSettings(FMOD::Channel *chan, sfxinfo_t
{ {
return oldmode; return oldmode;
} }
double cpos[3]; float cpos[3];
cpos[0] = FIXED2FLOAT(players[consoleplayer].camera->x); cpos[0] = FIXED2FLOAT(players[consoleplayer].camera->x);
cpos[2] = FIXED2FLOAT(players[consoleplayer].camera->y); cpos[2] = FIXED2FLOAT(players[consoleplayer].camera->y);
cpos[1] = FIXED2FLOAT(players[consoleplayer].camera->z); cpos[1] = FIXED2FLOAT(players[consoleplayer].camera->z);
@ -1226,11 +1226,11 @@ FMOD_MODE FMODSoundRenderer::SetChanHeadSettings(FMOD::Channel *chan, sfxinfo_t
return oldmode; return oldmode;
} }
else if (cpos[0] == pos[0] && cpos[1] == pos[1] && cpos[2] == pos[2]) else if (cpos[0] == pos[0] && cpos[1] == pos[1] && cpos[2] == pos[2])
{ { // Head relative
pos[2] = pos[1] = pos[0] = 0; return (oldmode & ~FMOD_3D) | FMOD_2D;
return (oldmode & ~FMOD_3D_WORLDRELATIVE) | FMOD_3D_HEADRELATIVE;
} }
return (oldmode & ~FMOD_3D_HEADRELATIVE) | FMOD_3D_WORLDRELATIVE; // World relative
return (oldmode & ~FMOD_2D) | FMOD_3D;
} }
//========================================================================== //==========================================================================
@ -1556,15 +1556,9 @@ void FMODSoundRenderer::DoLoad(void **slot, sfxinfo_t *sfx)
exinfo.length = size; exinfo.length = size;
} }
result = Sys->createSound((char *)sfxstart, samplemode, &exinfo, &sample); result = Sys->createSound((char *)sfxstart, samplemode, &exinfo, &sample);
if (result == FMOD_ERR_OUTPUT_CREATEBUFFER && !(samplemode & FMOD_SOFTWARE))
{
DPrintf("Trying to fall back to software sample\n");
samplemode = (samplemode & ~FMOD_HARDWARE) | FMOD_SOFTWARE;
result = Sys->createSound((char *)sfxstart, samplemode, &exinfo, &sample);
}
if (result != FMOD_OK) if (result != FMOD_OK)
{ {
DPrintf("Failed to allocate sample: %d\n", result); DPrintf("Failed to allocate sample: Error %d\n", result);
errcount++; errcount++;
continue; continue;
} }