Remove love.graphics.setFont([<file>,] <size>) shorthand, idiom is now love.graphics.newFont([<file>,] <size>):set()

This makes sure that setFont doesn't create any fonts.
This commit is contained in:
Bart van Strien
2011-12-13 18:51:24 +01:00
parent d5d2e7b5ae
commit 9682ebecf9
6 changed files with 23 additions and 81 deletions
+11
View File
@@ -19,6 +19,7 @@
**/
// LOVE
#include "Graphics.h"
#include "wrap_Font.h"
namespace love
@@ -27,6 +28,8 @@ namespace graphics
{
namespace opengl
{
extern Graphics * instance;
Font * luax_checkfont(lua_State * L, int idx)
{
return luax_checktype<Font>(L, idx, "Font", GRAPHICS_FONT_T);
@@ -89,12 +92,20 @@ namespace opengl
return 1;
}
int w_Font_set(lua_State * L)
{
Font * t = luax_checkfont(L, 1);
instance->setFont(t);
return 0;
}
static const luaL_Reg functions[] = {
{ "getHeight", w_Font_getHeight },
{ "getWidth", w_Font_getWidth },
{ "getWrap", w_Font_getWrap },
{ "setLineHeight", w_Font_setLineHeight },
{ "getLineHeight", w_Font_getLineHeight },
{ "set", w_Font_set },
{ 0, 0 }
};