From eb95c734165cbc694b467e7bf1a292a0efcd86b1 Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 22 Feb 2019 23:44:51 +0300 Subject: [PATCH] Winding_Draw fix use after scope --- radiant/brush.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radiant/brush.h b/radiant/brush.h index 2459067d..31228640 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -87,8 +87,9 @@ inline void Winding_DrawWireframe( const Winding& winding ){ inline void Winding_Draw( const Winding& winding, const Vector3& normal, RenderStateFlags state ){ glVertexPointer( 3, GL_FLOAT, sizeof( WindingVertex ), &winding.points.data()->vertex ); + Vector3 normals[c_brush_maxFaces]; + if ( ( state & RENDER_BUMP ) != 0 ) { - Vector3 normals[c_brush_maxFaces]; typedef Vector3* Vector3Iter; for ( Vector3Iter i = normals, end = normals + winding.numpoints; i != end; ++i ) { @@ -111,7 +112,6 @@ inline void Winding_Draw( const Winding& winding, const Vector3& normal, RenderS else { if ( state & RENDER_LIGHTING ) { - Vector3 normals[c_brush_maxFaces]; typedef Vector3* Vector3Iter; for ( Vector3Iter i = normals, last = normals + winding.numpoints; i != last; ++i ) {