diff --git a/.travis-build.sh b/.travis-build.sh index 8440b4f5c..80361ddaf 100755 --- a/.travis-build.sh +++ b/.travis-build.sh @@ -23,11 +23,12 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then elif [ "$TRAVIS_OS_NAME" = "osx" ]; then set -o pipefail + export MACOSX_DEPLOYMENT_TARGET=10.9 export Qt5_DIR=$(brew --prefix)/opt/qt5 mkdir build && cd build cmake .. -GXcode - xcodebuild -configuration Release | xcpretty -c + xcodebuild -configuration Release ctest -VV -C Release fi diff --git a/.travis-deps.sh b/.travis-deps.sh index aad9074bf..567a2543d 100755 --- a/.travis-deps.sh +++ b/.travis-deps.sh @@ -9,18 +9,26 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then export CXX=g++-6 mkdir -p $HOME/.local - curl -L http://www.cmake.org/files/v3.2/cmake-3.2.0-Linux-i386.tar.gz \ - | tar -xz -C $HOME/.local --strip-components=1 + if [ ! -e $HOME/.local/bin/cmake ]; then + echo "CMake not found in the cache, get and extract it..." + curl -L http://www.cmake.org/files/v3.2/cmake-3.2.0-Linux-i386.tar.gz \ + | tar -xz -C $HOME/.local --strip-components=1 + else + echo "Using cached CMake" + fi - ( + if [ ! -e $HOME/.local/lib/libSDL2.la ]; then + echo "SDL2 not found in cache, get and build it..." wget http://libsdl.org/release/SDL2-2.0.4.tar.gz -O - | tar xz cd SDL2-2.0.4 ./configure --prefix=$HOME/.local make -j4 && make install - ) + else + echo "Using cached SDL2" + fi + elif [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update > /dev/null # silence the very verbose output - brew unlink cmake + brew unlink cmake || true brew install cmake qt5 sdl2 dylibbundler - gem install xcpretty fi diff --git a/.travis.yml b/.travis.yml index 8be395770..69f9ef273 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ matrix: dist: trusty - os: osx sudo: false + osx_image: xcode7.3 env: global: @@ -25,6 +26,10 @@ addons: - lib32stdc++6 # For CMake - lftp # To upload builds +cache: + directories: + - $HOME/.local + install: ./.travis-deps.sh script: ./.travis-build.sh after_success: ./.travis-upload.sh diff --git a/src/audio_core/codec.cpp b/src/audio_core/codec.cpp index ab65514b7..3e23323f1 100644 --- a/src/audio_core/codec.cpp +++ b/src/audio_core/codec.cpp @@ -58,11 +58,11 @@ StereoBuffer16 DecodeADPCM(const u8* const data, const size_t sample_count, cons size_t outputi = framei * SAMPLES_PER_FRAME; size_t datai = framei * FRAME_LEN + 1; for (size_t i = 0; i < SAMPLES_PER_FRAME && outputi < sample_count; i += 2) { - const s16 sample1 = decode_sample(SIGNED_NIBBLES[data[datai] & 0xF]); + const s16 sample1 = decode_sample(SIGNED_NIBBLES[data[datai] >> 4]); ret[outputi].fill(sample1); outputi++; - const s16 sample2 = decode_sample(SIGNED_NIBBLES[data[datai] >> 4]); + const s16 sample2 = decode_sample(SIGNED_NIBBLES[data[datai] & 0xF]); ret[outputi].fill(sample2); outputi++;