- set_array(GL_VERTEX_ARRAY, found&1, 1);
- set_array(GL_NORMAL_ARRAY, found&2, 2);
- set_array(GL_TEXTURE_COORD_ARRAY, found&4, 4);
- set_array(GL_COLOR_ARRAY, found&8, 8);
- for(unsigned i=4; i<32; ++i)
- set_array(i-3, (found>>i)&1, 1<<i);
+ for(unsigned i=0; i<64; ++i)
+ if(enabled_arrays.is_set(i) && !found.is_set(i))
+ {
+ if(i==0)
+ glDisableClientState(GL_VERTEX_ARRAY);
+ else if(i==1)
+ glDisableClientState(GL_NORMAL_ARRAY);
+ else if(i==2)
+ glDisableClientState(GL_COLOR_ARRAY);
+ else if(i>=3 && i<11)
+ {
+ if(i>3 || active_tex)
+ glClientActiveTexture(GL_TEXTURE0+(i-3));
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ else
+ glDisableVertexAttribArrayARB(i-11);
+ }