diff options
| author | Steven Fuller <relnev@icculus.org> | 2014-12-25 12:00:00 +0100 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 03:45:24 +0200 |
| commit | 22475d6d94e96056d1550dca00b32d00e3821649 (patch) | |
| tree | 175dbbc8da0704d493fe3cb6024d8117c4f1b27b /src/openal.c | |
| parent | 819e239f23b0c515f32fe0ec8350bdfd8d64c9e9 (diff) | |
Import icculus.org release (2014-12-25)
Diffstat (limited to 'src/openal.c')
| -rw-r--r-- | src/openal.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/openal.c b/src/openal.c index 70418c8..7018255 100644 --- a/src/openal.c +++ b/src/openal.c @@ -3,8 +3,8 @@ #include <string.h> #include <math.h> -#include <AL/al.h> -#include <AL/alc.h> +#include "al.h" +#include "alc.h" #include "fixer.h" @@ -23,6 +23,10 @@ #include <AL/eax.h> #endif +#if 0 +#define OPENAL_DEBUG +#endif + ACTIVESOUNDSAMPLE ActiveSounds[SOUND_MAXACTIVE]; ACTIVESOUNDSAMPLE BlankActiveSound = {SID_NOSOUND,ASP_Minimum,0,0,NULL,0,0,0,0,0, { {0,0,0},{0,0,0},0,0 }, 0, 0, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, NULL, NULL, NULL}; SOUNDSAMPLEDATA BlankGameSound = {0,0,0,0,0,NULL,0,0,NULL,0}; @@ -563,6 +567,7 @@ int PlatPlaySound(int activeIndex) if (ActiveSounds[activeIndex].threedee) { alSourcei(ActiveSounds[activeIndex].ds3DBufferP, AL_SOURCE_RELATIVE, AL_FALSE); + alSourcef(ActiveSounds[activeIndex].ds3DBufferP, AL_REFERENCE_DISTANCE, ActiveSounds[activeIndex].threedeedata.inner_range); // TODO: min distance ActiveSounds[activeIndex].threedeedata.inner_range? // TODO: max distance DS3D_DEFAULTMAXDISTANCE? @@ -865,7 +870,9 @@ void PlatUpdatePlayer() or[5] = -(float) ((Global_VDB_Ptr->VDB_Mat.mat32) / 65536.0F); } - if ((AvP.PlayerType == I_Alien && DopplerShiftIsOn && NormalFrameTime)) { +#warning VELOCITY AND/OR OPENAL SETUP IS IN WRONG UNITS + static int useVel = 0; + if (useVel!=0&&(AvP.PlayerType == I_Alien && DopplerShiftIsOn && NormalFrameTime)) { DYNAMICSBLOCK *dynPtr = Player->ObStrategyBlock->DynPtr; float invFrameTime = 100000.0f/(float)NormalFrameTime; @@ -883,7 +890,7 @@ void PlatUpdatePlayer() pos[2] = Global_VDB_Ptr->VDB_World.vz; // 10000.0; #ifdef OPENAL_DEBUG - fprintf(stderr, "OPENAL: Player: (%f, %f, %f) (%f, %f, %f %f, %f, %f)\n", pos[0], pos[1], pos[2], or[0], or[1], or[2], or[3], or[4], or[5]); + fprintf(stderr, "OPENAL: Player: (%f, %f, %f) (%f, %f, %f %f, %f, %f) (%f, %f, %f)\n", pos[0], pos[1], pos[2], or[0], or[1], or[2], or[3], or[4], or[5], vel[0], vel[1], vel[2]); #endif pos[0] = 0.0f; |
