X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexarray.cpp;h=e91062bbda60b0f309f06c98effda44f6065eccd;hp=6c037f9fd030de3f382335a16dc8c8d2cc69acff;hb=40c364b04084d11573a9ff9f7be6f1c4cc521f4b;hpb=c4fa55619539de9045167250d5b1c13d1827cf7a diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index 6c037f9f..e91062bb 100644 --- a/source/vertexarray.cpp +++ b/source/vertexarray.cpp @@ -32,7 +32,7 @@ void VertexArray::reset(const VertexFormat &f) bool has_gen_attrs = false; for(const unsigned char *c=format.begin(); c!=format.end(); ++c) { - if(*c>=TEXCOORD1+4 && *c=TEXCOORD1+4 && *c<=TEXCOORD4+12) has_multitex = true; if(*c>=ATTRIB1) has_gen_attrs = true; @@ -140,7 +140,7 @@ void VertexArray::apply() const if(!en) glEnableClientState(GL_COLOR_ARRAY); } - else if(*c>=TEXCOORD1 && *c<=TEXCOORD4+28) + else if(*c>=TEXCOORD1 && *c<=TEXCOORD4+12) { t -= get_component_type(TEXCOORD1); if(t>0 || active_tex) @@ -154,7 +154,8 @@ void VertexArray::apply() const } else { - t -= get_component_type(ATTRIB1); + if(t>=get_component_type(ATTRIB1)) + t -= get_component_type(ATTRIB1); glVertexAttribPointer(t, sz, GL_FLOAT, false, bpv, base+offset); if(!en) glEnableVertexAttribArray(t); @@ -172,7 +173,7 @@ void VertexArray::apply() const glDisableClientState(GL_NORMAL_ARRAY); else if(i==get_component_type(COLOR4_FLOAT)) glDisableClientState(GL_COLOR_ARRAY); - else if(i>=get_component_type(TEXCOORD1) && i<=get_component_type(TEXCOORD1)+7) + else if(i>=get_component_type(TEXCOORD1) && i<=get_component_type(TEXCOORD1)+3) { unsigned j = i-get_component_type(TEXCOORD1); if(j>0 || active_tex) @@ -180,6 +181,8 @@ void VertexArray::apply() const glDisableClientState(GL_TEXTURE_COORD_ARRAY); active_tex = j; } + else if(i