structAllocateInto method

  1. @override
void structAllocateInto(
  1. RaylibTemp<RaylibBase> temp,
  2. MemoryPointer<RType> p,
  3. String key
)
override

Allocates nested pointers into temp under key as needed.

Implementation

@override
void structAllocateInto(RaylibTemp temp, MemoryPointer p, String key) {
  if (vertices.isNotEmpty) field_vertices.allocate(temp, p, '${key}_vertices', count: verticesCount, raw: true);
  if (texcoords.isNotEmpty) field_texcoords.allocate(temp, p, '${key}_texcoords', count: texcoordsCount, raw: true);
  if (texcoords2.isNotEmpty) field_texcoords2.allocate(temp, p, '${key}_texcoords2', count: texcoords2Count, raw: true);
  if (normals.isNotEmpty) field_normals.allocate(temp, p, '${key}_normals', count: normalsCount, raw: true);
  if (tangents.isNotEmpty) field_tangents.allocate(temp, p, '${key}_tangents', count: tangentsCount, raw: true);
  if (colors.isNotEmpty) field_colors.allocate(temp, p, '${key}_colors', count: colorsCount, raw: true);
  if (indices.isNotEmpty) field_indices.allocate(temp, p, '${key}_indices', count: indicesCount, raw: true);
  if (animVertices.isNotEmpty) field_animVertices.allocate(temp, p, '${key}_animVertices', count: animVerticesCount, raw: true);
  if (animNormals.isNotEmpty) field_animNormals.allocate(temp, p, '${key}_animNormals', count: animNormalsCount, raw: true);
  if (!RaylibConfig.isGPUSkinningSupported) {
    if (boneIndices.isNotEmpty) field_boneIndices.allocate(temp, p, '${key}_boneIndices', count: boneIndicesCount, raw: true);
    if (boneWeights.isNotEmpty) field_boneWeights.allocate(temp, p, '${key}_boneWeights', count: boneWeightsCount, raw: true);
  }
}