From 925035f8f7da79ed013529702942a1b8d3ba7d68 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Feb 2015 20:15:27 +0100 Subject: Sync with latest BGFX and BX (nw) --- 3rdparty/bgfx/3rdparty/ib-compress/readbitstream.h | 8 +------- 3rdparty/bgfx/examples/common/font/font_manager.cpp | 4 ++-- 3rdparty/bgfx/src/image.cpp | 5 +++++ 3rdparty/bx/include/bx/macros.h | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/3rdparty/bgfx/3rdparty/ib-compress/readbitstream.h b/3rdparty/bgfx/3rdparty/ib-compress/readbitstream.h index 4dfc4f92c4c..1e2f0f33fd1 100644 --- a/3rdparty/bgfx/3rdparty/ib-compress/readbitstream.h +++ b/3rdparty/bgfx/3rdparty/ib-compress/readbitstream.h @@ -95,16 +95,10 @@ inline ReadBitstream::ReadBitstream( const uint8_t* buffer, size_t bufferSize ) } } -#if defined(__GNUC__) || defined(_MSC_VER) -#define U64(val) val##ULL -#else -#define U64(val) val -#endif - RBS_INLINE uint32_t ReadBitstream::Read( uint32_t bitCount ) { uint64_t mask = ( uint64_t( 1 ) << bitCount ) - 1; - uint32_t result = static_cast< uint32_t >( ( m_bitBuffer >> ( 64 - m_bitsLeft ) & ( m_bitsLeft == 0 ? 0 : U64(0xFFFFFFFFFFFFFFFF) ) ) & mask ); + uint32_t result = static_cast< uint32_t >( ( m_bitBuffer >> ( 64 - m_bitsLeft ) & ( m_bitsLeft == 0 ? 0 : UINT64_C(0xFFFFFFFFFFFFFFFF) ) ) & mask ); if ( m_bitsLeft < bitCount ) { diff --git a/3rdparty/bgfx/examples/common/font/font_manager.cpp b/3rdparty/bgfx/examples/common/font/font_manager.cpp index 9717f5d465d..8532a534e03 100644 --- a/3rdparty/bgfx/examples/common/font/font_manager.cpp +++ b/3rdparty/bgfx/examples/common/font/font_manager.cpp @@ -13,12 +13,12 @@ BX_PRAGMA_DIAGNOSTIC_PUSH(); BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4245) // error C4245: '=' : conversion from 'int' to 'FT_UInt', signed/unsigned mismatch -#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) +#if BX_COMPILER_MSVC || BX_COMPILER_GCC >= 40300 #pragma push_macro("interface") #endif #undef interface #include -#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) +#if BX_COMPILER_MSVC || BX_COMPILER_GCC >= 40300 #pragma pop_macro("interface") #endif BX_PRAGMA_DIAGNOSTIC_POP(); diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp index ed3b7ca8343..6091a466af0 100644 --- a/3rdparty/bgfx/src/image.cpp +++ b/3rdparty/bgfx/src/image.cpp @@ -1391,6 +1391,11 @@ namespace bgfx static TranslateDdsPixelFormat s_translateDdsPixelFormat[] = { + { 8, { 0x000000ff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R8 }, + { 16, { 0x0000ffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R16 }, + { 16, { 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }, TextureFormat::RGBA4 }, + { 16, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5 }, + { 16, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 }, { 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, TextureFormat::BGRA8 }, { 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8 }, { 32, { 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 }, TextureFormat::RGB10A2 }, diff --git a/3rdparty/bx/include/bx/macros.h b/3rdparty/bx/include/bx/macros.h index d2a9826c4fc..b50cfc57f33 100644 --- a/3rdparty/bx/include/bx/macros.h +++ b/3rdparty/bx/include/bx/macros.h @@ -138,7 +138,7 @@ # define BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x) #endif // BX_COMPILER_CLANG -#if BX_COMPILER_GCC && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6) +#if BX_COMPILER_GCC && BX_COMPILER_GCC >= 40600 # define BX_PRAGMA_DIAGNOSTIC_PUSH_GCC() _Pragma("GCC diagnostic push") # define BX_PRAGMA_DIAGNOSTIC_POP_GCC() _Pragma("GCC diagnostic pop") # define BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x) _Pragma(BX_STRINGIZE(GCC diagnostic ignored _x) ) @@ -173,9 +173,9 @@ #endif // BX_COMPILER_ /// -#if defined(__GNUC__) && defined(__is_pod) +#if BX_COMPILER_GCC && defined(__is_pod) # define BX_TYPE_IS_POD(t) __is_pod(t) -#elif defined(_MSC_VER) +#elif BX_COMPILER_MSVC # define BX_TYPE_IS_POD(t) (!__is_class(t) || __is_pod(t)) #else # define BX_TYPE_IS_POD(t) false -- cgit v1.2.3