mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Removed some redundant internal code.
This commit is contained in:
@@ -1528,87 +1528,6 @@ void Graphics::origin()
|
|||||||
pixelSizeStack.back() = 1;
|
pixelSizeStack.back() = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphics::DisplayState::DisplayState()
|
|
||||||
: color(255, 255, 255, 255)
|
|
||||||
, backgroundColor(0, 0, 0, 255)
|
|
||||||
, blendMode(BLEND_ALPHA)
|
|
||||||
, blendMultiplyAlpha(true)
|
|
||||||
, lineWidth(1.0f)
|
|
||||||
, lineStyle(LINE_SMOOTH)
|
|
||||||
, lineJoin(LINE_JOIN_MITER)
|
|
||||||
, pointSize(1.0f)
|
|
||||||
, scissor(false)
|
|
||||||
, scissorBox()
|
|
||||||
, stencilTest(false)
|
|
||||||
, stencilInvert(false)
|
|
||||||
, font(nullptr)
|
|
||||||
, shader(nullptr)
|
|
||||||
, colorMask({true, true, true, true})
|
|
||||||
, wireframe(false)
|
|
||||||
, defaultFilter()
|
|
||||||
, defaultMipmapFilter(Texture::FILTER_NEAREST)
|
|
||||||
, defaultMipmapSharpness(0.0f)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphics::DisplayState::DisplayState(const DisplayState &other)
|
|
||||||
: color(other.color)
|
|
||||||
, backgroundColor(other.backgroundColor)
|
|
||||||
, blendMode(other.blendMode)
|
|
||||||
, blendMultiplyAlpha(other.blendMultiplyAlpha)
|
|
||||||
, lineWidth(other.lineWidth)
|
|
||||||
, lineStyle(other.lineStyle)
|
|
||||||
, lineJoin(other.lineJoin)
|
|
||||||
, pointSize(other.pointSize)
|
|
||||||
, scissor(other.scissor)
|
|
||||||
, scissorBox(other.scissorBox)
|
|
||||||
, stencilTest(other.stencilTest)
|
|
||||||
, stencilInvert(other.stencilInvert)
|
|
||||||
, font(other.font)
|
|
||||||
, shader(other.shader)
|
|
||||||
, canvases(other.canvases)
|
|
||||||
, colorMask(other.colorMask)
|
|
||||||
, wireframe(other.wireframe)
|
|
||||||
, defaultFilter(other.defaultFilter)
|
|
||||||
, defaultMipmapFilter(other.defaultMipmapFilter)
|
|
||||||
, defaultMipmapSharpness(other.defaultMipmapSharpness)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphics::DisplayState::~DisplayState()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphics::DisplayState &Graphics::DisplayState::operator = (const DisplayState &other)
|
|
||||||
{
|
|
||||||
color = other.color;
|
|
||||||
backgroundColor = other.backgroundColor;
|
|
||||||
blendMode = other.blendMode;
|
|
||||||
blendMultiplyAlpha = other.blendMultiplyAlpha;
|
|
||||||
lineWidth = other.lineWidth;
|
|
||||||
lineStyle = other.lineStyle;
|
|
||||||
lineJoin = other.lineJoin;
|
|
||||||
pointSize = other.pointSize;
|
|
||||||
scissor = other.scissor;
|
|
||||||
scissorBox = other.scissorBox;
|
|
||||||
stencilTest = other.stencilTest;
|
|
||||||
stencilInvert = other.stencilInvert;
|
|
||||||
|
|
||||||
font = other.font;
|
|
||||||
shader = other.shader;
|
|
||||||
canvases = other.canvases;
|
|
||||||
|
|
||||||
colorMask = other.colorMask;
|
|
||||||
|
|
||||||
wireframe = other.wireframe;
|
|
||||||
|
|
||||||
defaultFilter = other.defaultFilter;
|
|
||||||
defaultMipmapFilter = other.defaultMipmapFilter;
|
|
||||||
defaultMipmapSharpness = other.defaultMipmapSharpness;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // opengl
|
} // opengl
|
||||||
} // graphics
|
} // graphics
|
||||||
} // love
|
} // love
|
||||||
|
|||||||
@@ -463,44 +463,38 @@ private:
|
|||||||
|
|
||||||
struct DisplayState
|
struct DisplayState
|
||||||
{
|
{
|
||||||
Color color;
|
Color color = Color(255, 255, 255, 255);
|
||||||
Color backgroundColor;
|
Color backgroundColor = Color(0, 0, 0, 255);
|
||||||
|
|
||||||
BlendMode blendMode;
|
BlendMode blendMode = BLEND_ALPHA;
|
||||||
bool blendMultiplyAlpha;
|
bool blendMultiplyAlpha = true;
|
||||||
|
|
||||||
float lineWidth;
|
float lineWidth = 1.0f;
|
||||||
LineStyle lineStyle;
|
LineStyle lineStyle = LINE_SMOOTH;
|
||||||
LineJoin lineJoin;
|
LineJoin lineJoin = LINE_JOIN_MITER;
|
||||||
|
|
||||||
float pointSize;
|
float pointSize = 1.0f;
|
||||||
|
|
||||||
bool scissor;
|
bool scissor = false;
|
||||||
OpenGL::Viewport scissorBox;
|
OpenGL::Viewport scissorBox = OpenGL::Viewport();
|
||||||
|
|
||||||
// Stencil.
|
// Stencil.
|
||||||
bool stencilTest;
|
bool stencilTest = false;
|
||||||
bool stencilInvert;
|
bool stencilInvert = false;
|
||||||
|
|
||||||
StrongRef<Font> font;
|
StrongRef<Font> font;
|
||||||
StrongRef<Shader> shader;
|
StrongRef<Shader> shader;
|
||||||
|
|
||||||
std::vector<StrongRef<Canvas>> canvases;
|
std::vector<StrongRef<Canvas>> canvases;
|
||||||
|
|
||||||
ColorMask colorMask;
|
ColorMask colorMask = {true, true, true, true};
|
||||||
|
|
||||||
bool wireframe;
|
bool wireframe = false;
|
||||||
|
|
||||||
Texture::Filter defaultFilter;
|
Texture::Filter defaultFilter = Texture::Filter();
|
||||||
|
|
||||||
Texture::FilterMode defaultMipmapFilter;
|
Texture::FilterMode defaultMipmapFilter = Texture::FILTER_NEAREST;
|
||||||
float defaultMipmapSharpness;
|
float defaultMipmapSharpness = 0.0f;
|
||||||
|
|
||||||
DisplayState();
|
|
||||||
DisplayState(const DisplayState &other);
|
|
||||||
~DisplayState();
|
|
||||||
|
|
||||||
DisplayState &operator = (const DisplayState &other);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void restoreState(const DisplayState &s);
|
void restoreState(const DisplayState &s);
|
||||||
|
|||||||
Reference in New Issue
Block a user