mirror of https://github.com/bjornbytes/lovr.git
Cleanup;
This commit is contained in:
parent
dd1db4c86f
commit
68538c7013
|
@ -549,17 +549,6 @@ int l_lovrGraphicsBox(lua_State* L) {
|
||||||
return luax_rectangularprism(L, 0);
|
return luax_rectangularprism(L, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int l_lovrGraphicsPrint(lua_State* L) {
|
|
||||||
const char* str = luaL_checkstring(L, 1);
|
|
||||||
float transform[16];
|
|
||||||
int index = luax_readtransform(L, 2, transform, 1);
|
|
||||||
float wrap = luaL_optnumber(L, index++, 0);
|
|
||||||
HorizontalAlign halign = *(HorizontalAlign*) luax_optenum(L, index++, "center", &HorizontalAligns, "alignment");
|
|
||||||
VerticalAlign valign = *(VerticalAlign*) luax_optenum(L, index++, "middle", &VerticalAligns, "alignment");
|
|
||||||
lovrGraphicsPrint(str, transform, wrap, halign, valign);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int l_lovrGraphicsCylinder(lua_State* L) {
|
int l_lovrGraphicsCylinder(lua_State* L) {
|
||||||
float x1 = luaL_checknumber(L, 1);
|
float x1 = luaL_checknumber(L, 1);
|
||||||
float y1 = luaL_checknumber(L, 2);
|
float y1 = luaL_checknumber(L, 2);
|
||||||
|
@ -575,6 +564,17 @@ int l_lovrGraphicsCylinder(lua_State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int l_lovrGraphicsPrint(lua_State* L) {
|
||||||
|
const char* str = luaL_checkstring(L, 1);
|
||||||
|
float transform[16];
|
||||||
|
int index = luax_readtransform(L, 2, transform, 1);
|
||||||
|
float wrap = luaL_optnumber(L, index++, 0);
|
||||||
|
HorizontalAlign halign = *(HorizontalAlign*) luax_optenum(L, index++, "center", &HorizontalAligns, "alignment");
|
||||||
|
VerticalAlign valign = *(VerticalAlign*) luax_optenum(L, index++, "middle", &VerticalAligns, "alignment");
|
||||||
|
lovrGraphicsPrint(str, transform, wrap, halign, valign);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
|
|
||||||
int l_lovrGraphicsNewFont(lua_State* L) {
|
int l_lovrGraphicsNewFont(lua_State* L) {
|
||||||
|
@ -818,8 +818,8 @@ const luaL_Reg lovrGraphics[] = {
|
||||||
{ "plane", l_lovrGraphicsPlane },
|
{ "plane", l_lovrGraphicsPlane },
|
||||||
{ "cube", l_lovrGraphicsCube },
|
{ "cube", l_lovrGraphicsCube },
|
||||||
{ "box", l_lovrGraphicsBox },
|
{ "box", l_lovrGraphicsBox },
|
||||||
{ "print", l_lovrGraphicsPrint },
|
|
||||||
{ "cylinder", l_lovrGraphicsCylinder },
|
{ "cylinder", l_lovrGraphicsCylinder },
|
||||||
|
{ "print", l_lovrGraphicsPrint },
|
||||||
{ "getWidth", l_lovrGraphicsGetWidth },
|
{ "getWidth", l_lovrGraphicsGetWidth },
|
||||||
{ "getHeight", l_lovrGraphicsGetHeight },
|
{ "getHeight", l_lovrGraphicsGetHeight },
|
||||||
{ "getDimensions", l_lovrGraphicsGetDimensions },
|
{ "getDimensions", l_lovrGraphicsGetDimensions },
|
||||||
|
|
Loading…
Reference in New Issue