Issue #659: Add line joins.

Added:

love.graphics.setLineJoin(linejoin)
linejoin = love.graphics.getLineJoin()

where linjoin is one of:

- none
- miter
- bevel

Bevel and miter drawing is slightly faster than the 0.8 default (miter), while
the `none` join mode will be slower when overdraw is enabled.
This commit is contained in:
vrld
2013-08-07 21:48:21 +02:00
parent fc3affb9b9
commit be205544b3
7 changed files with 119 additions and 199 deletions
+14
View File
@@ -69,6 +69,7 @@ struct DisplayState
// Line.
Graphics::LineStyle lineStyle;
Graphics::LineJoin lineJoin;
// Point.
float pointSize;
@@ -88,6 +89,7 @@ struct DisplayState
backgroundColor.set(0, 0, 0, 255);
blendMode = Graphics::BLEND_ALPHA;
lineStyle = Graphics::LINE_SMOOTH;
lineJoin = Graphics::LINE_JOIN_MITER;
pointSize = 1.0f;
pointStyle = Graphics::POINT_SMOOTH;
scissor = false;
@@ -299,6 +301,12 @@ public:
**/
void setLineStyle(LineStyle style);
/**
* Sets the line style.
* @param style LINE_ROUGH or LINE_SMOOTH.
**/
void setLineJoin(LineJoin style);
/**
* Gets the line width.
**/
@@ -309,6 +317,11 @@ public:
**/
LineStyle getLineStyle() const;
/**
* Gets the line style.
**/
LineJoin getLineJoin() const;
/**
* Sets the size of points.
**/
@@ -455,6 +468,7 @@ private:
std::vector<double> pixel_size_stack; // stores current size of a pixel (needed for line drawing)
LineStyle lineStyle;
LineJoin lineJoin;
float lineWidth;
GLint matrixLimit;
GLint userMatrices;