From 9bed2ac33a3c5d6dfa0484ebaf07fe9c5728a15e Mon Sep 17 00:00:00 2001 From: rcoaxil Date: Tue, 18 Oct 2016 05:33:34 +0300 Subject: [PATCH] moved back update cycle constant looping override for static sources --HG-- branch : minor --- src/libraries/stb/stb_image.h | 5 +++++ src/modules/audio/openal/Source.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/libraries/stb/stb_image.h b/src/libraries/stb/stb_image.h index fd4c872bc..93600d783 100644 --- a/src/libraries/stb/stb_image.h +++ b/src/libraries/stb/stb_image.h @@ -712,9 +712,14 @@ static int stbi__sse2_available() static int stbi__sse2_available() { +/* #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later // GCC 4.8+ has a nice way to do this return __builtin_cpu_supports("sse2"); +*/ +#if defined(STBI__X64_TARGET) + // GCC 5 has this function buggy for a moment, but an x64 CPU can be assumed to have SSE2 anyway + return 1; #else // portable way to do this, preferably without using GCC inline ASM? // just bail for now. diff --git a/src/modules/audio/openal/Source.cpp b/src/modules/audio/openal/Source.cpp index 55148b78e..e17f80b80 100644 --- a/src/modules/audio/openal/Source.cpp +++ b/src/modules/audio/openal/Source.cpp @@ -280,7 +280,12 @@ bool Source::update() switch (type) { case TYPE_STATIC: + { + // Looping mode could have changed. +- // FIXME: make looping mode change atomically so this is not needed + alSourcei(source, AL_LOOPING, isLooping() ? AL_TRUE : AL_FALSE); return !isFinished(); + } case TYPE_STREAM: if (!isFinished()) {