Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Code/WWAudio/openal/OpenALHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ float OpenALHandleClass::Get_Sample_Volume()
void OpenALHandleClass::Set_Sample_Loop_Count(unsigned count)
{
WWDEBUG_SAY(("Sample %s requested to loop %u times.\n", Buffer != nullptr ? Buffer->Get_Filename() : "<null>", count));
SampleLoopCount = count == 0 ? UINT_MAX : count;
SampleLoopCount = count == 0 ? INFINITE_LOOP_COUNT : count;
if (Buffer != nullptr && !Buffer->Is_Streaming()) {
alSourcei(SampleHandle, AL_LOOPING, count == 0 ? AL_TRUE : AL_FALSE);
}
Expand Down
6 changes: 4 additions & 2 deletions Code/WWAudio/openal/OpenALHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "soundhandle.h"

#include <AL/al.h>
#include <limits>
#include <unordered_map>
#include <vector>

Expand All @@ -40,7 +41,8 @@ class OpenALHandleClass final : public SoundHandleClass
{
friend class OpenALAudioClass;
static constexpr ALsizei OAL_BUFFER_COUNT = 4;
static constexpr ALuint INVALID_OAL_HANDLE = UINT_MAX;
static constexpr ALuint INVALID_OAL_HANDLE = std::numeric_limits<ALuint>::max();
static constexpr unsigned INFINITE_LOOP_COUNT = std::numeric_limits<unsigned>::max();

public:
OpenALHandleClass();
Expand Down Expand Up @@ -81,7 +83,7 @@ class OpenALHandleClass final : public SoundHandleClass
void Clear_Static_Buffer();
void Reset_Stream_State();
unsigned int Buffer_Duration_MS(unsigned int bytes) const;
bool Is_Infinite_Loop() const { return SampleLoopCount == UINT_MAX; }
bool Is_Infinite_Loop() const { return SampleLoopCount == INFINITE_LOOP_COUNT; }

static void Set_Sample_User(ALuint handle, AudibleSoundClass *user = nullptr);
static AudibleSoundClass *Get_Sample_User(ALuint handle);
Expand Down
Loading