- case 0:
- *ptr++ = x;
- *ptr++ = y;
- if(size>=3) *ptr++ = z;
- if(size>=4) *ptr++ = w;
- break;
- case 1:
- *ptr++ = nx;
- *ptr++ = ny;
- *ptr++ = nz;
- break;
- case 2:
- *ptr++ = ts;
- if(size>=2) *ptr++ = tt;
- if(size>=3) *ptr++ = tr;
- if(size>=4) *ptr++ = tq;
- break;
- case 3:
- if(size==1)
- {
- union { unsigned char c[4]; float f; } u;
- u.c[0] = static_cast<unsigned char>(cr*255);
- u.c[1] = static_cast<unsigned char>(cg*255);
- u.c[2] = static_cast<unsigned char>(cb*255);
- u.c[3] = static_cast<unsigned char>(ca*255);
- *ptr++ = u.f;
- }
+ const Vector4 *v = 0;
+ if(t==get_component_type(VERTEX3))
+ v = &ver;
+ else if(*c>=TEXCOORD1 && *c<=TEXCOORD4+12)
+ v = &texc[t-get_component_type(TEXCOORD1)];
+ else if(*c>=ATTRIB1)
+ v = &attr[t-get_component_type(ATTRIB1)];