graphics fixes

* zooming without real FBOs kinda works, but with lower quality
* hardware detection for glGenerateMipmaps
* possibility to disable bilinear filtering, mipmaps, framebuffers, and realtime mipmap generation in g_graphics
* otclient works well using 3D acceleration in VirtualBox again
* many fixes regarding FBOs fallback implementation
This commit is contained in:
Eduardo Bart
2012-03-21 09:41:43 -03:00
parent 01d5fad315
commit c7469e4454
11 changed files with 98 additions and 42 deletions

View File

@@ -24,6 +24,7 @@
#include <framework/graphics/painter.h>
#include <framework/graphics/texture.h>
#include <framework/graphics/texturemanager.h>
#include <framework/graphics/graphics.h>
void UIWidget::initImage()
{
@@ -167,7 +168,7 @@ void UIWidget::drawImage(const Rect& screenCoords)
m_imageTexture->setSmooth(m_imageSmooth);
// this will increase fps when rendering larger images, like the background, and improve image quality
if(m_imageSmooth && !m_imageTexture->hasMipmaps())
if(m_imageSmooth && g_graphics.canGenerateMipmaps() && !m_imageTexture->hasMipmaps())
m_imageTexture->generateMipmaps();
g_painter.setColor(m_imageColor);

View File

@@ -57,7 +57,8 @@ void UIWidget::drawText(const Rect& screenCoords)
m_textCachedScreenCoords = screenCoords;
m_textCoordsBuffer.clear();
m_font->calculateDrawTextCoords(m_textCoordsBuffer, m_text, screenCoords, m_textAlign);
m_font->calculateDrawTextCoords(m_textCoordsBuffer, m_text, screenCoords.translated(m_textOffset), m_textAlign);
}
g_painter.setColor(m_color);