Merge branch '12.0-development' into metal

This commit is contained in:
Alex Szpakowski
2020-07-29 18:21:19 -03:00
57 changed files with 6870 additions and 4915 deletions
+8 -10
View File
@@ -192,6 +192,8 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices)
love::image::ImageDataBase *slice = slices->get(0, 0);
format = slice->getFormat();
if (sRGB)
format = getSRGBPixelFormat(format);
pixelWidth = slice->getWidth();
pixelHeight = slice->getHeight();
@@ -305,8 +307,6 @@ void Texture::draw(Graphics *gfx, const Matrix4 &m)
void Texture::draw(Graphics *gfx, Quad *q, const Matrix4 &localTransform)
{
using namespace vertex;
if (!readable)
throw love::Exception("Textures with non-readable formats cannot be drawn.");
@@ -323,9 +323,9 @@ void Texture::draw(Graphics *gfx, Quad *q, const Matrix4 &localTransform)
bool is2D = tm.isAffine2DTransform();
Graphics::BatchedDrawCommand cmd;
cmd.formats[0] = vertex::getSinglePositionFormat(is2D);
cmd.formats[0] = getSinglePositionFormat(is2D);
cmd.formats[1] = CommonFormat::STf_RGBAub;
cmd.indexMode = TriangleIndexMode::QUADS;
cmd.indexMode = TRIANGLEINDEX_QUADS;
cmd.vertexCount = 4;
cmd.texture = this;
@@ -339,7 +339,7 @@ void Texture::draw(Graphics *gfx, Quad *q, const Matrix4 &localTransform)
t.transformXY0((Vector3 *) data.stream[0], q->getVertexPositions(), 4);
const Vector2 *texcoords = q->getVertexTexCoords();
vertex::STf_RGBAub *vertexdata = (vertex::STf_RGBAub *) data.stream[1];
STf_RGBAub *vertexdata = (STf_RGBAub *) data.stream[1];
Color32 c = toColor32(gfx->getColor());
@@ -358,8 +358,6 @@ void Texture::drawLayer(Graphics *gfx, int layer, const Matrix4 &m)
void Texture::drawLayer(Graphics *gfx, int layer, Quad *q, const Matrix4 &m)
{
using namespace vertex;
if (!readable)
throw love::Exception("Textures with non-readable formats cannot be drawn.");
@@ -380,9 +378,9 @@ void Texture::drawLayer(Graphics *gfx, int layer, Quad *q, const Matrix4 &m)
Matrix4 t(tm, m);
Graphics::BatchedDrawCommand cmd;
cmd.formats[0] = vertex::getSinglePositionFormat(is2D);
cmd.formats[0] = getSinglePositionFormat(is2D);
cmd.formats[1] = CommonFormat::STPf_RGBAub;
cmd.indexMode = TriangleIndexMode::QUADS;
cmd.indexMode = TRIANGLEINDEX_QUADS;
cmd.vertexCount = 4;
cmd.texture = this;
cmd.standardShaderType = Shader::STANDARD_ARRAY;
@@ -395,7 +393,7 @@ void Texture::drawLayer(Graphics *gfx, int layer, Quad *q, const Matrix4 &m)
t.transformXY0((Vector3 *) data.stream[0], q->getVertexPositions(), 4);
const Vector2 *texcoords = q->getVertexTexCoords();
vertex::STPf_RGBAub *vertexdata = (vertex::STPf_RGBAub *) data.stream[1];
STPf_RGBAub *vertexdata = (STPf_RGBAub *) data.stream[1];
for (int i = 0; i < 4; i++)
{