mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +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);
|
||||
|
@@ -125,9 +125,8 @@ void MapView::draw(const Rect& rect)
|
||||
drawOffset.y += (srcVisible.height() - srcSize.height()) / 2;
|
||||
Rect srcRect = Rect(drawOffset, srcSize);
|
||||
|
||||
g_painter->saveState();
|
||||
g_painter->setColor(Color::white);
|
||||
g_painter->setCompositionMode(Painter::CompositionMode_Replace);
|
||||
glDisable(GL_BLEND);
|
||||
#if 0
|
||||
// debug source area
|
||||
g_painter->saveAndResetState();
|
||||
@@ -140,7 +139,7 @@ void MapView::draw(const Rect& rect)
|
||||
#else
|
||||
m_framebuffer->draw(rect, srcRect);
|
||||
#endif
|
||||
g_painter->restoreSavedState();
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
//g_painter->resetShaderProgram();
|
||||
|
||||
|
@@ -55,11 +55,10 @@ void UIMap::drawSelf(Fw::DrawPane drawPane)
|
||||
g_painter->drawBoundingRect(m_mapRect.expanded(1));
|
||||
|
||||
if(drawPane != Fw::BothPanes) {
|
||||
g_painter->saveState();
|
||||
g_painter->setCompositionMode(Painter::CompositionMode_Replace);
|
||||
glDisable(GL_BLEND);
|
||||
g_painter->setColor(Color::alpha);
|
||||
g_painter->drawFilledRect(m_mapRect);
|
||||
g_painter->restoreSavedState();
|
||||
glEnable(GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user