Reworked internal anisotropic filtering code to be more concise and intuitive

This commit is contained in:
Alex Szpakowski
2013-03-21 12:21:13 -03:00
parent 7e753a0acb
commit 2009124cf9
16 changed files with 43 additions and 150 deletions
+3 -4
View File
@@ -103,6 +103,8 @@ int w_Font_setFilter(lua_State *L)
if (!Image::getConstant(magstr, f.mag))
return luaL_error(L, "Invalid filter mode: %s", magstr);
f.anisotropy = (float) luaL_optnumber(L, 4, 1.0);
try
{
t->setFilter(f);
@@ -112,9 +114,6 @@ int w_Font_setFilter(lua_State *L)
return luaL_error(L, "%s", e.what());
}
float anisotropy = (float) luaL_optnumber(L, 4, 1.0);
t->setAnisotropy(anisotropy);
return 0;
}
@@ -128,7 +127,7 @@ int w_Font_getFilter(lua_State *L)
Image::getConstant(f.mag, magstr);
lua_pushstring(L, minstr);
lua_pushstring(L, magstr);
lua_pushnumber(L, t->getAnisotropy());
lua_pushnumber(L, f.anisotropy);
return 3;
}