mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
show private message on screen
* disable GL blending in some situations to speedup on older hardware * fix wrap size in CachedText
This commit is contained in:
@@ -55,6 +55,8 @@ void CachedText::update()
|
||||
|
||||
void CachedText::wrapText(int maxWidth)
|
||||
{
|
||||
if(m_font)
|
||||
if(m_font) {
|
||||
m_text = m_font->wrapText(m_text, maxWidth);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
@@ -148,10 +148,10 @@ void FrameBuffer::internalRelease()
|
||||
|
||||
// restore screen original content
|
||||
if(m_backuping) {
|
||||
Painter::CompositionMode oldComposition = g_painter->getCompositionMode();
|
||||
g_painter->setCompositionMode(Painter::CompositionMode_Replace);
|
||||
glDisable(GL_BLEND);
|
||||
g_painter->setColor(Color::white);
|
||||
g_painter->drawTexturedRect(screenRect, m_screenBackup, screenRect);
|
||||
g_painter->setCompositionMode(oldComposition);
|
||||
glEnable(GL_BLEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -79,13 +79,6 @@ void Graphics::init()
|
||||
// blending is always enabled
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
// face culling may improve performance
|
||||
/*
|
||||
glCullFace(GL_BACK);
|
||||
glFrontFace(GL_CW);
|
||||
glEnable(GL_CULL_FACE);
|
||||
*/
|
||||
|
||||
// determine max texture size
|
||||
GLint maxTextureSize = 0;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
|
||||
|
@@ -162,9 +162,8 @@ void Painter::updateGlCompositionMode()
|
||||
case CompositionMode_Normal:
|
||||
if(g_graphics.canUseBlendFuncSeparate())
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
|
||||
else {
|
||||
else
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
break;
|
||||
case CompositionMode_Multiply:
|
||||
glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
Reference in New Issue
Block a user