private CopyVertexDataTo ( |
||
targetData | ||
atIndex | int | |
copyColor | bool | |
Результат | void |
/// <summary> /// Adds a quad or image to the batch, using custom alpha and blend mode values (ignoring the /// quad's original values) and transforming each vertex by a certain transformation matrix. /// Make sure you only add quads with an equal state. /// </summary> public void AddQuad(Quad quad, float alpha, uint blendMode, Matrix matrix = null) { if (matrix == null) { matrix = quad.TransformationMatrix; } if (_numQuads + 1 > _capacity) { Capacity = _capacity < 8 ? 16 : _capacity * 2; } if (_numQuads == 0) { _texture = quad.Texture; _premultipliedAlpha = quad.PremultipliedAlpha; BlendMode = blendMode; _vertexData.SetPremultipliedAlpha(_premultipliedAlpha, false); } int vertexID = _numQuads * 4; _tinted = alpha != 1.0f || quad.Tinted; quad.CopyVertexDataTo(_vertexData, vertexID, _tinted); _vertexData.TransformVertices(matrix, vertexID, 4); if (alpha != 1.0f) { _vertexData.ScaleAlphaBy(alpha, vertexID, 4); } _syncRequired = true; _numQuads++; }
/// <summary> /// Adds a quad or image to the batch, using custom alpha and blend mode values (ignoring the /// quad's original values) and transforming each vertex by a certain transformation matrix. /// Make sure you only add quads with an equal state. /// </summary> public void AddQuad(Quad quad, float alpha, uint blendMode, Matrix matrix = null) { if (matrix == null) { matrix = quad.TransformationMatrix; } if (_numQuads + 1 > _capacity) { Capacity = _capacity < 8 ? 16 : _capacity * 2; } if (_numQuads == 0) { _texture = quad.Texture; _premultipliedAlpha = quad.PremultipliedAlpha; BlendMode = blendMode; _vertexData.SetPremultipliedAlpha(_premultipliedAlpha, false); } int vertexID = _numQuads * 4; _tinted = alpha != 1.0f || quad.Tinted; quad.CopyVertexDataTo(_vertexData, vertexID, _tinted); _vertexData.TransformVertices(matrix, vertexID, 4); if (alpha != 1.0f) { _vertexData.ScaleAlphaBy(alpha, vertexID, 4); } _syncRequired = true; _numQuads++; }