Error instead of crash when love.graphics.newScreenshot fails

This commit is contained in:
Alex Szpakowski
2013-04-28 11:12:19 -07:00
parent b44c083894
commit ad2239aaaf
4 changed files with 47 additions and 17 deletions
+2 -2
View File
@@ -104,7 +104,7 @@ void Matrix::setTranslation(float x, float y)
void Matrix::setRotation(float rad)
{
setIdentity();
float c = cos(rad), s = sin(rad);
float c = cosf(rad), s = sinf(rad);
e[0] = c;
e[4] = -s;
e[1] = s;
@@ -128,7 +128,7 @@ void Matrix::setShear(float kx, float ky)
void Matrix::setTransformation(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky)
{
memset(e, 0, sizeof(float)*16); // zero out matrix
float c = cos(angle), s = sin(angle);
float c = cosf(angle), s = sinf(angle);
// matrix multiplication carried out on paper:
// |1 x| |c -s | |sx | | 1 ky | |1 -ox|
// | 1 y| |s c | | sy | |kx 1 | | 1 -oy|