mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merge default into minor
--HG-- branch : minor
This commit is contained in:
@@ -98,6 +98,9 @@ Graphics::Graphics()
|
||||
{
|
||||
transformStack.reserve(16);
|
||||
transformStack.push_back(Matrix4());
|
||||
|
||||
pixelScaleStack.reserve(16);
|
||||
pixelScaleStack.push_back(1);
|
||||
}
|
||||
|
||||
Graphics::~Graphics()
|
||||
|
||||
@@ -294,10 +294,6 @@ bool Graphics::setMode(int width, int height, int pixelwidth, int pixelheight, b
|
||||
// Restore the graphics state.
|
||||
restoreState(states.back());
|
||||
|
||||
pixelScaleStack.clear();
|
||||
pixelScaleStack.reserve(5);
|
||||
pixelScaleStack.push_back(1);
|
||||
|
||||
int gammacorrect = isGammaCorrect() ? 1 : 0;
|
||||
|
||||
// We always need a default shader.
|
||||
|
||||
@@ -107,6 +107,9 @@ BezierCurve BezierCurve::getDerivative() const
|
||||
|
||||
const Vector &BezierCurve::getControlPoint(int i) const
|
||||
{
|
||||
if (controlPoints.size() == 0)
|
||||
throw Exception("Curve contains no control points.");
|
||||
|
||||
while (i < 0)
|
||||
i += controlPoints.size();
|
||||
|
||||
@@ -118,6 +121,9 @@ const Vector &BezierCurve::getControlPoint(int i) const
|
||||
|
||||
void BezierCurve::setControlPoint(int i, const Vector &point)
|
||||
{
|
||||
if (controlPoints.size() == 0)
|
||||
throw Exception("Curve contains no control points.");
|
||||
|
||||
while (i < 0)
|
||||
i += controlPoints.size();
|
||||
|
||||
@@ -129,6 +135,9 @@ void BezierCurve::setControlPoint(int i, const Vector &point)
|
||||
|
||||
void BezierCurve::insertControlPoint(const Vector &point, int i)
|
||||
{
|
||||
if (controlPoints.size() == 0)
|
||||
i = 0;
|
||||
|
||||
while (i < 0)
|
||||
i += controlPoints.size();
|
||||
|
||||
@@ -140,6 +149,9 @@ void BezierCurve::insertControlPoint(const Vector &point, int i)
|
||||
|
||||
void BezierCurve::removeControlPoint(int i)
|
||||
{
|
||||
if (controlPoints.size() == 0)
|
||||
throw Exception("No control points to remove.");
|
||||
|
||||
while (i < 0)
|
||||
i += controlPoints.size();
|
||||
|
||||
|
||||
Executable → Regular
Reference in New Issue
Block a user