mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Changed the optional 'multiply alpha' boolean argument in love.graphics.setBlendMode to be an enum with constants 'alphamultiply' and 'premultiplied'.
The default value for the second argument of setBlendMode is 'alphamultiply'.
This commit is contained in:
@@ -82,6 +82,16 @@ bool Graphics::getConstant(BlendMode in, const char *&out)
|
||||
return blendModes.find(in, out);
|
||||
}
|
||||
|
||||
bool Graphics::getConstant(const char *in, BlendAlpha &out)
|
||||
{
|
||||
return blendAlphaModes.find(in, out);
|
||||
}
|
||||
|
||||
bool Graphics::getConstant(BlendAlpha in, const char *&out)
|
||||
{
|
||||
return blendAlphaModes.find(in, out);
|
||||
}
|
||||
|
||||
bool Graphics::getConstant(const char *in, LineStyle &out)
|
||||
{
|
||||
return lineStyles.find(in, out);
|
||||
@@ -172,16 +182,24 @@ StringMap<Graphics::DrawMode, Graphics::DRAW_MAX_ENUM> Graphics::drawModes(Graph
|
||||
|
||||
StringMap<Graphics::BlendMode, Graphics::BLEND_MAX_ENUM>::Entry Graphics::blendModeEntries[] =
|
||||
{
|
||||
{ "alpha", BLEND_ALPHA },
|
||||
{ "add", BLEND_ADD },
|
||||
{ "alpha", BLEND_ALPHA },
|
||||
{ "add", BLEND_ADD },
|
||||
{ "subtract", BLEND_SUBTRACT },
|
||||
{ "multiply", BLEND_MULTIPLY },
|
||||
{ "screen", BLEND_SCREEN },
|
||||
{ "replace", BLEND_REPLACE },
|
||||
{ "screen", BLEND_SCREEN },
|
||||
{ "replace", BLEND_REPLACE },
|
||||
};
|
||||
|
||||
StringMap<Graphics::BlendMode, Graphics::BLEND_MAX_ENUM> Graphics::blendModes(Graphics::blendModeEntries, sizeof(Graphics::blendModeEntries));
|
||||
|
||||
StringMap<Graphics::BlendAlpha, Graphics::BLENDALPHA_MAX_ENUM>::Entry Graphics::blendAlphaEntries[] =
|
||||
{
|
||||
{ "alphamultiply", BLENDALPHA_MULTIPLY },
|
||||
{ "premultiplied", BLENDALPHA_PREMULTIPLIED },
|
||||
};
|
||||
|
||||
StringMap<Graphics::BlendAlpha, Graphics::BLENDALPHA_MAX_ENUM> Graphics::blendAlphaModes(Graphics::blendAlphaEntries, sizeof(Graphics::blendAlphaEntries));
|
||||
|
||||
StringMap<Graphics::LineStyle, Graphics::LINE_MAX_ENUM>::Entry Graphics::lineStyleEntries[] =
|
||||
{
|
||||
{ "smooth", LINE_SMOOTH },
|
||||
|
||||
Reference in New Issue
Block a user