mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Reworked internal anisotropic filtering code to be more concise and intuitive
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user