mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Removed love.graphics.setColorMode
- The "replace" color mode can easily be duplicated with love.graphics.setColor(255, 255, 255) - The current color mode has no effect when a shader is active - Color mode functionality can easily be replicated with shaders - OpenGL ES 2 (iOS, Android, etc) does not have the functions used by love.graphics.setColorMode
This commit is contained in:
@@ -75,7 +75,6 @@ DisplayState Graphics::saveState()
|
||||
s.backgroundColor = getBackgroundColor();
|
||||
|
||||
s.blendMode = getBlendMode();
|
||||
s.colorMode = getColorMode();
|
||||
//get line style
|
||||
s.lineStyle = lineStyle;
|
||||
//get the point size
|
||||
@@ -96,7 +95,6 @@ void Graphics::restoreState(const DisplayState &s)
|
||||
setColor(s.color);
|
||||
setBackgroundColor(s.backgroundColor);
|
||||
setBlendMode(s.blendMode);
|
||||
setColorMode(s.colorMode);
|
||||
setLine(lineWidth, s.lineStyle);
|
||||
setPoint(s.pointSize, s.pointStyle);
|
||||
if (s.scissor)
|
||||
@@ -576,20 +574,6 @@ void Graphics::setBlendMode(Graphics::BlendMode mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::setColorMode(Graphics::ColorMode mode)
|
||||
{
|
||||
if (mode == COLOR_MODULATE)
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
else if (mode == COLOR_COMBINE)
|
||||
{
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_ADD_SIGNED);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
||||
}
|
||||
else // mode = COLOR_REPLACE
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
}
|
||||
|
||||
Graphics::BlendMode Graphics::getBlendMode() const
|
||||
{
|
||||
const int gl_1_4 = GLEE_VERSION_1_4;
|
||||
@@ -638,19 +622,6 @@ Graphics::BlendMode Graphics::getBlendMode() const
|
||||
throw Exception("Unknown blend mode");
|
||||
}
|
||||
|
||||
Graphics::ColorMode Graphics::getColorMode() const
|
||||
{
|
||||
GLint mode;
|
||||
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &mode);
|
||||
|
||||
if (mode == GL_MODULATE)
|
||||
return COLOR_MODULATE;
|
||||
else if (mode == GL_COMBINE)
|
||||
return COLOR_COMBINE;
|
||||
else // mode == GL_REPLACE
|
||||
return COLOR_REPLACE;
|
||||
}
|
||||
|
||||
void Graphics::setDefaultImageFilter(const Image::Filter &f)
|
||||
{
|
||||
Image::setDefaultFilter(f);
|
||||
|
||||
Reference in New Issue
Block a user