1
0
forked from 0ad/0ad

Terrain overlay: Fixed incorrect state change

Other: Trivially tidied profile text. Removed VC2005 deprecation
avoidance, since wx 2.6.3 does that anyway.

This was SVN commit r3773.
This commit is contained in:
Ykkrosh 2006-04-19 00:56:24 +00:00
parent 8a11f53011
commit d158ed9dc9
4 changed files with 10 additions and 19 deletions

View File

@ -825,7 +825,7 @@ void CRenderer::RenderShadowMap()
void CRenderer::RenderPatches()
{
PROFILE(" render patches ");
PROFILE( "render patches" );
// switch on wireframe if we need it
if (m_TerrainRenderMode==WIREFRAME) {

View File

@ -11,9 +11,7 @@
// Handy things for STL:
/**
* Functor for sorting pairs, using the <-ordering of their second values.
*/
/// Functor for sorting pairs, using the <-ordering of their second values.
struct compare2nd
{
template<typename S, typename T> bool operator()(const std::pair<S, T>& a, const std::pair<S, T>& b) const
@ -22,9 +20,7 @@ struct compare2nd
}
};
/**
* Functor for comparing the firsts of pairs to a specified value.
*/
/// Functor for comparing the firsts of pairs to a specified value.
template<typename S> struct equal1st
{
const S& val;
@ -37,9 +33,7 @@ private:
const equal1st& operator=(const equal1st& rhs);
};
/**
* Functor for calling ->Render on pairs' firsts.
*/
/// Functor for calling ->Render on pairs' firsts.
struct render1st
{
template<typename S, typename T> void operator()(const std::pair<S, T>& a) const
@ -75,9 +69,11 @@ TerrainOverlay::~TerrainOverlay()
void TerrainOverlay::RenderOverlays()
{
if (g_TerrainOverlayList.size() == 0)
return;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LEQUAL);
glDepthMask(GL_FALSE);
// To ensure that outlines are drawn on top of the terrain correctly (and
// don't Z-fight and flicker nastily), draw them as QUADS with the LINE
@ -89,11 +85,12 @@ void TerrainOverlay::RenderOverlays()
std::for_each(g_TerrainOverlayList.begin(), g_TerrainOverlayList.end(),
render1st());
// Clean up state to at least be consistent
// Clean up state changes
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glDisable(GL_POLYGON_OFFSET_LINE);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);
}

View File

@ -373,7 +373,7 @@ void TerrainRenderer::RenderOutlines()
// Render water that is part of the terrain
void TerrainRenderer::RenderWater()
{
PROFILE(" render water ");
PROFILE( "render water" );
//(Crappy) fresnel effect

View File

@ -4,12 +4,6 @@
# define HAVE_PCH
#endif
#ifdef _MSC_VER
// Please shut up about all the deprecations
# define _CRT_SECURE_NO_DEPRECATE
# pragma warning(disable: 4996)
#endif
#ifdef HAVE_PCH
// Exclude rarely-used stuff from Windows headers