- removed a few obsolete definitions from basictypes.h

# Conflicts:
#	src/win32/i_specialpaths.cpp
This commit is contained in:
Christoph Oelckers 2019-06-26 22:13:12 +02:00 committed by drfrag
parent 1697e6ff3a
commit 9c25d75f65
4 changed files with 13 additions and 29 deletions

View file

@ -17,19 +17,6 @@ typedef struct _GUID
} GUID;
#endif
union QWORD_UNION
{
uint64_t AsOne;
struct
{
#ifdef __BIG_ENDIAN__
unsigned int Hi, Lo;
#else
unsigned int Lo, Hi;
#endif
};
};
//
// fixed point, 32bit as 16.16.
//
@ -41,9 +28,6 @@ typedef int32_t fixed_t;
#define FIXED_MAX (signed)(0x7fffffff)
#define FIXED_MIN (signed)(0x80000000)
#define DWORD_MIN ((uint32_t)0)
#define DWORD_MAX ((uint32_t)0xffffffff)
// the last remnants of tables.h
#define ANGLE_90 (0x40000000)
#define ANGLE_180 (0x80000000)

View file

@ -2089,7 +2089,7 @@ void S_EvictAllChannels()
{
if (!(chan->ChanFlags & CHAN_ABSTIME))
{
chan->StartTime.AsOne = GSnd ? GSnd->GetPosition(chan) : 0;
chan->StartTime = GSnd ? GSnd->GetPosition(chan) : 0;
chan->ChanFlags |= CHAN_ABSTIME;
}
S_StopChannel(chan);
@ -2417,7 +2417,7 @@ static FSerializer &Serialize(FSerializer &arc, const char *key, FSoundChan &cha
("entchannel", chan.EntChannel)
("priority", chan.Priority)
("nearlimit", chan.NearLimit)
("starttime", chan.StartTime.AsOne)
("starttime", chan.StartTime)
("rolloftype", chan.Rolloff.RolloffType)
("rolloffmin", chan.Rolloff.MinDistance)
("rolloffmax", chan.Rolloff.MaxDistance)
@ -2471,10 +2471,10 @@ void S_SerializeSounds(FSerializer &arc)
for (unsigned int i = chans.Size(); i-- != 0; )
{
// Replace start time with sample position.
uint64_t start = chans[i]->StartTime.AsOne;
chans[i]->StartTime.AsOne = GSnd ? GSnd->GetPosition(chans[i]) : 0;
uint64_t start = chans[i]->StartTime;
chans[i]->StartTime = GSnd ? GSnd->GetPosition(chans[i]) : 0;
arc(nullptr, *chans[i]);
chans[i]->StartTime.AsOne = start;
chans[i]->StartTime = start;
}
arc.EndArray();
}

View file

@ -101,7 +101,7 @@ struct SoundHandle
struct FISoundChannel
{
void *SysChannel; // Channel information from the system interface.
QWORD_UNION StartTime; // Sound start time in DSP clocks.
uint64_t StartTime; // Sound start time in DSP clocks.
// The sound interface doesn't use these directly but it needs to pass them to a
// callback that can't be passed a sound channel pointer

View file

@ -1609,17 +1609,17 @@ FISoundChannel *OpenALSoundRenderer::StartSound(SoundHandle sfx, float vol, int
else
alSourcef(source, AL_PITCH, PITCH(pitch));
if(!reuse_chan || reuse_chan->StartTime.AsOne == 0)
if(!reuse_chan || reuse_chan->StartTime == 0)
alSourcef(source, AL_SEC_OFFSET, 0.f);
else
{
if((chanflags&SNDF_ABSTIME))
alSourcei(source, AL_SAMPLE_OFFSET, reuse_chan->StartTime.Lo);
alSourcei(source, AL_SAMPLE_OFFSET, ALint(reuse_chan->StartTime));
else
{
float offset = std::chrono::duration_cast<std::chrono::duration<float>>(
std::chrono::steady_clock::now().time_since_epoch() -
std::chrono::steady_clock::time_point::duration(reuse_chan->StartTime.AsOne)
std::chrono::steady_clock::time_point::duration(reuse_chan->StartTime)
).count();
if(offset > 0.f) alSourcef(source, AL_SEC_OFFSET, offset);
}
@ -1820,17 +1820,17 @@ FISoundChannel *OpenALSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener
else
alSourcef(source, AL_PITCH, PITCH(pitch));
if(!reuse_chan || reuse_chan->StartTime.AsOne == 0)
if(!reuse_chan || reuse_chan->StartTime == 0)
alSourcef(source, AL_SEC_OFFSET, 0.f);
else
{
if((chanflags&SNDF_ABSTIME))
alSourcei(source, AL_SAMPLE_OFFSET, reuse_chan->StartTime.Lo);
alSourcei(source, AL_SAMPLE_OFFSET, ALint(reuse_chan->StartTime));
else
{
float offset = std::chrono::duration_cast<std::chrono::duration<float>>(
std::chrono::steady_clock::now().time_since_epoch() -
std::chrono::steady_clock::time_point::duration(reuse_chan->StartTime.AsOne)
std::chrono::steady_clock::time_point::duration(reuse_chan->StartTime)
).count();
if(offset > 0.f) alSourcef(source, AL_SEC_OFFSET, offset);
}
@ -2227,7 +2227,7 @@ void OpenALSoundRenderer::MarkStartTime(FISoundChannel *chan)
{
// FIXME: Get current time (preferably from the audio clock, but the system
// time will have to do)
chan->StartTime.AsOne = std::chrono::steady_clock::now().time_since_epoch().count();
chan->StartTime = std::chrono::steady_clock::now().time_since_epoch().count();
}
float OpenALSoundRenderer::GetAudibility(FISoundChannel *chan)