m3g/m3gcore11/src/m3g_vertexarray.c
branchRCL_3
changeset 164 25ffed67c7ef
parent 163 bbf46f59e123
equal deleted inserted replaced
163:bbf46f59e123 164:25ffed67c7ef
   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:
   646             /* always padded to 4 bytes */
   647             /* always padded to 4 bytes */
   647             array->stride = 4;
   648             array->stride = 4;
   648             break;
   649             break;
   649         case M3G_SHORT:
   650         case M3G_SHORT:
       
   651         case M3G_USHORT:
   650             array->stride = size * sizeof(M3Gshort);
   652             array->stride = size * sizeof(M3Gshort);
   651             break;
   653             break;
       
   654         default:
       
   655             m3gFree(m3g, array);
       
   656             m3gRaiseError(m3g, M3G_INVALID_ENUM);
       
   657             return NULL;
   652         }
   658         }
   653 
   659 
   654         /* Alloc and initialize all values to zero */
   660         /* Alloc and initialize all values to zero */
   655         array->data = m3gAllocObject(m3g, count * array->stride);
   661         array->data = m3gAllocObject(m3g, count * array->stride);
   656         if (!array->data) {
   662         if (!array->data) {