mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fixed crash when love.graphics.newFont() was passed nil or nonexistent argument #1
This commit is contained in:
@@ -188,7 +188,6 @@ namespace opengl
|
|||||||
|
|
||||||
int w_newFont(lua_State * L)
|
int w_newFont(lua_State * L)
|
||||||
{
|
{
|
||||||
|
|
||||||
Data * d = 0;
|
Data * d = 0;
|
||||||
|
|
||||||
// Convert to File, if necessary.
|
// Convert to File, if necessary.
|
||||||
@@ -204,6 +203,8 @@ namespace opengl
|
|||||||
else if(luax_istype(L, 1, DATA_T))
|
else if(luax_istype(L, 1, DATA_T))
|
||||||
{
|
{
|
||||||
d = luax_checktype<Data>(L, 1, "Data", DATA_T);
|
d = luax_checktype<Data>(L, 1, "Data", DATA_T);
|
||||||
|
} else { // This is not the type you're looking for.
|
||||||
|
return luaL_error(L, "love.graphics.newFont() requires a string, File, or font data as argument #1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second optional parameter can be a number:
|
// Second optional parameter can be a number:
|
||||||
@@ -493,6 +494,7 @@ namespace opengl
|
|||||||
* Draws an Quad of an Image at the specified coordinates,
|
* Draws an Quad of an Image at the specified coordinates,
|
||||||
* with rotation and scaling along both axes.
|
* with rotation and scaling along both axes.
|
||||||
*
|
*
|
||||||
|
* @param q The Quad to draw.
|
||||||
* @param x The x-coordinate.
|
* @param x The x-coordinate.
|
||||||
* @param y The y-coordinate.
|
* @param y The y-coordinate.
|
||||||
* @param angle The amount of rotation.
|
* @param angle The amount of rotation.
|
||||||
@@ -500,7 +502,6 @@ namespace opengl
|
|||||||
* @param sy The scale factor along the y-axis. (1 = normal).
|
* @param sy The scale factor along the y-axis. (1 = normal).
|
||||||
* @param ox The offset along the x-axis.
|
* @param ox The offset along the x-axis.
|
||||||
* @param oy The offset along the y-axis.
|
* @param oy The offset along the y-axis.
|
||||||
* @param f The Quad to dra.
|
|
||||||
**/
|
**/
|
||||||
int w_drawq(lua_State * L)
|
int w_drawq(lua_State * L)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user