mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
cache rendering of UILabel
This commit is contained in:
@@ -42,6 +42,9 @@ FrameBuffer::~FrameBuffer()
|
||||
|
||||
void FrameBuffer::resize(const Size& size)
|
||||
{
|
||||
if(m_texture && m_texture->getSize() == size)
|
||||
return;
|
||||
|
||||
internalBind();
|
||||
m_texture = TexturePtr(new Texture(size.width(), size.height(), 4));
|
||||
m_texture->setSmooth(true);
|
||||
|
@@ -131,8 +131,8 @@ void Painter::setCompositionMode(Painter::CompositionMode compositionMode)
|
||||
case CompositionMode_Multiply:
|
||||
glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
case CompositionMode_Addition:
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
case CompositionMode_Add:
|
||||
glBlendFunc(GL_ONE, GL_ONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
enum CompositionMode {
|
||||
CompositionMode_Normal,
|
||||
CompositionMode_Multiply,
|
||||
CompositionMode_Addition
|
||||
CompositionMode_Add
|
||||
};
|
||||
|
||||
void init();
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
void setCustomProgram(PainterShaderProgramPtr program);
|
||||
void releaseCustomProgram() { m_customProgram = nullptr; }
|
||||
void setCompositionMode(CompositionMode compositionMode);
|
||||
void resetCompositionMode() { setCompositionMode(CompositionMode_Normal); }
|
||||
|
||||
void setProjectionMatrix(const Matrix3& projectionMatrix) { m_projectionMatrix = projectionMatrix; }
|
||||
Matrix3 getProjectionMatrix() { return m_projectionMatrix; }
|
||||
|
@@ -163,7 +163,7 @@ bool ParticleEmitter::load(const OTMLNodePtr& node)
|
||||
else if(childNode->value() == "multiply")
|
||||
m_pCompositionMode = Painter::CompositionMode_Multiply;
|
||||
else if(childNode->value() == "addition")
|
||||
m_pCompositionMode = Painter::CompositionMode_Addition;
|
||||
m_pCompositionMode = Painter::CompositionMode_Add;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user