Skip to content

Commit

Permalink
xrRender_R3: Fix conformance in For loop scope (#104).
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Jan 16, 2016
1 parent 993864c commit d9f033d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void dx10SamplerStateCache::CreateState( StateDecs desc, IDeviceState** ppIState
dx10SamplerStateCache::SHandle dx10SamplerStateCache::FindState( const StateDecs& desc, u32 StateCRC )
{
u32 res = 0xffffffff;
for (u32 i=0; i<m_StateArray.size(); ++i)
u32 i = 0;
while (i<m_StateArray.size())
{
if (m_StateArray[i].m_crc==StateCRC)
{
Expand All @@ -72,6 +73,7 @@ dx10SamplerStateCache::SHandle dx10SamplerStateCache::FindState( const StateDecs
// VERIFY(0);
//}
}
i++;
}

return res != 0xffffffff ? i : (u32)hInvalidHandle;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R3/r3_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void CRender::LoadSectors(IReader* fs)
{
CDB::Collector CL;
fs->find_chunk (fsL_PORTALS);
for (i=0; i<count; i++)
for (u32 i=0; i<count; i++)
{
b_portal P;
fs->r (&P,sizeof(P));
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R3/r3_rendertarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ CRenderTarget::CRenderTarget ()
descHBAO.CPUAccessFlags = 0;
descHBAO.MiscFlags = 0;

it = TEX_jitter_count-1;
int it = TEX_jitter_count-1;
subData[it].pSysMem = tempDataHBAO;
subData[it].SysMemPitch = descHBAO.Width*sampleSize * sizeof(float);

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R3/r3_rendertarget_phase_bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void CalcGauss_k7(
// calculate
float mag = 0;
for (int i=-7; i<=0; i++) W[-i] = expf (-float(i*i)/(2*r*r)); // weight
for (i=0; i<8; i++) mag += i?2*W[i]:W[i]; // symmetrical weight
for (i=0; i<8; i++) W[i] = s_out*W[i]/mag;
for (int i=0; i<8; i++) mag += i?2*W[i]:W[i]; // symmetrical weight
for (int i=0; i<8; i++) W[i] = s_out*W[i]/mag;

// W[0]=0, W[7]=-7
w0.set (W[1],W[2],W[3],W[4]); // -1, -2, -3, -4
Expand Down

0 comments on commit d9f033d

Please sign in to comment.