From 61ce943b5b10edfda966df803a5e2007331cae5a Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Mon, 24 Sep 2018 11:16:39 -0700 Subject: [PATCH] Fixed Qt 4.8 errors. --- common/lc_stringcache.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/lc_stringcache.cpp b/common/lc_stringcache.cpp index b13d9635..9832a2f5 100644 --- a/common/lc_stringcache.cpp +++ b/common/lc_stringcache.cpp @@ -73,7 +73,7 @@ void lcStringCache::CacheStrings(lcContext* Context, const QStringList& Strings) if (!Update) return; - QImage Image(128, 128, QImage::Format_RGBA8888); + QImage Image(128, 128, QImage::Format_ARGB32); QPainter Painter; QFont Font("Helvetica", 20); int DestX = 0, DestY = 0, DestHeight = 0; @@ -113,13 +113,11 @@ void lcStringCache::CacheStrings(lcContext* Context, const QStringList& Strings) for (int y = SourceRect.top(); y < SourceRect.bottom(); y++) { - const unsigned char* Source = Image.constBits() + y * Image.width() * 4; unsigned char* Dest = mBuffer + ((String.Top - y) * mTexture->mWidth + String.Left) * 2; for (int x = SourceRect.left(); x < SourceRect.right(); x++) { - *Dest = *(Dest + 1) = *Source; - Source += 4; + *Dest = *(Dest + 1) = qRed(Image.pixel(x, y)); Dest += 2; } }