Prechádzať zdrojové kódy

Renamed love.graphics.setDefaultImageFilter to love.graphics.setDefaultFilter

Alex Szpakowski 12 rokov pred
rodič
commit
7e753a0acb

+ 2 - 2
src/modules/graphics/opengl/Graphics.cpp

@@ -629,12 +629,12 @@ Graphics::BlendMode Graphics::getBlendMode() const
 	throw Exception("Unknown blend mode");
 }
 
-void Graphics::setDefaultImageFilter(const Image::Filter &f)
+void Graphics::setDefaultFilter(const Image::Filter &f)
 {
 	Image::setDefaultFilter(f);
 }
 
-const Image::Filter &Graphics::getDefaultImageFilter() const
+const Image::Filter &Graphics::getDefaultFilter() const
 {
 	return Image::getDefaultFilter();
 }

+ 7 - 7
src/modules/graphics/opengl/Graphics.h

@@ -305,19 +305,19 @@ public:
 	void setBlendMode(BlendMode mode);
 
 	/**
-	 * Sets the current image filter.
+	 * Gets the current blend mode.
 	 **/
-	void setDefaultImageFilter(const Image::Filter &f);
+	BlendMode getBlendMode() const;
 
 	/**
-	 * Gets the current blend mode.
+	 * Sets the default filter for images, canvases, and fonts.
 	 **/
-	BlendMode getBlendMode() const;
+	void setDefaultFilter(const Image::Filter &f);
 
 	/**
-	 * Gets the current image filter.
+	 * Gets the default filter for images, canvases, and fonts.
 	 **/
-	const Image::Filter &getDefaultImageFilter() const;
+	const Image::Filter &getDefaultFilter() const;
 
 	/**
 	 * Default texture anisotropic filtering level.
@@ -326,7 +326,7 @@ public:
 	float getDefaultAnisotropy() const;
 
 	/**
-	 * Default Image mipmap filtermode and sharpness values.
+	 * Default Image mipmap filter mode and sharpness values.
 	 **/
 	void setDefaultMipmapFilter(Image::FilterMode filter, float sharpness);
 	void getDefaultMipmapFilter(Image::FilterMode *filter, float *sharpness) const;

+ 26 - 26
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -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 },

+ 2 - 2
src/modules/graphics/opengl/wrap_Graphics.h

@@ -72,9 +72,9 @@ int w_getBackgroundColor(lua_State *L);
 int w_setFont(lua_State *L);
 int w_getFont(lua_State *L);
 int w_setBlendMode(lua_State *L);
-int w_setDefaultImageFilter(lua_State *L);
 int w_getBlendMode(lua_State *L);
-int w_getDefaultImageFilter(lua_State *L);
+int w_setDefaultFilter(lua_State *L);
+int w_getDefaultFilter(lua_State *L);
 int w_setDefaultMipmapFilter(lua_State *L);
 int w_getDefaultMipmapFilter(lua_State *L);
 int w_setLineWidth(lua_State *L);