From cbb9610a1bac0334cd381a0dbdf816ca80ecbe1f Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Tue, 27 Jul 2021 17:24:01 -0400 Subject: [PATCH] Enable FFmpeg / BinkDec optionality for macOS --- README.md | 5 +++-- neo/libs/libbinkdec/include/FFmpeg_includes.h | 5 +++++ neo/libs/libbinkdec/src/BinkVideo.cpp | 2 +- neo/sys/posix/platform_osx.cpp | 2 +- neo/sys/posix/posix_main.cpp | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a4a15b70..973fefd6 100644 --- a/README.md +++ b/README.md @@ -502,8 +502,7 @@ Recommended in this case is `cmake-vs2017-64bit-windows10.bat` > sudo zypper install cmake libSDL2-devel openal-soft-devel - You don't need FFmpeg to be installed. You can turn it off by adding -DFFMPEG=OFF to the CMake options. - It is enabled by default because the bundled libbinkdec is slow during development if compiled for Debug mode. + You don't need FFmpeg to be installed. You can turn it off by adding -DFFMPEG=OFF and -DBINKDEC=ON to the CMake options. It is enabled by default because the bundled libbinkdec is slow during development if compiled for Debug mode. 2. Generate the Makefiles using CMake: @@ -523,6 +522,8 @@ Recommended in this case is `cmake-vs2017-64bit-windows10.bat` 2. You need the following dependencies in order to compile RBDoom3BFG with all features: > brew install cmake sdl2 openal-soft ffmpeg + + You don't need FFmpeg to be installed. You can turn it off by adding -DFFMPEG=OFF and -DBINKDEC=ON to the CMake options. It is enabled by default because the bundled libbinkdec is slow during development if compiled for Debug mode. 3. Generate the Makefiles using CMake: diff --git a/neo/libs/libbinkdec/include/FFmpeg_includes.h b/neo/libs/libbinkdec/include/FFmpeg_includes.h index 21d0f3fc..2e4dde6f 100644 --- a/neo/libs/libbinkdec/include/FFmpeg_includes.h +++ b/neo/libs/libbinkdec/include/FFmpeg_includes.h @@ -56,8 +56,13 @@ #else // DG: add alternative that should work with at least GCC and clang #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v #endif +// SRS - Add guards to prevent override of standard math defines +#ifndef M_PI #define M_PI 3.14159265358979323846 /* pi */ +#endif +#ifndef M_SQRT1_2 #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#endif #define HAVE_MMX 0 #define ARCH_ARM 0 diff --git a/neo/libs/libbinkdec/src/BinkVideo.cpp b/neo/libs/libbinkdec/src/BinkVideo.cpp index 976b9184..35acdc07 100644 --- a/neo/libs/libbinkdec/src/BinkVideo.cpp +++ b/neo/libs/libbinkdec/src/BinkVideo.cpp @@ -452,7 +452,7 @@ int BinkDecoder::ReadDCs(BinkCommon::BitReader &bits, Bundle *b, int start_bits, v += v2; *dst++ = v; if (v < -32768 || v > 32767) { - BinkCommon::LogError("DC value went out of bounds" + v); + BinkCommon::LogError("DC value went out of bounds: " + std::to_string(v)); return -1; } } diff --git a/neo/sys/posix/platform_osx.cpp b/neo/sys/posix/platform_osx.cpp index 00c49ebd..c35c5162 100644 --- a/neo/sys/posix/platform_osx.cpp +++ b/neo/sys/posix/platform_osx.cpp @@ -26,7 +26,7 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -//#include "../../idlib/precompiled.h" +#include "../../idlib/precompiled.h" #include "../posix/posix_public.h" //#include "../sys_local.h" diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp index c26ebba4..0bd33b05 100644 --- a/neo/sys/posix/posix_main.cpp +++ b/neo/sys/posix/posix_main.cpp @@ -50,7 +50,7 @@ If you have questions concerning this license or the applicable additional terms #endif #if defined(__APPLE__) - #include + #include #endif #include