1
0
forked from 0ad/0ad

just moved the variable declaration out of the for loops when the same was used twice. vc6 doesn't like it since it doesn't scope the for-header.

This was SVN commit r145.
This commit is contained in:
Gee 2003-12-27 07:24:41 +00:00
parent a08cbd2f74
commit ff393423f5
3 changed files with 13 additions and 7 deletions

View File

@ -25,11 +25,13 @@ CPatch::~CPatch ()
//Initialize the patch
void CPatch::Initialize (STerrainVertex *first_vertex)
{
int j;
m_pVertices = first_vertex;
m_Bounds.SetEmpty();
for (int j=0; j<PATCH_SIZE+1; j++)
for (j=0; j<PATCH_SIZE+1; j++)
{
for (int i=0; i<PATCH_SIZE+1; i++)
{
@ -37,7 +39,7 @@ void CPatch::Initialize (STerrainVertex *first_vertex)
}
}
for (int j=0; j<16; j++)
for (j=0; j<16; j++)
{
for (int i=0; i<16; i++)
{

View File

@ -79,15 +79,17 @@ void CRenderer::BeginFrame()
// force rendering of any batched objects
void CRenderer::FlushFrame()
{
int i;
// render base terrain
if (m_TerrainMode==WIREFRAME) {
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
}
for (int i=0;i<m_TerrainPatches.size();++i) {
for (i=0;i<m_TerrainPatches.size();++i) {
RenderPatchBase(m_TerrainPatches[i].m_Object);
}
for (int i=0;i<m_TerrainPatches.size();++i) {
for (i=0;i<m_TerrainPatches.size();++i) {
RenderPatchTrans(m_TerrainPatches[i].m_Object);
}
@ -96,7 +98,7 @@ void CRenderer::FlushFrame()
}
// render models
for (int i=0;i<m_Models.size();++i) {
for (i=0;i<m_Models.size();++i) {
RenderModel(m_Models[i]);
}

View File

@ -52,13 +52,15 @@ bool CTerrain::Load(char *filename)
bool CTerrain::InitFromHeightmap(const u8* data)
{
int j;
delete[] m_pVertices;
m_pVertices = new STerrainVertex[MAP_SIZE*MAP_SIZE];
if (m_pVertices == NULL)
return false;
for (int j=0; j<MAP_SIZE; j++)
for (j=0; j<MAP_SIZE; j++)
{
for (int i=0; i<MAP_SIZE; i++)
{
@ -70,7 +72,7 @@ bool CTerrain::InitFromHeightmap(const u8* data)
}
}
for (int j=0; j<NUM_PATCHES_PER_SIDE; j++)
for (j=0; j<NUM_PATCHES_PER_SIDE; j++)
{
for (int i=0; i<NUM_PATCHES_PER_SIDE; i++)
{