mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Merge from root
This commit is contained in:
@@ -232,7 +232,7 @@ int w_Source_setVolumeLimits(lua_State *L)
|
||||
if (vmin < .0f || vmin > 1.f || vmax < .0f || vmax > 1.f)
|
||||
return luaL_error(L, "Invalid volume limits: [%f:%f]. Must be in [0:1]", vmin, vmax);
|
||||
t->setMinVolume(vmin);
|
||||
t->setMaxVolume(vmin);
|
||||
t->setMaxVolume(vmax);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ StringMap<Graphics::BlendMode, Graphics::BLEND_MAX_ENUM>::Entry Graphics::blendM
|
||||
{ "subtractive", Graphics::BLEND_SUBTRACTIVE },
|
||||
{ "multiplicative", Graphics::BLEND_MULTIPLICATIVE },
|
||||
{ "premultiplied", Graphics::BLEND_PREMULTIPLIED },
|
||||
{ "none", Graphics::BLEND_NONE },
|
||||
};
|
||||
|
||||
StringMap<Graphics::BlendMode, Graphics::BLEND_MAX_ENUM> Graphics::blendModes(Graphics::blendModeEntries, sizeof(Graphics::blendModeEntries));
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
BLEND_SUBTRACTIVE,
|
||||
BLEND_MULTIPLICATIVE,
|
||||
BLEND_PREMULTIPLIED,
|
||||
BLEND_NONE,
|
||||
BLEND_MAX_ENUM
|
||||
};
|
||||
|
||||
|
||||
@@ -553,6 +553,8 @@ void Graphics::setBlendMode(Graphics::BlendMode mode)
|
||||
glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
||||
else if (mode == BLEND_PREMULTIPLIED)
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
else if (mode == BLEND_NONE)
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
else // mode == BLEND_ADDITIVE || mode == BLEND_SUBTRACTIVE
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
}
|
||||
@@ -588,6 +590,8 @@ Graphics::BlendMode Graphics::getBlendMode()
|
||||
return BLEND_MULTIPLICATIVE;
|
||||
else if (src == GL_ONE && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD
|
||||
return BLEND_PREMULTIPLIED;
|
||||
else if (src == GL_ONE && dst == GL_ZERO)
|
||||
return BLEND_NONE;
|
||||
|
||||
return BLEND_MAX_ENUM; // Should never be reached.
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ void Image::drawv(const Matrix &t, const vertex *v) const
|
||||
|
||||
bool Image::hasNpot()
|
||||
{
|
||||
return GLEE_ARB_texture_non_power_of_two != 0;
|
||||
return GLEE_VERSION_2_0 || GLEE_ARB_texture_non_power_of_two;
|
||||
}
|
||||
|
||||
bool Image::hasMipmapSupport()
|
||||
|
||||
Reference in New Issue
Block a user