m3g/m3gcore11/src/m3g_vertexarray.c
changeset 116 171fae344dd4
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
equal deleted inserted replaced
103:2717213c588a 116:171fae344dd4
   641             return NULL;
   641             return NULL;
   642         }
   642         }
   643 
   643 
   644         switch (type) {
   644         switch (type) {
   645         case M3G_BYTE:
   645         case M3G_BYTE:
   646         case M3G_UBYTE:
       
   647             /* always padded to 4 bytes */
   646             /* always padded to 4 bytes */
   648             array->stride = 4;
   647             array->stride = 4;
   649             break;
   648             break;
   650         case M3G_SHORT:
   649         case M3G_SHORT:
   651         case M3G_USHORT:
       
   652             array->stride = size * sizeof(M3Gshort);
   650             array->stride = size * sizeof(M3Gshort);
   653             break;
   651             break;
   654         default:
       
   655             m3gFree(m3g, array);
       
   656             m3gRaiseError(m3g, M3G_INVALID_ENUM);
       
   657             return NULL;
       
   658         }
   652         }
   659 
   653 
   660         /* Alloc and initialize all values to zero */
   654         /* Alloc and initialize all values to zero */
   661         array->data = m3gAllocObject(m3g, count * array->stride);
   655         array->data = m3gAllocObject(m3g, count * array->stride);
   662         if (!array->data) {
   656         if (!array->data) {