Skip to content

Commit

Permalink
xrRender_GL: 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 46cadde commit 019969c
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Layers/xrRender/D3DUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void CDrawUtilities::UpdateGrid(int number_of_cell, float square_size, int subdi
m_GridPoints.push_back( right );
}
}
for(i=-m_GridCounts[1]; i<=m_GridCounts[1]; i++){
for(int i=-m_GridCounts[1]; i<=m_GridCounts[1]; i++){
if( (!!thin) != !!(i%m_GridSubDiv[1]) ){
left.p.x = -m_GridCounts[0]*m_GridStep.x;
right.p.x = m_GridCounts[0]*m_GridStep.x;
Expand Down Expand Up @@ -216,7 +216,7 @@ void CDrawUtilities::OnDeviceCreate()
// initialize identity box
Fbox bb;
bb.set(-0.505f,-0.505f,-0.505f, 0.505f,0.505f,0.505f);
for (i=0; i<8; i++){
for (int i=0; i<8; i++){
Fvector S;
Fvector p;
bb.getpoint(i,p);
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/DetailManager_VS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void CDetailManager::hw_Load_Geom()
#else // USE_DX10
R_CHK (hw_VB->Lock(0,0,(void**)&pV,0));
#endif // USE_DX10
for (o=0; o<objects.size(); o++)
for (u32 o=0; o<objects.size(); o++)
{
const CDetail& D = *objects[o];
for (u32 batch=0; batch<hw_BatchSize; batch++)
Expand Down Expand Up @@ -126,7 +126,7 @@ void CDetailManager::hw_Load_Geom()
#else // USE_DX10
R_CHK (hw_IB->Lock(0,0,(void**)(&pI),0));
#endif // USE_DX10
for (o=0; o<objects.size(); o++)
for (u32 o=0; o<objects.size(); o++)
{
const CDetail& D = *objects[o];
u16 offset = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SkeletonAnimated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ void CKinematicsAnimated::IBlend_Startup ()
#endif
}
// cycles+fx clear
for (i=0; i<MAX_PARTS; i++)
for (u32 i=0; i<MAX_PARTS; i++)
blend_cycles[i].clear();
blend_fx.clear ();
ChannelFactorsStartup();
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SkeletonCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void CKinematics::AddWallmark(const Fmatrix* parent_xform, const Fvector3& start
test_sphere.set (cp,size);
U16Vec test_bones;
test_bones.reserve (LL_BoneCount());
for (k=0; k<LL_BoneCount(); k++){
for (u16 k=0; k<LL_BoneCount(); k++){
CBoneData& BD = LL_GetData(k);
if (LL_GetBoneVisible(k)&&!BD.shape.flags.is(SBoneShape::sfNoPickable)){
Fobb& obb = cache_obb[k];
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/WallmarksEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void CWallmarksEngine::RecurseTri(u32 t, Fmatrix &mView, CWallmarksEngine::stati
}

// recurse
for (i=0; i<3; i++)
for (u32 i=0; i<3; i++)
{
u32 adj = sml_adjacency[3*t+i];
if (0xffffffff==adj) continue;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/dxObjectSpaceRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void dxObjectSpaceRender::dbgRender()
}
q_debug.boxes.clear();

for (i=0; i<dbg_S.size(); i++)
for (u32 i=0; i<dbg_S.size(); i++)
{
std::pair<Fsphere,u32>& P = dbg_S[i];
Fsphere& S = P.first;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/dxStatGraphRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void dxStatGraphRender::RenderBack(CStatGraph &owner)
pv->set (owner.rb.x,int(base_y+g_y*owner.grid_step.y*elem_factor),owner.grid_color); pv++;
};

for (g_y=1; g_y<=Num_H_LinesUp; g_y++)
for (int g_y=1; g_y<=Num_H_LinesUp; g_y++)
{
pv->set (owner.lt.x,int(base_y-g_y*owner.grid_step.y*elem_factor),owner.grid_color); pv++;
pv->set (owner.rb.x,int(base_y-g_y*owner.grid_step.y*elem_factor),owner.grid_color); pv++;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_GL/gl_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,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
6 changes: 4 additions & 2 deletions src/Layers/xrRenderPC_GL/gl_rendertarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,12 @@ CRenderTarget::CRenderTarget ()
}
}
}

for (int it3=0; it3<TEX_jitter_count-1; it3++) {
int it3 = 0;
while (it3<TEX_jitter_count-1)
{
CHK_GL (glBindTexture(GL_TEXTURE_2D, t_noise_surf[it3]));
CHK_GL (glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TEX_jitter, TEX_jitter, GL_RGBA, GL_UNSIGNED_BYTE, tempData[it3]));
it3++;
}

float tempDataHBAO[TEX_jitter*TEX_jitter * 4];
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_GL/gl_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 019969c

Please sign in to comment.