mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 20:12:23 +00:00
* Tiled Rework * fix failing tests * really fix failing tests
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
namespace MonoGame.Extended.Graphics.Geometry
|
|
{
|
|
public class GraphicsGeometryBufferPositionTextureU16 : GraphicsGeometryBuffer<VertexPositionColorTexture, ushort>
|
|
{
|
|
public GraphicsGeometryBufferPositionTextureU16(GraphicsDevice graphicsDevice, int maximumVertices, int maximumIndices, bool isDynamic)
|
|
: base(graphicsDevice, maximumVertices, maximumIndices, isDynamic)
|
|
{
|
|
}
|
|
|
|
protected override unsafe void CopyIndices(ushort[] source, int sourceStartIndex, ushort[] destination, int desintationStartIndex, int length, int offset)
|
|
{
|
|
fixed (ushort* fixedDestinationPointer = destination)
|
|
fixed (ushort* fixedSourcePointer = source)
|
|
{
|
|
var pointerDestination = fixedDestinationPointer + desintationStartIndex;
|
|
var pointerSource = fixedSourcePointer + sourceStartIndex;
|
|
var pointerDestinationEnd = pointerDestination + length;
|
|
|
|
while (pointerDestination < pointerDestinationEnd)
|
|
{
|
|
*pointerDestination++ = (ushort)(*pointerSource++ + offset);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|