This commit is contained in:
Бранимир Караџић
2024-12-07 22:49:45 -08:00
parent f6baa4bdaf
commit 042ebe8814
31 changed files with 110 additions and 110 deletions

View File

@@ -120,7 +120,7 @@ static const uint64_t s_ptState[]
BGFX_STATE_PT_LINESTRIP,
BGFX_STATE_PT_POINTS,
};
BX_STATIC_ASSERT(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) );
static_assert(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) );
class ExampleCubes : public entry::AppI
{

View File

@@ -77,7 +77,7 @@ static PosTexcoordVertex s_cubeVertices[] =
{-1.0f, -1.0f, 1.0f, -2.0f, -2.0f, 2.0f },
{ 1.0f, -1.0f, 1.0f, 2.0f, -2.0f, 2.0f },
};
BX_STATIC_ASSERT(BX_COUNTOF(s_cubeVertices) == 28);
static_assert(BX_COUNTOF(s_cubeVertices) == 28);
static const uint16_t s_cubeIndices[] =
{
@@ -99,7 +99,7 @@ static const uint16_t s_cubeIndices[] =
20, 22, 21, // 10
21, 22, 23,
};
BX_STATIC_ASSERT(BX_COUNTOF(s_cubeIndices) == 36);
static_assert(BX_COUNTOF(s_cubeIndices) == 36);
bx::Vec3 s_faceColors[] =
{
@@ -295,7 +295,7 @@ public:
m_textures[22] = loadTextureWithUpdate("textures/texture_compression_atci.dds");
m_textures[23] = loadTextureWithUpdate("textures/texture_compression_atce.dds");
BX_STATIC_ASSERT(24 == BX_COUNTOF(m_textures));
static_assert(24 == BX_COUNTOF(m_textures));
const bgfx::Caps* caps = bgfx::getCaps();
m_texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D);
@@ -754,7 +754,7 @@ public:
"compute",
"frameBuffer",
};
BX_STATIC_ASSERT(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube));
static_assert(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube));
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textureCube); ++ii)
{
@@ -847,7 +847,7 @@ public:
"update\natci",
"update\natce",
};
BX_STATIC_ASSERT(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures));
static_assert(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures));
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
{
@@ -878,7 +878,7 @@ public:
"Tex3D R16F",
"Tex3D R32F",
};
BX_STATIC_ASSERT(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d));
static_assert(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d));
for (uint32_t ii = 0; ii < m_numTextures3d; ++ii)
{

View File

@@ -81,7 +81,7 @@ static const char* s_easeFuncName[] =
"InOutBounce",
"OutInBounce",
};
BX_STATIC_ASSERT(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count);
static_assert(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count);
struct Emitter
{

View File

@@ -527,7 +527,7 @@ public:
m_temporaryColor.m_buffer,
m_currentColor.m_buffer,
};
BX_STATIC_ASSERT(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES);
static_assert(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES);
const uint32_t denoisePasses = bx::min(DENOISE_MAX_PASSES, m_denoisePasses);

View File

@@ -1505,7 +1505,7 @@ struct DebugDrawEncoderImpl
}
else
{
BX_STATIC_ASSERT(sizeof(DdVertex) == sizeof(bx::Vec3), "");
static_assert(sizeof(DdVertex) == sizeof(bx::Vec3), "");
uint64_t old = attrib.m_state;
attrib.m_state &= ~BGFX_STATE_CULL_MASK;
@@ -2241,7 +2241,7 @@ struct DebugDrawEncoderImpl
static const uint32_t kCacheSize = 1024;
static const uint32_t kStackSize = 16;
static const uint32_t kCacheQuadSize = 1024;
BX_STATIC_ASSERT(kCacheSize >= 3, "Cache must be at least 3 elements.");
static_assert(kCacheSize >= 3, "Cache must be at least 3 elements.");
DebugVertex m_cache[kCacheSize+1];
DebugUvVertex m_cacheQuad[kCacheQuadSize];
@@ -2281,7 +2281,7 @@ struct DebugDrawEncoderImpl
};
static DebugDrawEncoderImpl s_dde;
BX_STATIC_ASSERT(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match");
static_assert(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match");
void ddInit(bx::AllocatorI* _allocator)
{

View File

@@ -118,7 +118,7 @@ s_getFileNameA[] =
{ GetOpenFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 | /* OFN_FILEMUSTEXIST */ 0x00001000 },
{ GetSaveFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 },
};
BX_STATIC_ASSERT(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count);
static_assert(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count);
#endif
#if !BX_PLATFORM_OSX

View File

@@ -185,7 +185,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
"GamepadStart",
"GamepadGuide",
};
BX_STATIC_ASSERT(Key::Count == BX_COUNTOF(s_keyName) );
static_assert(Key::Count == BX_COUNTOF(s_keyName) );
const char* getName(Key::Enum _key)
{
@@ -455,7 +455,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
AppI::AppI(const char* _name, const char* _description, const char* _url)
{
BX_STATIC_ASSERT(sizeof(AppInternal) <= sizeof(m_internal) );
static_assert(sizeof(AppInternal) <= sizeof(m_internal) );
s_offset = BX_OFFSETOF(AppI, m_internal);
AppInternal* ai = (AppInternal*)m_internal;

View File

@@ -81,7 +81,7 @@ namespace entry
{ Key::GamepadUp, Key::GamepadDown },
{ Key::None, Key::None },
};
BX_STATIC_ASSERT(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
static_assert(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
struct Joystick
{