From 0265e88d8f68e9a973e0b047676c8d4c27e63ede Mon Sep 17 00:00:00 2001 From: mittorn Date: Thu, 12 Oct 2023 20:05:45 +0300 Subject: [PATCH] gl2shim: fix wrong color vertex --- ref/gl/gl2_shim/gl2_shim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ref/gl/gl2_shim/gl2_shim.c b/ref/gl/gl2_shim/gl2_shim.c index ae03ea36..c825cb20 100644 --- a/ref/gl/gl2_shim/gl2_shim.c +++ b/ref/gl/gl2_shim/gl2_shim.c @@ -1008,7 +1008,7 @@ static void APIENTRY GL2_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) *p++ = x; *p++ = y; *p++ = z; - ++gl2wrap.end; + if(gl2wrap.cur_flags & 1 << GL2_ATTR_COLOR) { GLfloat *p = gl2wrap.attrbuf[GL2_ATTR_COLOR] + gl2wrap.end * 4; @@ -1018,6 +1018,7 @@ static void APIENTRY GL2_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) *p++ = gl2wrap.color[2]; *p++ = gl2wrap.color[3]; } + ++gl2wrap.end; if ( gl2wrap.end - gl2wrap.begin >= MAX_BEGINEND_VERTS ) { GLenum prim = gl2wrap.prim;