mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Error instead of crash when love.graphics.newScreenshot fails
This commit is contained in:
@@ -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|
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ public:
|
||||
* Gets the length of the Vector.
|
||||
* @return The length of the Vector.
|
||||
*
|
||||
* This method requires sqrt() and should be used
|
||||
* This method requires sqrtf() and should be used
|
||||
* carefully.
|
||||
**/
|
||||
float getLength() const;
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
|
||||
inline float Vector::getLength() const
|
||||
{
|
||||
return sqrt(x*x + y*y);
|
||||
return sqrtf(x*x + y*y);
|
||||
}
|
||||
|
||||
inline Vector Vector::getNormal() const
|
||||
|
||||
Reference in New Issue
Block a user