24 private static readonly
float[]
CORNER_OFFSET_X =
new float[4] { 0f, 1f, 1f, 0f };
26 private static readonly
float[]
CORNER_OFFSET_Y =
new float[4] { 0f, 0f, 1f, 1f };
65 _vertexBuffer.ContentLost += delegate
77 for (
int i = 0; i < 2048; i++)
89 _indexBuffer.ContentLost += delegate
130 destination.X = position.
X;
131 destination.Y = position.
Y;
140 destination.X = position.
X;
141 destination.Y = position.
Y;
142 destination.Z = scale;
143 destination.W = scale;
144 InternalDraw(texture, ref
destination, scaleDestination:
true, ref sourceRectangle, ref colors, ref origin, effects, 0f);
155 destination.X = position.
X;
156 destination.Y = position.
Y;
157 destination.Z = scale.
X;
158 destination.W = scale.
Y;
169 InternalDraw(texture, ref
destination, scaleDestination:
false, ref sourceRectangle, ref colors, ref origin, effects, rotation);
175 destination.X = destinationRectangle.
X;
176 destination.Y = destinationRectangle.
Y;
177 destination.Z = destinationRectangle.
Width;
178 destination.W = destinationRectangle.
Height;
184 short[]
array =
new short[12288];
185 for (
int i = 0; i < 2048; i++)
207 if (sourceRectangle.HasValue)
211 ptr->Source.Y =
value.Y;
212 ptr->Source.Z =
value.Width;
213 ptr->Source.W =
value.Height;
214 if (scaleDestination)
216 num *= (float)
value.Width;
217 num2 *= (float)
value.Height;
222 float num3 = texture.
Width;
223 float num4 = texture.
Height;
226 ptr->Source.Z = num3;
227 ptr->Source.W = num4;
228 if (scaleDestination)
236 ptr->Destination.Z = num;
237 ptr->Destination.W = num2;
238 ptr->Origin.X = origin.X;
239 ptr->Origin.Y = origin.Y;
240 ptr->Effects = effects;
241 ptr->Colors = colors;
242 ptr->Rotation = rotation;
284 float num = 1f / (float)texture.
Width;
285 float num2 = 1f / (float)texture.
Height;
310 for (
int i = 0; i < num3; i++)
330 for (
int j = 0; j < 4; j++)
336 float x = ptr2->
Destination.
X + num10 * num4 - num11 * num5;
337 float y = ptr2->
Destination.
Y + num10 * num5 + num11 * num4;
360 int numVertices = num3 * 4;
362 int primitiveCount = num3 * 2;
SamplerStateCollection SamplerStates
unsafe void SetVertexBuffer(VertexBuffer vertexBuffer, int vertexOffset)
TextureCollection Textures
unsafe void DrawIndexedPrimitives(PrimitiveType primitiveType, int baseVertex, int minVertexIndex, int numVertices, int startIndex, int primitiveCount)
override void Dispose([MarshalAs(UnmanagedType.U1)] bool P_0)
static readonly SamplerState PointClamp
override void Dispose([MarshalAs(UnmanagedType.U1)] bool P_0)
static unsafe void Clear(Array array)
static double Cos(double d)
static double Sin(double a)
void Draw(Texture2D texture, Vector4 destination, VertexColors colors)
unsafe void InternalDraw(Texture2D texture, ref Vector4 destination, bool scaleDestination, ref Rectangle? sourceRectangle, ref VertexColors colors, ref Vector2 origin, SpriteEffects effects, float rotation)
short[] _fallbackIndexData
void Draw(Texture2D texture, Vector2 position, VertexColors colors, Vector2 scale)
void Draw(Texture2D texture, Rectangle destinationRectangle, Rectangle? sourceRectangle, VertexColors colors)
DynamicVertexBuffer _vertexBuffer
void Draw(Texture2D texture, Vector2 position, VertexColors colors)
void Draw(Texture2D texture, Vector4 destination, Rectangle? sourceRectangle, VertexColors colors, Vector2 origin, SpriteEffects effects, float rotation)
DynamicIndexBuffer _indexBuffer
unsafe void RenderBatch(Texture2D texture, SpriteData[] sprites, int offset, int count)
static readonly float[] CORNER_OFFSET_Y
static Vector2 _vector2Zero
static ? Rectangle _nullRectangle
GraphicsDevice _graphicsDevice
Texture2D[] _spriteTextures
static short[] CreateIndexData()
SpriteData[] _spriteDataQueue
void Begin(RasterizerState rasterizer, Matrix transformation)
VertexPositionColorTexture[] _vertices
TileBatch(GraphicsDevice graphicsDevice)
void Draw(Texture2D texture, Vector2 position, Rectangle? sourceRectangle, VertexColors colors, Vector2 origin, float scale, SpriteEffects effects)
static readonly float[] CORNER_OFFSET_X
void Draw(Texture2D texture, Vector4 destination, Rectangle? sourceRectangle, VertexColors colors)
int _vertexBufferPosition
Vector2 TextureCoordinate