Fixed mem leaks with layers. Added layer region generation test.

This commit is contained in:
Mikko Mononen
2011-02-27 20:39:17 +00:00
parent f140c3962d
commit ce6f2a52fc
7 changed files with 397 additions and 44 deletions

View File

@@ -665,7 +665,7 @@ void Sample_TileMesh::handleRender()
if (m_lset && m_drawMode == DRAWMODE_HEIGHFIELD_LAYERS)
{
glDepthMask(GL_FALSE);
duDebugDrawHeightfieldLayers(&dd, *m_lset);
duDebugDrawHeightfieldLayersRegions(&dd, *m_lset);
glDepthMask(GL_TRUE);
}
@@ -1113,6 +1113,11 @@ unsigned char* Sample_TileMesh::buildTileMesh(const int tx, const int ty, const
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build heighfield layers.");
return 0;
}
for (int i = 0; i < m_lset->nlayers; ++i)
{
rcBuildLayerRegions(m_ctx, m_lset->layers[i], m_cfg.walkableClimb);
}
}