Winding_Draw fix use after scope

This commit is contained in:
Garux 2019-02-22 23:44:51 +03:00
parent a7f0efdab5
commit eb95c73416

View File

@ -87,8 +87,9 @@ inline void Winding_DrawWireframe( const Winding& winding ){
inline void Winding_Draw( const Winding& winding, const Vector3& normal, RenderStateFlags state ){ inline void Winding_Draw( const Winding& winding, const Vector3& normal, RenderStateFlags state ){
glVertexPointer( 3, GL_FLOAT, sizeof( WindingVertex ), &winding.points.data()->vertex ); glVertexPointer( 3, GL_FLOAT, sizeof( WindingVertex ), &winding.points.data()->vertex );
Vector3 normals[c_brush_maxFaces];
if ( ( state & RENDER_BUMP ) != 0 ) { if ( ( state & RENDER_BUMP ) != 0 ) {
Vector3 normals[c_brush_maxFaces];
typedef Vector3* Vector3Iter; typedef Vector3* Vector3Iter;
for ( Vector3Iter i = normals, end = normals + winding.numpoints; i != end; ++i ) 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 else
{ {
if ( state & RENDER_LIGHTING ) { if ( state & RENDER_LIGHTING ) {
Vector3 normals[c_brush_maxFaces];
typedef Vector3* Vector3Iter; typedef Vector3* Vector3Iter;
for ( Vector3Iter i = normals, last = normals + winding.numpoints; i != last; ++i ) for ( Vector3Iter i = normals, last = normals + winding.numpoints; i != last; ++i )
{ {