Sync with latest BGFX and BX (nw)

This commit is contained in:
Miodrag Milanovic 2015-02-15 20:15:27 +01:00
parent 3878550501
commit 925035f8f7
4 changed files with 11 additions and 12 deletions

View File

@ -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 )
{

View File

@ -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 <freetype/freetype.h>
#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();

View File

@ -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 },

View File

@ -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