|
@@ -361,7 +361,7 @@ int w_newFont(lua_State *L)
|
|
|
try
|
|
|
{
|
|
|
// Create the font.
|
|
|
- font = instance->newFont(rasterizer, instance->getDefaultImageFilter());
|
|
|
+ font = instance->newFont(rasterizer, instance->getDefaultFilter());
|
|
|
}
|
|
|
catch (love::Exception &e)
|
|
|
{
|
|
@@ -426,7 +426,7 @@ int w_newImageFont(lua_State *L)
|
|
|
}
|
|
|
|
|
|
if (!setFilter)
|
|
|
- img_filter = instance->getDefaultImageFilter();
|
|
|
+ img_filter = instance->getDefaultFilter();
|
|
|
|
|
|
// Create the font.
|
|
|
Font *font = instance->newFont(rasterizer, img_filter);
|
|
@@ -719,7 +719,24 @@ int w_setBlendMode(lua_State *L)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int w_setDefaultImageFilter(lua_State *L)
|
|
|
+int w_getBlendMode(lua_State *L)
|
|
|
+{
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Graphics::BlendMode mode = instance->getBlendMode();
|
|
|
+ const char *str;
|
|
|
+ if (!Graphics::getConstant(mode, str))
|
|
|
+ return luaL_error(L, "Unknown blend mode");
|
|
|
+ lua_pushstring(L, str);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ catch (love::Exception &e)
|
|
|
+ {
|
|
|
+ return luaL_error(L, "%s", e.what());
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+int w_setDefaultFilter(lua_State *L)
|
|
|
{
|
|
|
Image::FilterMode min;
|
|
|
Image::FilterMode mag;
|
|
@@ -736,34 +753,17 @@ int w_setDefaultImageFilter(lua_State *L)
|
|
|
f.min = min;
|
|
|
f.mag = mag;
|
|
|
|
|
|
- instance->setDefaultImageFilter(f);
|
|
|
+ instance->setDefaultFilter(f);
|
|
|
|
|
|
float anisotropy = (float) luaL_optnumber(L, 3, 1.0);
|
|
|
instance->setDefaultAnisotropy(anisotropy);
|
|
|
-
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int w_getBlendMode(lua_State *L)
|
|
|
-{
|
|
|
- try
|
|
|
- {
|
|
|
- Graphics::BlendMode mode = instance->getBlendMode();
|
|
|
- const char *str;
|
|
|
- if (!Graphics::getConstant(mode, str))
|
|
|
- return luaL_error(L, "Unknown blend mode");
|
|
|
- lua_pushstring(L, str);
|
|
|
- return 1;
|
|
|
- }
|
|
|
- catch (love::Exception &e)
|
|
|
- {
|
|
|
- return luaL_error(L, "%s", e.what());
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-int w_getDefaultImageFilter(lua_State *L)
|
|
|
+int w_getDefaultFilter(lua_State *L)
|
|
|
{
|
|
|
- const Image::Filter &f = instance->getDefaultImageFilter();
|
|
|
+ const Image::Filter &f = instance->getDefaultFilter();
|
|
|
const char *minstr;
|
|
|
const char *magstr;
|
|
|
if (!Image::getConstant(f.min, minstr))
|
|
@@ -1409,9 +1409,9 @@ static const luaL_Reg functions[] =
|
|
|
{ "getFont", w_getFont },
|
|
|
|
|
|
{ "setBlendMode", w_setBlendMode },
|
|
|
- { "setDefaultImageFilter", w_setDefaultImageFilter },
|
|
|
{ "getBlendMode", w_getBlendMode },
|
|
|
- { "getDefaultImageFilter", w_getDefaultImageFilter },
|
|
|
+ { "setDefaultFilter", w_setDefaultFilter },
|
|
|
+ { "getDefaultFilter", w_getDefaultFilter },
|
|
|
{ "setDefaultMipmapFilter", w_setDefaultMipmapFilter },
|
|
|
{ "getDefaultMipmapFilter", w_getDefaultMipmapFilter },
|
|
|
{ "setLineWidth", w_setLineWidth },
|