mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
The default filter mode is now included in the state affected by love.graphics.push("all").
This commit is contained in:
@@ -101,6 +101,9 @@ void Graphics::restoreState(const DisplayState &s)
|
|||||||
|
|
||||||
setColorMask(s.colorMask);
|
setColorMask(s.colorMask);
|
||||||
setWireframe(s.wireframe);
|
setWireframe(s.wireframe);
|
||||||
|
|
||||||
|
setDefaultFilter(s.defaultFilter);
|
||||||
|
setDefaultMipmapFilter(s.defaultMipmapFilter, s.defaultMipmapSharpness);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::restoreStateChecked(const DisplayState &s)
|
void Graphics::restoreStateChecked(const DisplayState &s)
|
||||||
@@ -158,6 +161,9 @@ void Graphics::restoreStateChecked(const DisplayState &s)
|
|||||||
|
|
||||||
if (s.wireframe != cur.wireframe)
|
if (s.wireframe != cur.wireframe)
|
||||||
setWireframe(s.wireframe);
|
setWireframe(s.wireframe);
|
||||||
|
|
||||||
|
setDefaultFilter(s.defaultFilter);
|
||||||
|
setDefaultMipmapFilter(s.defaultMipmapFilter, s.defaultMipmapSharpness);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::setViewportSize(int width, int height)
|
void Graphics::setViewportSize(int width, int height)
|
||||||
@@ -785,6 +791,7 @@ Graphics::BlendMode Graphics::getBlendMode() const
|
|||||||
void Graphics::setDefaultFilter(const Texture::Filter &f)
|
void Graphics::setDefaultFilter(const Texture::Filter &f)
|
||||||
{
|
{
|
||||||
Texture::setDefaultFilter(f);
|
Texture::setDefaultFilter(f);
|
||||||
|
states.back().defaultFilter = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Texture::Filter &Graphics::getDefaultFilter() const
|
const Texture::Filter &Graphics::getDefaultFilter() const
|
||||||
@@ -796,6 +803,9 @@ void Graphics::setDefaultMipmapFilter(Texture::FilterMode filter, float sharpnes
|
|||||||
{
|
{
|
||||||
Image::setDefaultMipmapFilter(filter);
|
Image::setDefaultMipmapFilter(filter);
|
||||||
Image::setDefaultMipmapSharpness(sharpness);
|
Image::setDefaultMipmapSharpness(sharpness);
|
||||||
|
|
||||||
|
states.back().defaultMipmapFilter = filter;
|
||||||
|
states.back().defaultMipmapSharpness = sharpness;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::getDefaultMipmapFilter(Texture::FilterMode *filter, float *sharpness) const
|
void Graphics::getDefaultMipmapFilter(Texture::FilterMode *filter, float *sharpness) const
|
||||||
@@ -1334,6 +1344,9 @@ Graphics::DisplayState::DisplayState()
|
|||||||
, font(nullptr)
|
, font(nullptr)
|
||||||
, shader(nullptr)
|
, shader(nullptr)
|
||||||
, wireframe(false)
|
, wireframe(false)
|
||||||
|
, defaultFilter()
|
||||||
|
, defaultMipmapFilter(Texture::FILTER_NONE)
|
||||||
|
, defaultMipmapSharpness(0.0f)
|
||||||
{
|
{
|
||||||
// We should just directly initialize the array in the initializer list, but
|
// We should just directly initialize the array in the initializer list, but
|
||||||
// that feature of C++11 is broken in Visual Studio 2013...
|
// that feature of C++11 is broken in Visual Studio 2013...
|
||||||
@@ -1355,6 +1368,9 @@ Graphics::DisplayState::DisplayState(const DisplayState &other)
|
|||||||
, shader(other.shader)
|
, shader(other.shader)
|
||||||
, canvases(other.canvases)
|
, canvases(other.canvases)
|
||||||
, wireframe(other.wireframe)
|
, wireframe(other.wireframe)
|
||||||
|
, defaultFilter(other.defaultFilter)
|
||||||
|
, defaultMipmapFilter(other.defaultMipmapFilter)
|
||||||
|
, defaultMipmapSharpness(other.defaultMipmapSharpness)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
colorMask[i] = other.colorMask[i];
|
colorMask[i] = other.colorMask[i];
|
||||||
@@ -1386,6 +1402,10 @@ Graphics::DisplayState &Graphics::DisplayState::operator = (const DisplayState &
|
|||||||
|
|
||||||
wireframe = other.wireframe;
|
wireframe = other.wireframe;
|
||||||
|
|
||||||
|
defaultFilter = other.defaultFilter;
|
||||||
|
defaultMipmapFilter = other.defaultMipmapFilter;
|
||||||
|
defaultMipmapSharpness = other.defaultMipmapSharpness;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -475,6 +475,13 @@ private:
|
|||||||
|
|
||||||
bool wireframe;
|
bool wireframe;
|
||||||
|
|
||||||
|
// Default filter.
|
||||||
|
Texture::Filter defaultFilter;
|
||||||
|
|
||||||
|
// Default mipmap filter and sharpness.
|
||||||
|
Texture::FilterMode defaultMipmapFilter;
|
||||||
|
float defaultMipmapSharpness;
|
||||||
|
|
||||||
DisplayState();
|
DisplayState();
|
||||||
DisplayState(const DisplayState &other);
|
DisplayState(const DisplayState &other);
|
||||||
~DisplayState();
|
~DisplayState();
|
||||||
|
|||||||
Reference in New Issue
Block a user