Browse Source

Merge default into minor

--HG--
branch : minor
Alex Szpakowski 8 years ago
parent
commit
a6669a8bb2

+ 3 - 0
src/common/utf8.cpp

@@ -98,6 +98,9 @@ Graphics::Graphics()
 {
 {
 	transformStack.reserve(16);
 	transformStack.reserve(16);
 	transformStack.push_back(Matrix4());
 	transformStack.push_back(Matrix4());
+
+	pixelScaleStack.reserve(16);
+	pixelScaleStack.push_back(1);
 }
 }
 
 
 Graphics::~Graphics()
 Graphics::~Graphics()

+ 0 - 4
src/modules/graphics/opengl/Graphics.cpp

@@ -294,10 +294,6 @@ bool Graphics::setMode(int width, int height, int pixelwidth, int pixelheight, b
 	// Restore the graphics state.
 	// Restore the graphics state.
 	restoreState(states.back());
 	restoreState(states.back());
 
 
-	pixelScaleStack.clear();
-	pixelScaleStack.reserve(5);
-	pixelScaleStack.push_back(1);
-
 	int gammacorrect = isGammaCorrect() ? 1 : 0;
 	int gammacorrect = isGammaCorrect() ? 1 : 0;
 
 
 	// We always need a default shader.
 	// We always need a default shader.

+ 12 - 0
src/modules/math/BezierCurve.cpp

@@ -107,6 +107,9 @@ BezierCurve BezierCurve::getDerivative() const
 
 
 const Vector &BezierCurve::getControlPoint(int i) const
 const Vector &BezierCurve::getControlPoint(int i) const
 {
 {
+	if (controlPoints.size() == 0)
+		throw Exception("Curve contains no control points.");
+		
 	while (i < 0)
 	while (i < 0)
 		i += controlPoints.size();
 		i += controlPoints.size();
 
 
@@ -118,6 +121,9 @@ const Vector &BezierCurve::getControlPoint(int i) const
 
 
 void BezierCurve::setControlPoint(int i, const Vector &point)
 void BezierCurve::setControlPoint(int i, const Vector &point)
 {
 {
+	if (controlPoints.size() == 0)
+		throw Exception("Curve contains no control points.");
+
 	while (i < 0)
 	while (i < 0)
 		i += controlPoints.size();
 		i += controlPoints.size();
 
 
@@ -129,6 +135,9 @@ void BezierCurve::setControlPoint(int i, const Vector &point)
 
 
 void BezierCurve::insertControlPoint(const Vector &point, int i)
 void BezierCurve::insertControlPoint(const Vector &point, int i)
 {
 {
+	if (controlPoints.size() == 0)
+		i = 0;
+
 	while (i < 0)
 	while (i < 0)
 		i += controlPoints.size();
 		i += controlPoints.size();
 
 
@@ -140,6 +149,9 @@ void BezierCurve::insertControlPoint(const Vector &point, int i)
 
 
 void BezierCurve::removeControlPoint(int i)
 void BezierCurve::removeControlPoint(int i)
 {
 {
+	if (controlPoints.size() == 0)
+		throw Exception("No control points to remove.");
+
 	while (i < 0)
 	while (i < 0)
 		i += controlPoints.size();
 		i += controlPoints.size();
 
 

+ 1 - 3
src/modules/system/System.cpp

@@ -1194,9 +1194,7 @@ const unsigned char boot_lua[] =
 	0x09, 0x09, 0x09, 0x09, 0x63, 0x6f, 0x70, 0x79, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 
 	0x09, 0x09, 0x09, 0x09, 0x63, 0x6f, 0x70, 0x79, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 
 	0x64, 0x28, 0x29, 0x0a,
 	0x64, 0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x74, 0x6f, 
 	0x09, 0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x74, 0x6f, 
-	0x75, 0x63, 0x68, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x20, 0x3d, 
-	0x3d, 0x20, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x20, 0x74, 
-	0x68, 0x65, 0x6e, 0x0a,
+	0x75, 0x63, 0x68, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x6c, 
 	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x6c, 
 	0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x74, 0x6c, 
 	0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x74, 0x6c, 
 	0x65, 0x28, 0x29, 0x0a,
 	0x65, 0x28, 0x29, 0x0a,