public static unsafe BufferEntityPatchInfo *AppendBufferEntityPatches(BufferEntityPatchInfo *patches, TypeManager.EntityOffsetInfo[] offsets, int bufferBaseOffset, int bufferStride, int elementStride)
        {
            BufferEntityPatchInfo *infoPtr;

            if (offsets == null)
            {
                infoPtr = patches;
            }
            else
            {
                int index = 0;
                while (true)
                {
                    if (index >= offsets.Length)
                    {
                        infoPtr = patches + offsets.Length;
                        break;
                    }
                    patches[index] = new BufferEntityPatchInfo {
                        BufferOffset  = bufferBaseOffset,
                        BufferStride  = bufferStride,
                        ElementOffset = offsets[index].Offset,
                        ElementStride = elementStride
                    };
                    index++;
                }
            }
            return(infoPtr);
        }
Exemplo n.º 2
0
        public static BufferEntityPatchInfo *AppendBufferEntityPatches(BufferEntityPatchInfo *patches, EntityOffsetInfo *offsets, int offsetCount, int bufferBaseOffset, int bufferStride, int elementStride)
        {
            if (offsets == null)
            {
                return(patches);
            }

            for (int i = 0; i < offsetCount; i++)
            {
                patches[i] = new BufferEntityPatchInfo
                {
                    BufferOffset  = bufferBaseOffset,
                    BufferStride  = bufferStride,
                    ElementOffset = offsets[i].Offset,
                    ElementStride = elementStride,
                };
            }

            return(patches + offsetCount);
        }