Fixed variable shadowing.
This commit is contained in:
parent
250777287f
commit
1e8051fd00
5 changed files with 28 additions and 26 deletions
examples
14-shadowvolumes
15-shadowmaps-simple
16-shadowmaps
common/entry
src
|
@ -675,7 +675,7 @@ struct HalfEdges
|
|||
m_offsets[ii] = uint32_t(he - m_data);
|
||||
|
||||
std::vector<uint16_t>& row = edges[ii];
|
||||
for (uint32_t jj = 0, end = (uint32_t)row.size(); jj < end; ++jj)
|
||||
for (uint32_t jj = 0, size = (uint32_t)row.size(); jj < size; ++jj)
|
||||
{
|
||||
he->m_secondIndex = row[jj];
|
||||
he->m_marked = false;
|
||||
|
|
|
@ -186,8 +186,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
float view[16];
|
||||
float proj[16];
|
||||
|
||||
const float eye[3] = { 0.0f, 30.0f, -60.0f };
|
||||
const float at[3] = { 0.0f, 5.0f, 0.0f };
|
||||
float eye[3] = { 0.0f, 30.0f, -60.0f };
|
||||
float at[3] = { 0.0f, 5.0f, 0.0f };
|
||||
bx::mtxLookAt(view, eye, at);
|
||||
|
||||
const float aspect = float(int32_t(width) ) / float(int32_t(height) );
|
||||
|
@ -261,13 +261,14 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
float lightView[16];
|
||||
float lightProj[16];
|
||||
|
||||
const float eye[3] =
|
||||
{
|
||||
-lightPos[0],
|
||||
-lightPos[1],
|
||||
-lightPos[2],
|
||||
};
|
||||
const float at[3] = { 0.0f, 0.0f, 0.0f };
|
||||
eye[0] = -lightPos[0];
|
||||
eye[0] = -lightPos[1];
|
||||
eye[0] = -lightPos[2];
|
||||
|
||||
at[0] = 0.0f;
|
||||
at[1] = 0.0f;
|
||||
at[2] = 0.0f;
|
||||
|
||||
bx::mtxLookAt(lightView, eye, at);
|
||||
|
||||
const float area = 30.0f;
|
||||
|
|
|
@ -2452,10 +2452,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
}
|
||||
|
||||
// Determine on-screen rectangle size where depth buffer will be drawn.
|
||||
const uint16_t depthRectHeight = uint16_t(float(viewState.m_height) / 2.5f);
|
||||
const uint16_t depthRectWidth = depthRectHeight;
|
||||
const uint16_t depthRectX = 0;
|
||||
const uint16_t depthRectY = viewState.m_height - depthRectHeight;
|
||||
uint16_t depthRectHeight = uint16_t(float(viewState.m_height) / 2.5f);
|
||||
uint16_t depthRectWidth = depthRectHeight;
|
||||
uint16_t depthRectX = 0;
|
||||
uint16_t depthRectY = viewState.m_height - depthRectHeight;
|
||||
|
||||
// Setup views and render targets.
|
||||
bgfx::setViewRect(0, 0, 0, viewState.m_width, viewState.m_height);
|
||||
|
@ -2583,10 +2583,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
* RENDERVIEW_DRAWDEPTH_3_ID - Draw depth buffer for fourth split.
|
||||
*/
|
||||
|
||||
const uint16_t depthRectHeight = viewState.m_height / 3;
|
||||
const uint16_t depthRectWidth = depthRectHeight;
|
||||
const uint16_t depthRectX = 0;
|
||||
const uint16_t depthRectY = viewState.m_height - depthRectHeight;
|
||||
depthRectHeight = viewState.m_height / 3;
|
||||
depthRectWidth = depthRectHeight;
|
||||
depthRectX = 0;
|
||||
depthRectY = viewState.m_height - depthRectHeight;
|
||||
|
||||
bgfx::setViewRect(RENDERVIEW_SHADOWMAP_1_ID, 0, 0, currentShadowMapSize, currentShadowMapSize);
|
||||
bgfx::setViewRect(RENDERVIEW_SHADOWMAP_2_ID, 0, 0, currentShadowMapSize, currentShadowMapSize);
|
||||
|
@ -2795,10 +2795,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
);
|
||||
|
||||
// Trees.
|
||||
for (uint8_t ii = 0; ii < numTrees; ++ii)
|
||||
for (uint8_t jj = 0; jj < numTrees; ++jj)
|
||||
{
|
||||
treeMesh.submit(viewId
|
||||
, mtxTrees[ii]
|
||||
, mtxTrees[jj]
|
||||
, *currentSmSettings->m_progPack
|
||||
, s_renderStates[renderStateIndex]
|
||||
);
|
||||
|
@ -2851,7 +2851,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
float mtxShadow[16];
|
||||
|
||||
const float ymul = (s_flipV) ? 0.5f : -0.5f;
|
||||
const float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
|
||||
float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
|
||||
|
||||
const float mtxBias[16] =
|
||||
{
|
||||
|
@ -2870,7 +2870,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
else if (LightType::PointLight == settings.m_lightType)
|
||||
{
|
||||
const float s = (s_flipV) ? 1.0f : -1.0f; //sign
|
||||
const float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
|
||||
zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f;
|
||||
|
||||
const float mtxCropBias[2][TetrahedronFaces::Count][16] =
|
||||
{
|
||||
|
|
|
@ -29,11 +29,12 @@ namespace entry
|
|||
#if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
|
||||
bx::ReallocatorI* getDefaultAllocator()
|
||||
{
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH_MSVC();
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH();
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4459); // warning C4459: declaration of 's_allocator' hides global declaration
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow");
|
||||
static bx::CrtAllocator s_allocator;
|
||||
return &s_allocator;
|
||||
BX_PRAGMA_DIAGNOSTIC_POP_MSVC();
|
||||
BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
}
|
||||
#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
|
||||
|
||||
|
|
|
@ -1768,9 +1768,9 @@ namespace bgfx
|
|||
|
||||
if (0 < m_free.size() )
|
||||
{
|
||||
Free free = m_free.front();
|
||||
Free freeBlock = m_free.front();
|
||||
m_free.pop_front();
|
||||
return free.m_ptr;
|
||||
return freeBlock.m_ptr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Reference in a new issue