Fixed crash when love.graphics.newFont() was passed nil or nonexistent argument #1

This commit is contained in:
bill@Ixion
2009-08-27 22:03:41 -05:00
parent 1cb9a6dae2
commit 0e0c7527b1
@@ -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)
{ {